Skip to content
AI artificial intelligence
About usLet’s talk
Back to articles

Agent code review in Claude Code: it flags bugs, a human approves

Agent code review in Claude Code: local /code-review, GitHub Actions or the Code Review service with REVIEW.md. What to check, limits, costs, permissions.

The short answer

Claude Code can review code changes in several ways: locally with the /code-review command (alias /review), in GitHub Actions, or as the managed Code Review service for Team and Enterprise plans. In every option the agent reports findings but does not approve the pull request, the request to merge changes into the main branch. According to the documentation, the Code Review service also never blocks a PR. The decision to merge stays with a person.

For a small team, the simplest start is /code-review on your own branch before you open a PR. The command works on any plan and counts toward your plan’s usage or API billing. Automatic review of every PR on GitHub needs either your own GitHub Actions workflow or the Code Review service, which is billed separately through credits.

To be clear: we describe this based on Anthropic’s documentation and announcements; we have not tested these features on our own repository. So we give no results, timings or review costs of our own.

It makes the most sense for companies with their own code, such as an online shop, an internal system or integrations, and one or a few people who change it. The agent does not replace a second developer, but it can catch some bugs before they reach production.

Four ways to get an agent review

The Claude Code documentation compares the options in one table. The key difference is who starts the review and where it runs.

Ways to review code in Claude Code according to Anthropic’s documentation (as of October 22, 2026)
OptionWhat starts a reviewWhere it runsWho can use it
/code-reviewYou, with a command on your branchYour Claude Code sessionAnyone, on any plan
GitHub Actions (your own workflow)Your pipeline’s events, such as every PRYour own CI runnersAnyone with a Claude API key or cloud provider credentials
Code Review (service)PR activity or an @claude review commentAnthropic infrastructureOrganizations on a Team or Enterprise plan with GitHub repositories, once an Owner turns it on
Ultrareview (/code-review ultra)You, from Claude CodeA cloud sandboxRequires signing in with a claude.ai account; 3 free runs on Pro and Max, then credits

Locally: /code-review before you open a PR

With no arguments, /code-review reviews your branch’s commits that are not yet in its upstream branch, plus uncommitted changes. You can point it at a PR number, another branch, a path or a commit range instead. The review runs in the background as a separate subagent, and the findings arrive in your conversation when it finishes. It follows the rules in your CLAUDE.md files but does not read REVIEW.md, which configures the Code Review service.

Useful flags: --fix asks Claude to apply the fixes right away, with every edit going through your permission mode, and --comment posts the findings as comments on a GitHub PR. You can add an effort level. According to the documentation, at low the review reports the findings it is most confident in, so you see fewer false positives; from medium to max coverage broadens.

A separate command, /security-review, checks the diff between your branch and the default branch on origin for vulnerabilities: injection, authentication issues and data exposure. It needs an origin remote.

Commands in a Claude Code session (replace the PR number and path with your own)
# review the current branch and uncommitted changes
/code-review

# pull request 1234, higher effort level
/code-review high 1234

# only the src/auth directory
/code-review src/auth

# apply fixes right away (through your permission mode)
/code-review --fix

# post findings as comments on the GitHub PR
/code-review --comment 1234

# security review against origin's default branch
/security-review

On GitHub: a GitHub Actions workflow

The fastest route is the /install-github-app command in Claude Code. It works only with repositories on github.com and needs an authenticated GitHub CLI (gh auth login) and admin access to the repository. It installs the Claude GitHub App, saves a secret (ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN) and prepares a PR with the workflow files. If you choose the review workflow, Claude posts findings as inline comments, or one summary comment when it finds nothing.

You can also add the workflow by hand. The documentation’s example installs the code-review plugin and runs a review when a PR is opened, updated, reopened or marked ready for review. Claude skips draft and closed PRs, PRs it judges not to need a review, such as automated or trivial ones, and PRs it has already commented on.

Who can trigger the agent: on issue and PR events the author must have write access to the repository, and bot accounts are rejected unless you list them in allowed_bots. This prevents a loop of bots triggering Claude.

Review workflow from the Claude Code documentation (.github/workflows/)
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-code.git"
          plugins: "code-review@claude-code-plugins"
          prompt: "/code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
          claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment"'

The Code Review service for Team and Enterprise plans

An Owner of the Claude organization turns on Code Review for selected GitHub repositories, including GitHub Enterprise Server. The service is not available to organizations with Zero Data Retention, the HIPAA configuration or customer-managed encryption keys (CMEK). Several agents read the change and the surrounding code in parallel, a verification step filters out false positives, and the remaining findings are ranked by severity. The PR gets inline comments, a summary and a check run named “Claude Code Review”, which never concludes as a failure.

Inside a review, access to the repository is read-only: the service does not push commits and does not build or run your code, it only reads it. For each repository you set when reviews run: once when a PR opens, after every push, or only on request. A person with write access can always start a review with an @claude review comment. The review levels are Quick, Standard (the default) and Deep.

Anthropic announced the service as a research preview on March 9, 2026 and made it generally available on October 15, 2026. According to the October announcement, most reviews finish in 6–10 minutes, down from about 20 minutes during the preview.

What to ask it to check

By default Code Review focuses on correctness: bugs that would break production, not formatting or missing tests. You write your own rules into two files. CLAUDE.md is read by both the local /code-review and the service. REVIEW.md is read only by the service, and only from the base or default branch, never from the PR’s own changes, which is why the documentation advises protecting the default branch.

The list below combines examples from the documentation with a few points we suggest for a small team. Put rules that should apply both locally and on GitHub into CLAUDE.md.

