跪拜 Guibai
← All articles
Backend · AI Programming

When AI Writes 99% of the Code, Review Turns Into Risk Gating

By 周末程序猿 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Review pipelines that don't add noise control and risk grading will burn overnight cycles on agent loops and still miss regressions. Anthropic's internal numbers show the fix: one-pass merge rates jump from 65% to 78% when convergence rules kick in.

Summary

Code review in the age of AI writing is shifting from reading every line to building layers of automated checks. Anthropic's own Claude Code is about 99% written by Claude, and its internal engineering practice has evolved accordingly. The old Google eng-practices rules optimized for scarce human attention: small CRs, fast responses, read the main file first, flag nits. Anthropic's rules optimize for something else: catching problems before merge through local verification, fresh-context sub-agents, and multiple review agents that vote before posting comments. Approval is now graded by blast radius: low-risk changes auto-merge, medium-risk need one human, high-risk need two. Rollback rate and incident rate are the real metrics, not whether a human read every line.

A key practice is Eval v0, a benchmark built from real past incidents that review agents are scored on every change. Noise is controlled aggressively: review agents must not comment on unchanged lines, must merge similar bugs, and a PR that cycles more than three rounds gets pulled back for a plan re-check. One real incident saw two agents loop 50 times overnight, with 59% of the issues already present in the first round. After applying convergence rules, the share of PRs passing after one round rose from 65% to 78%, and the average number of rounds dropped from 2.08 to 1.32.

Human engineers no longer read diffs for style. They define scope, watch high-risk paths, set architectural patterns, verify evidence like test output and UI screenshots, and own the final result. Knowledge of the codebase comes from on-demand generated docs for the module you are about to touch, not from passively scanning hundreds of trivial PRs. The bottom line: rules are written into CLAUDE.md and REVIEW.md, validation produces hard evidence, false positives are suppressed, and core gates stay with humans.

Takeaways
— Anthropic's own Claude Code is about 99% written by Claude, making manual line-by-line review impractical.
— Google eng-practices optimizes for scarce human attention; Anthropic's practice optimizes for automated verification and risk grading.
— Anthropic requires local runnable verification before PR; providing that alone can double or triple output quality.
— A fresh-context sub-agent reviews the diff before PR, and REVIEW.md is maintained by module owners with specific pitfalls and rules.
— Every PR triggers two independent AI review paths: one for bugs and one for security, using multi-agent search plus validation voting.
— Review comments are tagged Important, Nit, or Pre-existing; pre-existing issues are not blamed on the current PR author.
— Share of PRs receiving substantive review feedback jumped from 16% to 54% after the multi-agent system launched.
— Approval tiers are based on blast radius: low risk auto-merges, medium needs 1 human, high needs 2 humans; AI approvals never count.
— A real incident had two agents loop 50 rounds overnight; 59% of the issues were already present in the first round.
— Convergence rules (max 3 rounds, incremental diff only, batch same-class bugs, old debt to night patrol) raised one-pass merge rate from 65% to 78% and cut average rounds from 2.08 to 1.32.
— Eval v0 is a benchmark built from historical incidents; review agents are scored on it daily and every change must pass it.
— Human engineers focus on direction, high-risk paths, architecture, evidence verification, and final ownership, not line-by-line reading.
Conclusions

The shift from human attention to noise control is the real bottleneck change; agent loops are the new equivalent of eye fatigue.

Risk-graded approval relies on accurate classification, and the dual classifier defends against misclassification by forcing a human when it looks suspicious.

The fact that AI approval doesn't count teaches that humans remain accountable; the commit-hash binding prevents stale approvals from rubber-stamping later changes.

Eval v0 is a self-improving loop: every real incident becomes a test case, so the review system gets smarter with each mistake.

The 50-loop example shows that autonomous agents need explicit termination conditions; without them they can spin indefinitely on trivial issues.

Moving from reading code to verifying evidence (tests, logs, screenshots) is a fundamental change in the reviewer skill set, and it matches how senior engineers actually work.

Concepts & terms
Eval v0
An internal benchmark at Anthropic built from historical PRs that caused production incidents, the bugs that slipped through, and rollback records. Review agents are scored on this set daily, and any change to prompts, tools, or models must improve or preserve the score.
CLAUDE.md
A repository-level instruction file for AI coding agents. It should be concise and contain hard facts like test commands, architecture red lines, and deprecated patterns to avoid, so agents don't learn from stale code.
REVIEW.md
A repository-level file that tells AI review agents where the real dangers are. It is maintained by module owners and often includes very specific rules, such as 'the biggest trap in doc changes is factual errors' or 'a bug report must include file path and line number as evidence.'
Blast radius
A measure of the potential impact of a change. Anthropic grades approval requirements by blast radius: low-risk changes auto-merge, medium-risk need one human approval, and high-risk need two. The higher the blast radius, the more human checks are required.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