← ~/pillars / quality-cd / agent-code-review

Agent code review

Automated PR review with claude-code-action@v1: current syntax, the beta-to-v1 renames that silently break old workflows, Anthropic's published multi-agent review numbers, and the two-stage structure.

updated 2026-06-12 ~5 min read pattern 02/05 Quality, Delivery & Evals

on this page

Context. Agent adoption raised your PR volume, and human reviewers are now the bottleneck, or worse, the rubber stamp. You want a first-pass review on every PR that catches real bugs before a human spends attention on it.

Forces. Single-pass AI review has a noise problem: a reviewer prompted to find issues will find issues, and style nits drown the one finding that matters. Cost scales with PR volume. And the tooling moved under everyone’s feet: workflows written against the beta action use input names that v1 silently no longer accepts.

Resolution. Run claude-code-action@v1 as an automated reviewer on every PR, calibrate the prompt to correctness-only with an evidence requirement, structure review as two stages (spec compliance, then quality), and verify candidate findings against actual code behaviour before they reach a human.

The action, current syntax

anthropics/claude-code-action@v1 (GA August 2025) auto-detects its mode: with a prompt input it runs as automation on the triggering event; without one it responds to @claude mentions in PR and issue comments (GitHub Actions docs). The automation form for review on every PR:

name: Claude PR Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: "Review this PR for correctness and security issues"
claude_args: |
--max-turns 10
--model claude-sonnet-4-6

If you wrote a workflow against the beta, it is broken in ways the action will not always tell you about. The renames (action repository):

Beta inputv1 input
modeRemoved (auto-detected)
direct_promptprompt
custom_instructionsclaude_args: --append-system-prompt "..."
max_turnsclaude_args: --max-turns N
allowed_toolsclaude_args: --allowedTools "..."

The practical consequence of the first two: a beta workflow with direct_prompt upgraded to @v1 stops being an automated reviewer and becomes a mention-handler that never fires on PR events. Check for this explicitly when migrating.

For Java teams on AWS, the action runs against Bedrock natively: use_bedrock: "true", GitHub OIDC into an IAM role, and the cross-region inference prefix on the model ID (us.anthropic.claude-sonnet-4-6). No long-lived Anthropic key in repo secrets. The PR review workflow artifact ships both variants.

What Anthropic’s own numbers say

Anthropic ran its multi-agent code review system on most of its own PRs for several months before launching it as a research preview in March 2026 (research preview as of June 2026, not GA). The published internal-use figures, as reported by InfoQ in April 2026: substantive review comments rose from 16% to 54% of PRs after adoption; fewer than 1% of findings were marked incorrect by engineers; and for PRs over 1,000 lines, 84% generated findings, averaging 7.5 issues each. Reviews complete in roughly 20 minutes (TechCrunch).

Frame those numbers correctly: they are Anthropic’s internal-use data on its own codebase, not a controlled study, and they do not separate agent-authored from human-authored PRs (though given Anthropic’s internal Claude Code usage, the system necessarily reviews agent-written code). What makes them worth acting on is the mechanism behind the sub-1% false-positive figure, which you can replicate: parallel agents each “examining the codebase from a different perspective or dimension” (Cat Wu, Anthropic, in TechCrunch), an aggregation agent that deduplicates and ranks, and, the key step, “a verification step checks candidates against actual code behavior to filter out false positives” (Code Review docs). Every candidate finding is independently checked against the code before a human sees it. Single-pass review skips exactly this step, and it shows.

Calibrating the review prompt

The managed service’s REVIEW.md customisation guidance (Code Review docs) doubles as prompt-engineering doctrine for any AI reviewer:

  • Severity means correctness. “Reserve Important for findings that would break behavior, leak data, or block a rollback: incorrect logic, unscoped database queries, PII in logs or error messages, and migrations that aren’t backward compatible.”
  • Cap the nits. At most five per review; “plus N similar items” in the summary for the rest.
  • Skip what CI already enforces. Lint, formatting, type errors: if Checkstyle or SpotBugs catches it, the reviewer must not report it. This is the symmetry argument from linters as ground truth applied to review: deterministic tools own deterministic findings.
  • Require evidence. “Behavior claims need a file:line citation in the source, not an inference from naming.”

Two stages: spec, then quality

Run spec compliance and quality as separate reviewer invocations, in that order. Stage one, a fresh subagent against the plan or linked issue: check every requirement is implemented, the listed edge cases have tests, and nothing outside the task’s scope changed: gaps, not style. Stage two runs correctness and security analysis on the diff. Keeping them separate stops the reviewer conflating “did we build the right thing?” with “did we build it correctly?”, and a quality pass on code that fails spec review is wasted tokens. The reasoning, and the fresh-context mechanism that makes the reviewer unbiased (“a fresh context improves code review since Claude won’t be biased toward code it just wrote”, per the best-practices docs), is developed fully in verification topologies. The ready-to-use prompt pair, with the finding-verification step built in, is the two-stage review prompt artifact.

Cost controls

Four levers, in order of bluntness: --max-turns in claude_args caps iteration per review; workflow-level timeout-minutes caps wall-clock; GitHub concurrency groups cancel superseded reviews when a PR is pushed again; and an organisation spend cap in the Anthropic admin settings backstops everything. The managed Code Review service prices per token at roughly $15–25 per review average with a configurable monthly cap (Code Review docs). Teams with Zero Data Retention requirements cannot use it, and should run the self-hosted action with the /code-review plugin skill on their own runners instead.

Worked example

A Java platform team rolls this out in three steps: the PR review workflow lands in one service repo (Bedrock variant, model pinned, --max-turns 10, comment-only, no gate); after a calibration period tallying Important-severity findings with file:line evidence against what human review caught; then the two-stage prompt replaces the single prompt, spec stage wired to the PR’s linked issue. Human review stays mandatory throughout: the agent reviewer’s job is to make the human’s attention land on the two findings that matter instead of the diff’s two thousand lines.

// sources