[QUESTION] - how can I reference a specific sub agent configured in md file in github actions PR workflow? #576
Replies: 3 comments
-
|
Hi, I believe you can create a claude code action workflow files that run on schedule specifying prompt: "Run fixer agent " and Claude will run the subagent if you commit the fixer.md into your git repository. |
Beta Was this translation helpful? Give feedback.
-
|
Two small corrections:
So the workflow pattern is:
For two repos (backend + client), check out both and grant access to the second path with Also note that subagents are loaded at session start, so if you add the file manually, start a fresh run/session so it gets picked up. |
Beta Was this translation helpful? Give feedback.
-
|
You can reference your custom subagent by pointing Claude to it via the Option 1: Reference the agent directly in the prompt- uses: anthropics/claude-code-action@v1
with:
prompt: |
Use the agent defined in .claude/agents/fixer.md to analyze and fix
the issues in this repository. Follow the agent's instructions exactly.
claude_model: claude-sonnet-4-6Option 2: Use custom_instructions to always load the agent- uses: anthropics/claude-code-action@v1
with:
custom_instructions: |
You have a custom agent defined at .claude/agents/fixer.md.
Read it and follow its instructions for this task.
prompt: "Run the fixer agent on the latest changes"Option 3: Use CLAUDE.md (recommended for persistent setup)Add to your repo's ## Agents
- When asked to "fix" issues, follow the instructions in `.claude/agents/fixer.md`Then your workflow just needs: - uses: anthropics/claude-code-action@v1
with:
prompt: "Run the fixer agent on this PR"Claude Code will read For scheduled daily runson:
schedule:
- cron: '0 9 * * *' # 9 AM daily
jobs:
fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
prompt: |
Read .claude/agents/fixer.md and execute its instructions.
Create a PR with any fixes found.
claude_model: claude-sonnet-4-6I use a similar pattern in my own projects with continuous-improve — the key is making sure the agent See it in action: before vs afterBefore (agent without discipline): After (agent with continuous-improve installed):
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello All, I am new to claude code.
what I am trying to achieve is building a specific agent that does a specific thing and have created an .md file under claude/agents/fixer.md
in the fixer.md there are description and instructions on what the agent should do.
I wanna schedule a workflow that runs once a day that would call that agent
I did not see an example how would I call this specific agent in the workflow when using the claude code action? I only saw examples of prompts or by referencing @claude in the comments
but how can I call this agent from the md file that I have created that already explains to the agent what to do?
would love for some help
I would like to know also is how can I let the agent decide on which repo to make a code fix if I have two seperate repos? backend+client?
thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions