When AI Writes 99% of the Code, Review Turns Into Risk Gating
When 99% of Code Is Written by AI, How Should Code Review Be Done?
Now writing code is no longer the bottleneck; reviewing code is.
Previously, a person wrote 200 lines a day and a colleague could read them in half an hour. Now with Claude Code or Cursor, a PR with 2,000 changed lines can be produced in one morning. According to Anthropic's own data, about 99% of Claude Code itself is written by Claude. Code flows like tap water. Who can read it all? If no one reads every line, what protects the quality of production?
To understand how to review code in the AI era, the best way is to compare the two eras' benchmarks: on one side, Google's eng-practices review guide, the most widely spread and complete manual CR specification; on the other side, Anthropic's internal engineering practice, which relies heavily on AI for code writing.
Putting these two sets of rules together, the change in underlying logic is clear: the rules of the manual era are almost all designed around "human attention is scarce" — CRs should be small, responses fast, main files read first, small issues marked as Nit so as not to block the flow. In the AI era, attention is no longer consumed line by line; the rules shift toward "using automated verification, risk grading, and fast rollback to replace line-by-line human reading."
Figure: Full comparison of review flows in the manual era (Google eng-practices) and the AI era (Anthropic).
One: The Goal of the Manual Era: Keep the Codebase Improving, but Don't Chase Perfection
In Google's spec, the primary goal of Code Review is clear: to continuously improve the overall health of the codebase.
To achieve this, the review process must balance two forces: developers need to move business forward, and reviewers must hold the line so that merged CRs don't degrade system quality. Codebase rot usually isn't a single big incident; it's a series of small compromises under pressure.
Therefore, Google proposes the famous top-level principle: as long as a CR genuinely improves the overall code health, the reviewer should lean toward approval, even if it isn't perfect.
Engineers vary in skill; there is never "perfect code," only "better code." If a CR improves readability and maintainability overall, it shouldn't be held up for days over a few inelegant details. But this principle has clear red lines:
- Never approve code that degrades the system. The only exception is an urgent production incident.
- Functional reasonableness is a veto. Even if the code is beautiful, if it implements a feature the system shouldn't have, the reviewer can reject it.
- Use
Nit:to relax details. Purely optional or educational comments get theNit:prefix, telling the author "this can change or not, it won't block the merge."
When author and reviewer argue, Google's escalation ladder is pragmatic:
- Facts and data beat personal taste.
- Style questions defer to the Style Guide. For pure style issues not in the guide, match the current file; if there's no precedent, defer to the author.
- Architecture design follows engineering principles. Design questions can't hide behind "personal style"; but if the author can prove two designs are equally sound, the reviewer should respect the author's choice.
- Don't fight in comments. Take it to a video call, note the conclusion in the CR. If still unresolved, escalate to Tech Lead, Owner, or manager. The worst outcome is a CR stuck indefinitely.
Figure: Google's approval standard — approve if it's an improvement, escalate disagreements quickly.
Two: Reading Order in the Manual Era: Description First, Main Files Second, Tail Last
For a CR touching several files, Google splits the reading order into three steps, putting the highest-value, most effort-intensive decisions first:
- Look at the whole picture first: read the CR description and judge whether the thing should be done at all. If the direction is wrong, stop and give reasons with alternative suggestions. If people constantly write large CRs and get killed at review, the process is broken — alignment should happen before typing.
- Read the main files: pick the one or two core logic files first. They are the skeleton. If a major design flaw appears, comment immediately without waiting to finish the CR. Once core design is overturned, much of the code likely needs rewriting; the longer the wait, the more wasted work for the author who may have built on top of the branch.
- Scan the rest in logical order: after confirming the skeleton is sound, go through remaining files in logical sequence. Sometimes reading unit tests first, then implementation, is faster because tests show what the code is meant to do.
Figure: The three-step manual review is essentially a way to conserve the limited attention of human reviewers.
Three: What to Check in the Manual Era: Design First, Read Every Line
Google lists 12 items in priority order. The first four decide whether the CR can merge, the middle ones look at long-term maintainability, and the last few are reviewer habits:
- Design (most core): Is the module interaction smooth? Should this logic live in this repository? Does it fit the existing system? Is now the right time to add this feature?
- Functionality: Does the code actually do what the author intends? Reviewers shouldn't just look at the happy path; put yourself in the user's and caller's shoes. Pay special attention to edge cases and concurrency races, especially multi-threaded deadlocks, which are hard to hit in tests and need two people reasoning through the code. For UI changes, ask for a screenshot or screen recording.
- Complexity: From a single-line expression to functions and classes, anything that's hard to understand at a glance or easy to break when touched counts as "too complex." Be most wary of over-engineering — solve today's real problem, don't build a maze for hypothetical future extensibility.
- Testing: Test code should usually be in the same CR as business code. Check whether tests genuinely work: would they turn red if business code breaks? Would a small refactor cause widespread false failures? Tests are long-term assets, not garbage that gets a pass because it doesn't ship.
- Naming and comments (items 5–6): Names should be appropriately sized and clear. Comments exist to explain "why," not "what." If code needs comments to be understood, the code is too convoluted — fix the code, don't add comments.
- Style, consistency, and documentation (items 7–9): Follow the guide; don't impose personal aesthetics. Large formatting changes must be separate CRs, not mixed into business changes. Documentation must be updated when build, API, or release logic changes.
- Every line, context, and positive feedback (items 10–12):
- Read every line: this is the heaviest requirement of the manual era—except for auto-generated code or large data files, reviewers must read every line of hand-written code. If you don't understand it, ask; if you don't, the person who takes over in half a year won't either. For security, concurrency, or privacy issues beyond your expertise, bring in experts.
- Look at global context: don't just stare at the green lines in the diff; open the whole file. Many ugly big-ball-of-mud systems are built from "locally reasonable" changes of a dozen lines at a time.
- Don't just nitpick; praise good code: when you see a nice abstraction or clean refactor, leave a compliment. This helps more than a few Nits.
Four: Speed in the Manual Era: Optimize "Fast Response per Instance," Send Back Large CRs
Manual-era Code Review optimizes for the throughput of the whole team, not the typing speed of a star programmer.
Slow review brings three evils: the team slows down; programmers start resisting review; and worst, people merge bad code because they can't wait, and no one does refactors anymore.
Google's rules for protecting speed:
- Don't interrupt flow, but don't exceed one working day: if you're deep in code, never break to review someone else's CR. Wait for a natural pause (water break, after a test run). But the hard limit is one working day—today's CR must get feedback by tomorrow morning at the latest.
- Value "first response speed": even if busy, reply "I'll look at 3pm" or hand it to someone else, or spend five minutes scanning the big picture to give initial feedback.
- Use
LGTM with comments: if only spelling errors or import ordering remain and you trust the author, just say LGTM and let them merge themselves. - Send back large CRs: around 100 lines is comfortable, over 1000 lines is basically unreviewable. For giant CRs, default to requiring splits into independently mergeable steps; if impossible, at least review the overall architecture direction and leave top-level comments before sending back.
Figure: The manual-era speed balancing act — protect reviewer flow while enforcing one-working-day response and rejecting large CRs.
Five: The AI Era Rewrites the Rules: From "Has Anyone Read This" to "Layer and Intercept"
When Claude handles 90% of the team's coding, the old approach of scanning every line and splitting into 100-line CRs is no longer enough.
Anthropic's solution reframes a fundamental question: is Code Review about confirming "a human has seen this line" or about "filling the holes before release while keeping the team informed of system state"? Obviously the latter. With that, Anthropic turned review from an end-stage gate into a "real-time spell checker" like in a document editor. Most code has already been reviewed and fixed by Claude at least once before it reaches a human. In practice, most internal PRs require at most one human approval—sometimes that approver can be the author.
How do they avoid breaking production? They track two types of metrics:
- Efficiency: how many people per PR (median and P95), how long it sits with humans, how many manual comments.
- Safety red lines: rollback rate and incident rate. If saving review time costs you late-night incident response, that's just shifting cost from left pocket to right pocket.
Six: Move the Gate Forward: Have the Agent Prove Its Work Before PR
At Anthropic, code review starts before the author presses Create Pull Request.
Claude Code's creator Boris Cherny noted a key lesson: the most important thing for getting Claude to write good code is giving it verification methods it can run itself. Just doing this doubles to triples the quality of the final output.
So before a PR, the engineering spec requires a set of steps:
- Demand hard output, not verbal promises: give Claude test commands, build commands, or UI snapshot tools, and force it to show actual execution results and logs. Never accept a glib "I already fixed it."
- Bring in a "clean mind" sub-agent for mutual review: the writing agent often falls into its own context blind spots. Before PR, a sub-agent with a fresh context, no historical baggage, reviews the diff and runs dedicated Skills for finding bugs, trimming the diff, and end-to-end behavior checks.
- Never fall into the same trap twice: if a recurring issue appears in review, fix it at the source—add it to lint, write it into a Skill, or update the root rules file.
CLAUDE.md(for the worker): keep it concise, only stack, architecture red lines, how to run tests, and legacy patterns to avoid. Loaded automatically each review; the review agent also checks whether the change made the doc outdated.REVIEW.md(for the reviewer): maintained by module owners, tells the review agent where the real dangers are. Good rules are very specific: e.g., "the biggest trap in doc changes is factual errors," "the biggest trap in route config is misdirecting traffic." Also explicitly lists generated directories to skip, forbids trivial style suggestions, requires concrete file paths and line numbers as evidence (no guessing from variable names), and demands the comment open with the total issue count, or say none. The team periodically audits whether review agents actually follow REVIEW.md.
Figure: Lifecycle of a change (from author's machine to end user). Most steps are automated (✓); human attention is focused on actual risk approvals (◆) and post-release recovery (↻).
Seven: Every PR Gets a Multi-Agent Consultation and an Independent Security Review
Once a PR is created, beyond normal CI, two AI review paths trigger: one for business bugs, one for security vulnerabilities.
The bug-finding Claude doesn't just look at changed lines; it reasons with full repository context and the PR description: does this change actually solve the problem? Is it compatible with the existing architecture? Did it break another module? For bug-fix PRs, it also checks whether the fix is just a patch or addresses the root cause.
To be both accurate and unobtrusive, Anthropic uses a "multi-agent concurrent search + validation team voting" mechanism:
- Multiple agents search for bugs independently; then another set of validation agents votes. Only when a majority confirms "this is a real problem" does it get posted to the PR comment thread.
- Purely stylistic comments, log formatting, or clean-up suggestions are filtered at the bottom (filtering rules are A/B tested on internal PRs).
- Remaining comments are tagged by severity:
Important,Nit, orPre-existing— the last one is very useful, keeping legacy issues from being blamed on the current PR author.
After this system went live, the share of PRs receiving substantive review feedback jumped from 16% to 54%. Large PRs over 1000 lines almost always surface real issues. Repo admins can switch review depth between Quick, Standard, and Deep based on module fragility. In core repositories where a missed bug is catastrophic, spending a few extra minutes on deep review is worth it.
Rules are strict: every comment must be addressed—either fix code or give a strong reason to close the thread. (If a later commit fixes the bug, the comment auto-close.) Often an author leaves a PR at night, and the night-shift coding agent automatically resolves comments and triggers a re-review; by morning, the PR is clean and mergeable.
Meanwhile, security review runs on a completely independent channel. As long as any blocking item remains open in either bug or security review, branch protection locks the merge button.
Figure: Layered interception instead of a single gate (Swiss cheese model). Six layers each catch some issues and miss others; the rare survivors are caught by fast rollback.
Eight: Approval Graded by Blast Radius, Not by Who Wrote the Code
Even with AI review, standard mechanical CI remains essential: lint, type checking, cross-platform unit tests, builds. A typical CLI PR has dozens of automated checks run before a human sees it. The PR template also requires stating "how it was tested" and "how to roll back if it breaks" (Claude can draft, but a human must sign off).
At final merge approval, Anthropic's rule is straightforward: regardless of whether code was hand-written or AI-generated, the approval threshold depends only on the change's "blast radius" (risk level).
| Risk Level | Typical Scenarios | Human Approval Requirement |
|---|---|---|
| Low | docs, copy, internal tools, new code behind feature flags | Auto-merge after automated review + security scan, no human needed |
| Medium | regular product changes, or touching sensitive areas like cache, auto-updater, system prompt | 1 human approval |
| High | core mission-critical code, or high-risk paths designated by Owner | 2 human approvals |
Four safeguards prevent gaming:
- Dual classifier cross-check: the first classifier grades the PR (low/medium/high); the second does backstop—even if rated low, if it looks suspicious, it forces a human in. Additionally, sensitive paths marked by owners and all CI workflow config files always require human approval.
- Trusted whitelist: low-risk auto-merge is only open to permanent maintainers on the trust list; external contributors or cross-team collaborators automatically get an extra human reviewer.
- AI approvals don't count: an Agent saying "looks good" only counts as passing machine checks; it can never replace the human approvals in the table above.
- The human is responsible for the Agent they direct, and approvals are bound to a specific commit: if you have an Agent write a medium-risk PR, your review and approval after checking evidence counts as the 1 human (you're the accountable party). But all approvals are strictly tied to the commit hash at that moment — if a new commit is pushed later (e.g., an Agent pushes a fix overnight, or a manual merge-conflict resolution), prior approvals are immediately invalidated and must be re-confirmed.
Nine: Feed AI with Real Incidents and Brake on "Infinite Loop Rework"
How do review agents iterate? What if they get worse?
Anthropic has an internal benchmark called Eval v0. They mined historical PRs that actually caused production incidents, the bugs that slipped through, and post-hoc rollback records. Engineers familiar with the code marked the true problem locations. Review agents are scored on this incident set daily; any change to review prompts, tooling, or underlying models must pass this set first — score up, ship; score down, roll back. Every new incident, the first thing after the post-mortem is to add that PR to the eval set.
Figure: Driving eval loop with real failures ("Our incidents are the eval"). The eval set grows with each incident; every tweak to the review agent must be validated on the full historical set.
However, the biggest pitfall in AI review is another: trying to look smart by generating noise and false alarms.
When a human sees a trivial comment, they roll their eyes and scroll past in two seconds. But when the author is also an Agent, noise is amplified because Agents are too literal — if you suggest, they actually change. Each change creates a new commit, which triggers another round of AI review.
Anthropic had a real, funny case: a CLI PR left overnight for coding and review agents to cooperate. The two AIs looped over 50 rounds until the author came in the morning and manually stopped it. A git blame afterward showed 59% of the repeatedly flagged issues had already existed in the first round. The review agent squeezed out one piece of old grime each round like toothpaste, never finishing.
To curb this, the team not only tests review agents on perfectly clean PRs to see if they invent problems, but also enforces four convergence rules:
- Three strikes: after three rounds without passing, stop and have the author (or controller) step back and re-examine the overall approach, not patch locally.
- After a few rounds, only review the incremental diff: later rounds can't raise issues from old code.
- Batch same-class bugs: if one class of issue is found, require searching the entire PR and fixing them all, not one-by-one.
- Old debt goes to night patrol: once reported, don't repeat; historical tech debt is handled by a dedicated nightly agent, decoupled from daily PRs.
These four rules had immediate effect on internal PR flow:
| Internal PR flow metric | Before convergence | After convergence |
|---|---|---|
| Pass after 1 review+fix | 65% | 78% |
| Hardshell cases (5+ rounds) | 8.9% | 1.5% |
| Average rounds per PR | 2.08 | 1.32 |
Ten: If Machines Read Most of the Code, What Do Humans Do?
Once machines take over line-by-line syntax and null-pointer checks, human energy frees up for five irreplaceable tasks:
- Define direction and scope: Is this requirement worth doing? Is the product interaction sound? Are the boundaries right?
- Watch high-risk lifeblood: billing, auto-updater, auth/permissions, CI pipelines — anything that breaks badly must be personally reviewed.
- Hold architectural patterns: base modules and core abstractions that others will imitate must be set by humans.
- Verify hard evidence: look at test output, executed commands and return codes, UI before/after screenshots, and AI review reports. If you look at a pile of check results and can't say "what scenario might these checks miss," you shouldn't blindly approve; do a deep manual review.
- Take responsibility for the final result.
This raises a worry: people used to learn the codebase by reading colleagues' PRs. Now that AI writes and reviews code, will humans become "outsiders" to their own system?
Anthropic's answer is honest: they don't hold formal meetings or expect anyone to hold the whole Claude Code in their head. Instead, they rely on on-demand just-in-time learning — when you're about to touch a module, ask Claude to generate an architecture description or even a visual call graph for that module. In minutes you get a living doc fully synced with the latest code. That's far more solid learning than scanning dozens of trivial text-change PRs line by line.
Figure: How to understand the codebase when machines read most code — reading trivial diffs line by line teaches little; generating targeted docs or visual graphs for the module you're about to touch teaches the core logic.
On responsibility, the team follows "You land it, you own it."
This is not a blame culture. When a medium/small change breaks in production, the default is for the person who merged it to fix it, because they have the most context and can fix it fastest. In post-mortems, the whole group asks which system layer leaked, not which person to blame.
This mechanism stays viable thanks to five pillars:
- Small changes: easy to review, adjust, revert.
- Everything reversible: feature flags everywhere, gradual rollout, one-click rollback — most production errors can be erased painlessly in minutes.
- Standards float with blast radius: the more expensive or critical the code, the more people and checks are pulled in.
- Internal dogfooding and sensitive telemetry: the team uses internal previews heavily, plus good monitoring, so problems surface internally before reaching external users.
- Align direction early: since prototyping with an Agent is cheap, sunk cost is lower; but if you disagree with the big direction, raise it as early as possible, don't wait until after CI and post blocking comments.
Eleven: A Table of the Essential Differences Between Two Generations of Code Review
| Dimension | Manual Era (Google eng-practices) | AI Era (Anthropic practice) |
|---|---|---|
| Core goal | Continuously improve codebase health, no perfectionism | Intercept problems before release, sync key context; measured by rollback rate and incident rate, not "did a human read every line" |
| Who reads code | Humans read every file; hand-written code read line by line | Multiple agents concurrently search + validation votes; humans mainly read review findings and verification evidence, not full diffs |
| Timing of involvement | After CR is posted; before was self-test | Starts before PR: local runnable verification, fresh-context sub-agent self-review; review becomes a continuous "spell check" |
| Where rules live | Style Guide docs, memorized by engineers | CLAUDE.md, REVIEW.md, Skills, lint; even review agents are audited for rule compliance |
| Size control | Manual splitting (100 lines best, 1000+ rejected) | No longer forced splitting to accommodate human eyes; merge queues and feature flags make changes small and reversible; handled by risk tier |
| Who approves | One LGTM + directory Owner | Graded by blast radius: low auto-merge, medium 1 human, high 2 humans; AI approval never counts |
| Flow speed | Respond within 1 working day; never interrupt deep focus | Agent responds in seconds (usually 6-10 mins); can auto-fix code overnight |
| Noise control | Reviewers self-discipline with Nit/Optional/FYI | Validation team voting filters false positives; comments tagged Important/Nit/Pre-existing; max 3 rounds, incremental diff later |
| Biggest pain | Slow review, reviewer eye fatigue, taste disputes, large CRs | Comment noise causing Agent overnight loops, self-review/self-approval becoming a formality, false positives inducing AI to ruin good code |
| When production breaks | Rollback; emergency no-review is rare and requires retroactive review | Instant rollback is part of the review system; feature flags, canary; post-mortem asks which layer leaked, then adds to eval set |
| How the system evolves | Senior devs teach juniors to write passable CRs | Historical failures become an eval benchmark; every prompt/model change is scored against the full incident set |
| Human role | Line-by-line reader + quality gatekeeper | Direction setter, evidence verifier, core architecture owner, final owner of results |
The core shift amounts to four things:
- Quality defense becomes layered sieves, not a single human gate: no one trusts a single LGTM; instead, local self-verification + CI + multi-path AI review + risk-graded approval + canary + instant rollback stack together. Each layer leaks, but combined they hold.
- The scarce resource shifts from human attention to anti-noise and anti-loop: all the old rules saved human eyes; now AI has unlimited energy, the fear is review AI and coding AI fighting over trivia for 50 rounds, so we need strict false-positive control, round limits, incremental diffs.
- Approval is fully risk-bound and commit-bound: no one-size-fits-all; changing a line of copy and changing payment logic go through completely different channels; any new commit that machines can't guarantee invalidates prior approvals.
- Rollback changes from last-resort firefighting to a prerequisite: because you can disable a feature flag or roll back in minutes, you can confidently delegate low/medium-risk changes without spending time pursuing 100% pre-release perfection.
But no matter how tools change, four engineering bottom lines stay unbroken across both eras: standards must be written down explicitly; confusing code should be rewritten rather than explained; wrong direction and architecture must be called out at the earliest stage; and final production responsibility always belongs to a human.
Twelve: Summary and a Practical Rollout Guide: What Ordinary Teams Can Steal Today
In another study of mass Claude Code sessions, Anthropic found two interesting phenomena:
- Humans currently make about 70% of planning decisions (what to do, which approach, what counts as done), and delegate about 80% of execution decisions (which file, what code, what command) to AI. The more domain expertise, the better the engineer can squeeze AI via precise instructions and verification requirements.
- There's a huge gap between "looks done" and "proven done with hard evidence." Sessions lacking test passes, build success, and other hard verification evidence fail at a much higher rate than those with step-by-step evidence.
This explains why AI-era review must transform: if 90% of concrete code is machine-written, humans using a magnifying glass to catch brace positions is misaligned. Humans should sit at the two ends: defining problems and verifying hard evidence.
If your team is starting to use AI for coding heavily and getting crushed by bloated PRs, don't try to copy the full infrastructure at once. Follow these seven steps from shallow to deep:
- Establish "local self-verification" as a rule: create a concise CLAUDE.md in the repo root; write only hard info not visible in code — exact test commands, type-check commands, build scripts, and deprecated patterns AI shouldn't imitate. Require a fresh-context sub-agent self-review before PR, and demand actual test output or UI screenshots, not just "already self-tested."
- Reduce human review burden, not just add to it: adopt Google's rule — approve if the PR genuinely improves the system, don't block on personal code cleanliness; force
Nit:prefix for style-only suggestions; require one-working-day response, but don't interrupt deep work. - Write oral rules into REVIEW.md and pilot in one repo: take the two or three core taboos that senior engineers keep repeating in reviews, write them black-and-white. Try on a real PR; if a rule triggers false alarms, delete/tune immediately. Delegate formatting/indentation to CI linters, never occupy review effort. Once smooth, integrate AI review tools (Claude Code Review, Codex review, or self-built Action) and configure Quick/Standard/Deep per repo importance.
- Lock down core paths by risk, never one-size-fits-all: initially be stricter; relax only after gathering trust data. Put billing, permissions, core config, and CI scripts in CODEOWNERS with branch protection; require true human approval. Explicitly state that bot
Approvedoesn't count, and new commits force re-approval. - Suppress AI chattiness and rework rounds: in review prompt, add hard constraints: don't report on unchanged lines, don't report pure style issues, merge same-class issues into one; set "over 3 rounds means human intervention" and "later rounds only incremental diff" to stop two AIs looping at night.
- Don't implement "no-review merge" until you have fast rollback: merge queue, feature flags, canary, one-click rollback are the foundation for relaxing pre-review. If releasing takes 30 minutes and rolling back feels like defusing a bomb, fix release and rollback infrastructure before pursuing "unattended merge."
- Measure the process by online results, not by "how many bugs AI caught": never use "how many comments the AI reviewer left" as a KPI — that encourages noise. The real metrics: did human approval wait time go down? Did rollback rate and incident rate hold? After every real leak, add that case to the prompt or test set so the review system learns from each stumble.
At the end of the day, whether Google or Anthropic, the direction is the same: write rules into the repo, produce hard evidence through verification, suppress false positives heavily, and return core gates to humans. Let tireless machines carry the burden of massive reading and mechanical checks, so human engineers can focus on architecture, direction, and final results that truly determine the system's life or death.
References
- Addy Osmani, Morgan Westlee Lunt, Qing Wang: How the Claude Code team does code review (main source for Anthropic's internal review process, multi-agent validation, risk grading, and convergence data)
- Anthropic: Code Review is now generally available (source for Claude Code Review product, Quick/Standard/Deep tiers, and review time data)
- Anthropic: anthropics/claude-code-security-review (independent security review reference, MIT License)
- Anthropic: Best practices for Claude Code and Code Review official docs (source for CLAUDE.md, REVIEW.md, and pre-verification practices)
- Zoe Hitzig et al.: Agentic coding and persistent returns to expertise (source for the human/AI planning-execution split, expert effects, and verification success rates in Section 12)
- Google: Code Review Developer Guide (eng-practices) (source for the manual-era review principles, reading order, 12-item checklist, and response speed specs, CC-BY 3.0)