After the Claude Code team split review into 6 layers, PR merges doubled and rollbacks fell 40%
Claude wrote 90% of the Claude Code code. Over three months, merged PRs doubled and the rollback rate fell by more than 40%. Even more worth seeing is how they review: a 6-layer filter, from subagents reading diffs to humans stepping in based on risk. And why most teams change the wrong layer.
The Claude Code team recently published a set of data: Claude wrote about 90% of the Claude Code code. Over three months, the number of PRs the team merged more than doubled, and the proportion requiring rollback dropped by more than 40%.
Even more worth seeing is how they review. Most reading is no longer done by humans.
In a long post, rari breaks this system into 6 layers. Original article image:
Layer 1: verify before anyone looks. Claude must run something and show the output. Then a subagent with a fresh context reads the diff, before the PR is even created.
Layer 2: AI review runs on every PR. Several agents look for bugs, and another group votes on each finding. PRs with real review comments rose from 16% to 54%.
Layer 3: safety checks that can block merging. As long as there is one unresolved issue, the PR cannot merge. Fix it, or turn it off with a reason.
Layer 4: the boring checks. Lint, types, build, tests for every platform. Dozens of them, all run before a human sees anything.
Layer 5: humans step in based on risk tiers. Docs need no human. Ordinary changes need one person. The highest-risk code needs two people. The change selects its own tier, not the author.
Layer 6: the queue checks again. Every check is rerun on main, then flagged, then a slow rollout. The rollback cushion sits underneath.
One PR ran more than 50 rounds overnight, because the agent author and agent reviewer could keep each other busy forever. Now, after round 3, the reviewer makes the author rethink the approach.
They wrote the review rules as a REVIEW.md, placed at the repo root, and handed it to the next review.
6 layers, 1 file, 0 endless reviews.
This sounds like a very heavy process. But it solves a very specific problem: the model is not the only place things go wrong. In the article, rari uses a more accurate framework: harness, loop, graph. Harness is space: it determines what the agent can see, touch, remember, and prove. Loop is time: it determines how it tries, checks, retries, and when it stops. Graph is structure: it determines what steps exist, what is passed between steps, and who chooses the next step.
These three layers do not replace one another; they are nested. The model runs inside the loop, the loop runs inside nodes of the graph, and the graph runs inside the harness. You can build an agent with only one of these layers, but it is hard to fix it without knowing which layer broke.
A common failure looks like this: the agent opens a PR, tests are all green, and the issue is still unresolved. No one lied. The agent ran the tests it was given, in the repo it was given, under the “done” rules it was given. The model did its job. The things around the model did not.
Most people will go change the prompt, or switch models, or buy a larger context window. Sometimes that helps. More often it just moves the failure somewhere else.
rari's order of fixes is: harness first, loop second, graph last. If an agent cannot check its own work with things it controls, add sensors and a verification loop first. If it cannot even finish a task within one session, fix the map, tools, and context first. If it loses the thread in long tasks, add persistent state and a session loop first. Only draw a graph when the task truly has distinct steps and distinct requirements. Most agents should stop at step three or four.
The 6-layer review built by the Claude Code team is essentially moving “rules” out of the prompt and into the infrastructure. For example, “do not modify existing tests” written in markdown is only a suggestion; a hook that blocks writes to existing test files is a rule. Boris Cherny said that talking to Claude is like talking to a colleague: give goals, don't over-scaffold. But the premise is that your environment must let the colleague do the work and also be checked.
A reader said in a reply: My agent ran the tests it was given, in the repo it was given, under the “done” rules it was given—and I set all three myself. I stopped rewriting the prompt and started rewriting the rules for “done.”
This may be the most valuable sentence in this system. The model is rarely the bottleneck now. The bottleneck is the space it works in, the time it is given, and the route it takes. Build the harness first, then close the loop, then draw the graph. With every model upgrade, re-check which of these three layers are still needed.
If you remember only one thing: when the agent passes the tests but the problem remains, don't change the prompt first. Check whether it can verify itself, whether it has stop rules, and whether the dependencies between steps are real. It sounds obvious, but most teams really do stop before the third layer.
发布时间: 2026-11-30 01:27