OmniscioGuidesExamplesAnswer @claude mentions
Claude Code Action: the @claude mention workflow
This is the workflow Anthropic's quick setup installs, and the one to start with. You write @claude fix this in a comment; a runner in your own repository reads the code, makes the change and pushes a commit.
The YAML below is examples/claude.yml from the action's repository, reproduced whole. After it: what each event and each permission buys, why the if: block is longer than it looks, how to prove it answered, and the five checks to run when it does not.
Last checked against Anthropic's documentation and the action's examples on November 25, 2026. By the Omniscio team. Updated .
When it runs
Four events, each of which someone can put @claude into:
issue_commentoncreated— the event Anthropic's workflow pairs with "an issue or pull request comment", so one trigger covers both.pull_request_review_commentoncreated— a comment on a specific line of a diff.pull_request_reviewonsubmitted— the body of a review that was submitted.issuesonopenedorassigned— the body or title of a newly opened issue, or an issue assigned to Claude. Assignment alone is not enough: the job'sif:still looks for the phrase in the issue's body or title, so an issue assigned without@claudein it starts a run that is then skipped.
What happens next depends on the person. On issue and pull request events the person who triggered the run needs write access to the repository, and on every event a bot actor is rejected unless you list it in allowed_bots. Those two checks run before Claude starts, and the run fails if either one rejects it.
Sources: the trigger list in examples/claude.yml; "Interactive and automation modes" and "Who can trigger runs" in Anthropic's GitHub Actions page. Read November 25, 2026.
The workflow
Save it as .github/workflows/claude.yml. Anthropic describes this file as a working workflow, not just an example: as committed, Claude responds whenever someone mentions @claude in an issue or pull request.
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}Upstream's file also carries four commented-out optional inputs — trigger_phrase, assignee_trigger, claude_args and settings. They are left out here because a commented block is not part of the workflow. Two of them, trigger_phrase and assignee_trigger, are explained under trigger variants, with the catch in each one.
Source: examples/claude.yml, read November 25, 2026.
What each key does
| Key | What it does here |
|---|---|
on | The four events above. Every one of them is a place a person can type @claude. |
if | Stops a runner starting for a comment that never mentions @claude. It has to be this long because the mention arrives in a different field on each event: comment.body, review.body, issue.body, issue.title. The action also checks the trigger phrase itself before responding, so the if: is a cost saving rather than the check. |
permissions.contents: write | Lets Claude modify repository files and push the commit. |
permissions.pull-requests: write | Lets it push to the pull request branch and comment on it. Claude does not open pull requests by its own choice; it pushes commits and hands you a pre-filled pull request link, which keeps your branch protection in force. |
permissions.issues: write | Lets it answer in the issue thread. |
permissions.id-token: write | The OIDC token for the action's default GitHub App authentication. |
permissions.actions: read | The permission half of reading CI results. Reading them takes two things: this permission on the workflow, and additional_permissions: | / actions: read on the action itself. The published file has the first only — add the input if you want "why did the tests fail" to be a question Claude can answer. |
runs-on: ubuntu-latest | The runner image. ubuntu-latest is what every published example uses. |
actions/checkout | Gives Claude a local copy of the repository to work in. The published file asks for fetch-depth: 1 — a shallow clone, which is all a change needs when Claude is reading the working tree rather than history. |
id: claude | A name for this step, so later steps can read its outputs. Harmless to keep even if you never do. |
with.anthropic_api_key | The credential, and the only with: key this workflow needs. No prompt means interactive mode: it waits for the mention. |
Once the file is merged, the comment is the whole interface. Anthropic's own examples are @claude implement this feature based on the issue description, @claude how should I implement user authentication for this endpoint? and @claude fix the TypeError in the user dashboard component.
Sources: "Respond to @claude mentions" in Anthropic's GitHub Actions page; "Can Claude see my GitHub Actions CI results?" in the FAQ. Read November 25, 2026.
Secrets and permissions
- The secret.
ANTHROPIC_API_KEYfrom the Claude Console, orCLAUDE_CODE_OAUTH_TOKENmade withclaude setup-token. For the subscription road, replace theanthropic_api_keyline withclaude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}— that one line is the whole difference. - The five permissions above. This is the broadest of the five example workflows, because it is the only one where Claude writes code: contents and pull requests both need write.
- The Claude GitHub App, installed on the repository. It relies on Contents, Issues and Pull requests, all read and write. Installing it grants a larger set for other Claude features, and GitHub does not let you accept a subset.
- No
github_token. Passing it is for a custom GitHub app of your own. With it, comments appear under that token's user instead ofclaude[bot]— and if you pass${{ secrets.GITHUB_TOKEN }}, your other workflows will not run on the commits Claude pushes, because GitHub does not trigger workflows from that token.
Sources: "Manual setup", "GitHub App permissions" and "CI not running on Claude's commits" in Anthropic's GitHub Actions page; the github_token row in Usage; "Why aren't comments posted as claude[bot]?" in the FAQ. Read November 25, 2026.
How to confirm it ran
- One comment, updated in place. Claude replies in a comment on the same issue or pull request and updates it as it works. It is built to update a single comment rather than post a new one per step, so look for the change inside the existing reply rather than for a new one.
- The Actions tab. A run appears under
Claude Code, the workflow's name. A run whose job was skipped — because theif:did not match, or because workflows are disabled for the repository — looks different from a run that failed, so check which you are looking at before changing anything. - The run log. The full execution trace. If Claude pushed a commit, that is what the log will show last.
Sources: "Respond to @claude mentions" in Anthropic's GitHub Actions page; "Why does Claude only update one comment instead of creating new ones?" and "How can I debug what Claude is doing?" in the FAQ. Read November 25, 2026.
The common failure
Nothing happens at all. Anthropic's troubleshooting list is the right order, because each check is cheaper than the next:
- The App. Is the Claude GitHub App installed on this repository, not only on the organization?
- Workflows. Are workflows enabled for the repository? A disabled Actions tab runs nothing.
- The secret. Is
ANTHROPIC_API_KEYorCLAUDE_CODE_OAUTH_TOKENset in repository secrets, and is the workflow pointing at the one that exists? - The word. Is
@claudea complete word?/claude,@claude-botand@claude!all fail, because the match is on word boundaries. - The person. Does the commenter have write access? If not, the run is refused before Claude starts.
The next most common failure is a different shape: Claude replies, then its commit arrives with no checks running on it. That is the github_token problem, not a Claude problem — GitHub does not trigger workflows on commits made with the default GITHUB_TOKEN. Remove the input, or pass a custom app token.
And one that looks like a bug and is not: Claude refuses to rebase, force-push, or open the pull request itself. It creates and pushes commits and hands you a link to a pre-filled pull request page, which keeps your branch protection rules in force.
Sources: "Troubleshooting" in Anthropic's GitHub Actions page; "Why won't Claude rebase my branch?" and "Why won't Claude create a pull request?" in the FAQ. Read November 25, 2026.
Trigger variants
Three inputs change when the workflow fires without changing anything else about it.
trigger_phrase— the phrase Claude responds to,@claudeby default. If you change it, change theif:block to match, or the job will never start.assignee_trigger— triggers when an issue is assigned to that user. Only used for issue assignment. Theissuestrigger andassignedtype are already in this workflow, but theif:still requires@claudein the issue, so an issue has to mention it as well — or you relax thatif:.label_trigger— triggers when that label is applied to an issue. As written this workflow cannot use it: applying a label is alabeledevent, which is not in itstypeslist, and theif:would still demand@claudein the issue. Add the type and relax theif:first. Combined withpromptandtrack_progress, an empty value accepts any label.
One input is worth adding for cost rather than for triggers: --max-turns in claude_args caps how many turns one mention may take. Anthropic's own cost advice also includes writing specific requests and keeping CLAUDE.md short, since Claude reads it on every run.
Sources: the trigger_phrase, assignee_trigger and label_trigger rows in Usage; "Manage costs" in Anthropic's GitHub Actions page. Read November 25, 2026.
Where these answers come from
- examples/claude.yml — the workflow on this page, reproduced whole.
- Claude Code GitHub Actions — the mention example, who can trigger, the App's permissions, troubleshooting and costs.
- Usage — every input named here, with its default.
- FAQ — one comment per run, CI results, and the commit/pull-request limits.
- The setup this workflow assumes is on Claude Code GitHub Actions; the other four workflows are on the examples hub.
Common questions
Why does @claude not respond?
The five checks under The common failure, in the order Anthropic lists them. The first three are setup, the fourth is the word, and the fifth is the person.
Can I use a different trigger phrase?
Yes — set trigger_phrase, and update the if: block to match it. The match is on word boundaries, so @claude-bot and @claude! do not count.
Why does Claude keep updating one comment?
It is deliberate: all responses, progress and the final result live in one comment with checkboxes, so the thread is not flooded.
Does this workflow need a prompt?
No, and adding one changes what it does: with no prompt it waits for the mention, and with a prompt it runs automatically on the event.