OmniscioGuidesExamplesReview every pull request
Claude Code Action: review every pull request
This is the workflow that reviews every pull request without anyone asking. Claude reads the diff and writes a comment against each line it has a problem with.
The YAML below is Anthropic's published comprehensive review example. What follows it is what each key does, what the three permissions are for, how to prove the review actually posted, and the line people leave out that leaves the whole thing green and silent.
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 on a pull request, and nothing else:
opened— the first review, as soon as the pull request exists.synchronize— a new commit was pushed to the branch, so the old review is out of date.ready_for_review— a draft was marked ready, which is when it becomes worth reviewing at all.reopened— a closed pull request came back.
What happens on a draft depends on which workflow you use. Anthropic's description of skipping drafts, closed pull requests, trivial ones and ones that already carry a comment from Claude is written about its review skill. The workflow on this page has no such filter: it reviews whatever the trigger fires on, which is why ready_for_review is in the list — so a draft is reviewed when it is marked ready, rather than while it is one.
One more limit belongs to GitHub rather than to Claude. On a public repository GitHub withholds secrets from runs triggered by a fork pull request, so the review runs only on pull requests from branches inside the same repository — and the action skips forks by default anyway.
Sources: the comprehensive review example for the trigger list; "Run a skill" in Anthropic's GitHub Actions page for the skipped kinds and the fork note; "Pull requests from forks" in the Security guide. Read November 25, 2026.
The workflow
Save it as .github/workflows/claude-review.yml. It is Anthropic's examples/pr-review-comprehensive.yml, every key and value as published, with the file's explanatory comments left out.
name: PR Review with Progress Tracking
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
jobs:
review-with-tracking:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: PR Review with Progress Tracking
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# Enable progress tracking
track_progress: true
# Your custom review instructions
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}
Perform a comprehensive code review with the following focus areas:
1. **Code Quality**
- Clean code principles and best practices
- Proper error handling and edge cases
- Code readability and maintainability
2. **Security**
- Check for potential security vulnerabilities
- Validate input sanitization
- Review authentication/authorization logic
3. **Performance**
- Identify potential performance bottlenecks
- Review database queries for efficiency
- Check for memory leaks or resource issues
4. **Testing**
- Verify adequate test coverage
- Review test quality and edge cases
- Check for missing test scenarios
5. **Documentation**
- Ensure code is properly documented
- Verify README updates for new features
- Check API documentation accuracy
Provide detailed feedback using inline comments for specific issues.
Use top-level comments for general observations or praise.
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"Source: examples/pr-review-comprehensive.yml, read November 25, 2026.
What each key does
| Key | What it does here |
|---|---|
on.pull_request.types | The four events above. Leave types out and GitHub runs the workflow only on opened, synchronize and reopened, so ready_for_review — the moment a draft becomes worth reviewing — never fires it. |
permissions | Scopes the workflow token. contents: read to read the code, pull-requests: write to post the review, id-token: write for the GitHub App exchange. |
actions/checkout@v6 | Puts the pull request's code on the runner, so Claude reads the change rather than the base branch. fetch-depth: 1 is the shallow checkout the published example asks for. |
anthropic_api_key | The credential. A subscription token replaces this one line with claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}. |
track_progress | true creates one comment on the pull request and ticks its checkboxes as the review proceeds, ending it as completed. It only works on specific pull request and issue events, which is why the trigger list has to include them. |
prompt | Presence alone puts the action in automation mode — the mode where it runs the moment the event fires, instead of waiting for someone to mention it. The REPO and PR NUMBER lines give Claude the two identifiers it needs; the numbered list is the review rubric. |
claude_args | CLI arguments. --allowedTools names what Claude may call: the inline comment tool, and three gh commands for reading the diff and posting a top-level comment. |
Two choices are yours. Narrow the rubric to what your team actually argues about — a review that lists five generic areas finds five generic things. And keep the review standards in CLAUDE.md at the repository root rather than in the prompt if they apply to every run, because Claude reads that file on every run anyway.
Sources: the inputs table and track_progress row in Usage; "Key Configuration" in the "Automatic PR Code Review" section of Solutions; "Define project standards in CLAUDE.md" in Anthropic's GitHub Actions page. Read November 25, 2026.
Secrets and permissions
One secret, three permissions, and one GitHub App.
- Secret
ANTHROPIC_API_KEY— a Claude API key from the Claude Console. If you made a subscription token withclaude setup-token, store it asCLAUDE_CODE_OAUTH_TOKENinstead. contents: read— the review reads the checkout. It never needs write: Claude reviews rather than edits.pull-requests: write— this is what lets the review land as comments on the pull request.id-token: write— the action authenticates as the Claude GitHub App by default, and that exchange needs an OpenID Connect token from GitHub. Leave it out and the run fails with one of the OIDC authentication errors in the action's FAQ.
The App itself needs Contents, Issues and Pull requests, all read and write, for the action's full set of jobs. A review uses less than that, but the App's permissions are granted as a set at install time.
Do not add github_token. Anthropic's inputs table says to pass it only when you are connecting a custom GitHub app of your own; with it, comments appear under that token's user instead of claude[bot], and use_sticky_comment stops updating.
A review is not free. Each run spends two separate things: GitHub Actions minutes on the runner, and Anthropic API tokens for the review itself — or your Claude plan, if you authenticated with a subscription token. A review of a large pull request is the most token-hungry of these five workflows, which is why --max-turns is worth setting.
Sources: "Manual setup", "GitHub App permissions" and "Manage costs" in Anthropic's GitHub Actions page; the OIDC entry and "Why aren't comments posted as claude[bot]?" in the FAQ; the github_token and use_sticky_comment rows in Usage. Read November 25, 2026.
How to confirm it ran
- On the pull request. With
track_progress: truethere is one comment fromclaude[bot]whose checkboxes move as the work proceeds, and it ends as completed. Inline comments appear against the lines they concern. - In the Actions tab. The run is listed under the workflow's name; open it and then its job. A finished job is not a review: the log is what says what Claude actually did.
- In the run log. The full execution trace, which is where you look when the job is green and the pull request is empty.
Sources: the tracking-comment behaviour described in examples/pr-review-comprehensive.yml; "How can I debug what Claude is doing?" in the FAQ. Read November 25, 2026.
The common failure
The job goes green and no review appears. This is not a bug; it is the default. In automation mode the results go to the run log, and Claude can only post when it has a tool that posts. Two causes, both in the file you already have:
claude_argsis missing or the tool name is wrong. The MCP server that posts inline comments starts only when--allowedToolsnamesmcp__github_inline_comment__create_inline_comment. A typo in that name means no server and no comments. Apermissions.allowrule in thesettingsinput is the documented alternative to--allowedTools.Bash(gh pr comment:*)was dropped. Without it Claude cannot run theghcommand that leaves a top-level summary, so a reviewer who does not scroll the diff sees nothing.
Two quieter versions of the same silence:
- A buffered comment that was never posted. Inline comments without
confirmed: trueare held and classified after the session ends, so they post only if the session reaches its end. If the run is cancelled, times out or crashes first, they are lost.classify_inline_comments: 'false'posts them immediately instead. - A fork pull request. The action skips it by default, logs a warning, checks nothing out and does not start Claude. A required check that only runs the action therefore passes without a review.
The other failure worth knowing is a red run rather than a silent one: an OIDC authentication error means id-token: write is missing from the permissions block.
Sources: "Two lines in this workflow control where the review goes" in Anthropic's GitHub Actions page; "Common Tool Permissions" in Solutions; the classify_inline_comments row in Usage; "Pull requests from forks" in the Security guide; the OIDC entry in the FAQ. Read November 25, 2026.
The skill-based variant
Anthropic ships a second way to do this, and it is the one its quick setup installs: instead of writing a rubric, the workflow runs a packaged skill.
name: Code Review
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
plugin_marketplaces: "https://github.com/anthropics/claude-plugins-official.git"
plugins: "code-review@claude-plugins-official"
prompt: "/code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment"'plugin_marketplacesandpluginsinstall the marketplace and the plugin before Claude runs. The plugin is namedplugin-name@marketplace-name, where the marketplace name comes from the marketplace's own manifest, not from its repository URL.--commentis what puts the review on the pull request. Without it Claude posts nothing and you read the findings in the run log.- Keep the
claude_argsline even though the skill declares the same tool in its own frontmatter: the action starts the inline-comment MCP server only when--allowedToolsinclaude_argsnames it.
Use this variant when you want Anthropic's review criteria and would rather not maintain a prompt. Use the first workflow when you want to write the rubric yourself — and add --model to its claude_args if the default model is not the one you want.
Source: "Run a skill" in Anthropic's GitHub Actions page, read November 25, 2026.
Where these answers come from
- examples/pr-review-comprehensive.yml — the workflow on this page, reproduced whole.
- Claude Code GitHub Actions — the review skill example, the skipped pull requests, the fork note, the App's permissions, and costs.
- Solutions & Use Cases — the automatic review section, its tool permissions, and the buffered-comment note.
- Usage — the inputs table, including
track_progress,classify_inline_commentsandgithub_token. - The setup this workflow assumes — the App, the secret, and who may trigger a run — is on Claude Code GitHub Actions. The other four workflows are on the examples hub.
Common questions
Why does the workflow finish green with no comment?
Automation mode writes to the run log unless Claude has a tool that posts. Add the --allowedTools line naming the inline comment tool, and keep Bash(gh pr comment:*) for the summary.
Does it review pull requests from forks?
No. The action skips them by default. allow_fork_prs: "true" opts in, but on a public repository GitHub withholds the secret from fork-triggered runs anyway.
Does it review drafts?
This workflow reviews whatever its triggers fire on, so a draft is reviewed when it is marked ready. Anthropic's review skill — the variant further down — also skips drafts, closed pull requests, trivial ones and ones that already carry a comment from Claude.
Can I choose what it checks?
Yes — put your standards in the prompt, or in CLAUDE.md at the repository root, which Claude reads on every run.