To put in CLAUDE.md or REVIEW.md

  • What not to report: anything CI already checks (lint, formatting, types), generated files and lock files.
  • A cap on minor findings (Nit), for example at most five per review.
  • Always check that new API routes have an integration test.
  • Always check that logs do not contain email addresses, user IDs or request bodies.
  • Always check that database queries are scoped to the right customer’s data.
  • A claim about code behavior needs a file:line citation, not an inference from a function name. According to the documentation, this cuts false positives.
  • Our suggestion: flag API keys, passwords and customer data in code, configuration and test data.
Sample REVIEW.md (based on the documentation's example, shortened)
# Review instructions

## Do not report
- Anything CI already enforces: lint, formatting, type errors
- Generated files under `src/gen/` and any `*.lock` file

## Minor findings
Report at most five Nits per review.

## Always check
- New API routes have an integration test
- Log lines don't include email addresses, user IDs or request bodies
- Database queries are scoped to the right customer's data
- Back claims about code behavior with a file:line citation

Limits: a human approves, and false positives happen

The documentation says it plainly: Code Review uses AI and may miss bugs, vulnerabilities or other issues, and a review with no findings does not mean the code is error-free or secure. A review neither approves nor blocks a PR, so someone on the team still has to read the change and decide.

False positives come with this way of working, which is why the service has a separate verification step and why you can choose low locally. Anthropic says that in internal use engineers marked less than 1% of findings as incorrect. That is the vendor’s claim about its own code, not a promise for your repository. Treat each finding like a colleague’s suggestion: check it, fix it, or reject it with a short reason.

The agent reads code but does not run it. Tests and CI are still needed, and when you migrate old code, record its current behavior in tests first.

For automated security review in GitHub Actions, Anthropic warns in the description of the claude-code-security-review action that it is not hardened against prompt injection and should review only trusted PRs. It recommends requiring approval of workflows for all external contributors in the repository settings.

Prompt injection: when a document tries to give your agent orders →

Costs

Local /code-review runs in your session, so it counts toward your plan’s usage or API billing the same way as the rest of your work in Claude Code.

In GitHub Actions you pay both in GitHub Actions minutes and in API tokens. If you authenticate with an OAuth token, runs use your Claude subscription instead of API billing. The documentation suggests limiting costs with the --max-turns flag, workflow timeouts, concurrency controls and a concise CLAUDE.md, because Claude reads it on every run.

The Code Review service is billed on token usage through credits, separately from your plan’s included usage, and charged to the organization, not to the PR author. There is no flat price per review. In its March 2026 post, Anthropic said reviews average USD 15–25 and scale with the size and complexity of the PR. The “after every push” setting multiplies the cost by the number of pushes. The documentation suggests starting with a pilot: set a monthly spend limit, turn the service on for a few repositories in “once after PR creation” or manual mode, read the average cost per review and multiply it by the number of PRs per month.

Permissions: what the Claude app gets on GitHub

The Claude GitHub App is shared by every Claude feature that integrates with GitHub, so installing it grants the full permission set, including write access to repository contents, pull requests, issues, workflows and Actions. GitHub does not let you accept only part of it. If your organization requires it, you can create a custom app for GitHub Actions alone with access only to contents, issues and pull requests; the Code Review service still requires the official app.

The review workflow from the documentation itself asks only for read access to contents, pull requests and issues, plus id-token: write for authentication. Give a workflow only the permissions it needs. Never commit API keys or tokens to the repository; keep them in GitHub Secrets. For a secret shared across repositories, the documentation recommends an API key from the Claude Console rather than an OAuth token, which is tied to one person’s subscription.

AI agent permissions checklist for business →

A plan for the first week in a small team

This is our suggestion, not a procedure from the documentation. It starts with what costs nothing beyond normal Claude Code use.

First week

  • Write a few review rules that really matter to you into CLAUDE.md.
  • Everyone runs /code-review on their branch before opening a PR.
  • For changes to sign-in, payments and customer data, add /security-review.
  • Turn on automation on GitHub in one repository first.
  • In a public repository, require approval of workflows for external contributors.
  • An agent’s finding is a suggestion: the author responds, and a person approves the PR.
  • Note how many findings were accurate, how many you rejected and what the reviews cost.

Frequently asked questions

How do I run a code review in Claude Code? The simplest way is to type /code-review in a Claude Code session on your branch. The command reviews the changes and reports findings in the conversation, and with the --comment flag it posts them on the GitHub PR. Its alias is /review.

Can Claude Code approve a pull request? Not in the features described here. According to the documentation, the Code Review service never approves or blocks a PR, and its check run never concludes as a failure. The decision to merge stays with the team.

How is /code-review different from the Code Review service? You run /code-review yourself in your session, on any plan. Code Review is a service for Team and Enterprise plans that an organization Owner turns on; it reviews GitHub PRs automatically on Anthropic infrastructure and is billed separately through credits.

How much does agent code review cost? Locally it counts toward your plan’s usage or API billing. In GitHub Actions you pay in Actions minutes and tokens. For the Code Review service, Anthropic’s March 2026 post gave an average of USD 15–25 per review; there is no flat price.

Have you tested these features? No. This article is based on the Claude Code documentation and Anthropic’s announcements. We did not measure the quality of findings, review time or cost.

What next

We compared coding tools using Ramp data. If an agent gets access to your repository, start with its permissions and the risk of prompt injection. Planning to let the agent run with fewer approval prompts? Read what the default auto mode in Claude Code changes.

Claude Code, Codex or Cursor? Ramp data →AI agent permissions checklist for business →Prompt injection: when a document tries to give your agent orders →Claude Code stops asking about every command: auto mode by default and what to set up at work →

Sources and further reading

The sources behind this article. Instructions and example scenarios are suggestions from our editorial team.

Back to articles