Anthropic's Six-Layer Review Pipeline: How Claude Code Reviews AI-Generated Code at Scale
Teams that let agents write most of their code hit a review bottleneck that human-only processes can't scale past. This workflow shows a working trade-off: automate the routine, keep humans for judgment and accountability, and design for fast rollback rather than perfect upstream review.
Anthropic's Claude Code team writes roughly 90% of its code with Claude, so line-by-line human review is impossible. Between June and September, merged PRs more than doubled, yet the share of reverted PRs fell by over 40%. The team did this not by abandoning review but by automating most of it and tuning the flow around human time, with rollbacks as a safety net.
The review process has six layers: pre-PR validation where Claude proves its work with runnable checks, an AI review on every PR with cross-checking from multiple agents, a blocking security review, standard automated checks, risk-based human approval (risk level determined by the change, not the author), and a merge queue with feature flags and staged rollout. A dedicated revert mechanism catches anything that slips through.
Humans stay in the loop for architecture decisions, auditing high-risk code, verifying evidence, and taking responsibility. The team also solved the convergence problem: a single PR once looped 50 times overnight between author and reviewer agents. Limiting review rounds, reviewing only new diffs after the first round, and having agents fix issues overnight cut average review rounds sharply. Production incidents feed an eval set that re-scores the review system daily.
Reframing code review as 'what could go wrong' instead of 'has a human read it' shifts effort to the failure modes that actually matter, making automation a natural fit.
The convergence problem is a real cost of agent-authored code: an author agent and reviewer agent can ping-pong indefinitely, so limiting rounds is as important as catching bugs.
Using production incidents as an eval set ties the review tool's quality directly to real-world failures, which is a more grounded metric than synthetic benchmarks.
Human review becomes a scarce resource reserved for irreplaceable judgment, which inverts the traditional workflow where humans read everything and machines only catch what they're told.
Using a fresh-context sub-agent for review is a brutal move; reviewing your own work indeed easily leads you astray.