AI Development

Code review with Claude Code: 5 lines in CLAUDE.md to stop endless review loops, based on the Anthropic team’s rules

Five lines in CLAUDE.md stop endless Claude Code reviews: define an error, allow 3 style notes, require file and line, start with a count, stop after 3 rounds.

Luca Di Domenico

Luca Di Domenico

· 6 min read

In short

On the Claude Code team, one pull request went through more than 50 rounds of review and fixes in a single night, and about 59% of the findings were about code already there at the first pass. After a 3-round cap, internal pull requests needing 5 or more rounds fell from 8.9% to 1.5%. The same ideas fit in 5 lines to copy into CLAUDE.md before running /code-review: what an error means, at most 3 style comments, file and line for every problem, a summary that starts with the count, 3 rounds at most.

To stop Claude Code reviews from running forever, 5 lines in your CLAUDE.md are enough: what an error means in your project, at most 3 style comments, a file and line for every problem, a summary that starts with the number of problems, and a cap of 3 rounds. Then run /code-review before you ship. The rules come from what the Claude Code team learned after a night in which an AI reviewer kept dredging up the same problems.

What happened on the Claude Code team?

One pull request to the Claude Code CLI went through more than 50 rounds of review and fixes in a single night before the person who opened it stopped it. One agent fixed, the reviewer agent found more findings, and neither of them stopped. Addy Osmani, Morgan Westlee Lunt and Qing Wang tell the story in How the Claude Code team does code review, published on October 15, 2026 on Anthropic’s developer blog.

The engineers ran git blame on what the reviewer kept flagging. About 59% of it was code that had been there since the first pass. The Claude Code reviewer rarely found new bugs: each round it dug up a few more old ones.

Why can it happen to you too?

If you ask Claude to keep re-checking the code until everything is perfect, you create the same setup: an author and a reviewer keeping each other busy. Anthropic’s post explains the mechanism: a person waves off a style comment in seconds, while an agent fixes it. Every fix means another commit and another review round.

Every round has a cost. The /code-review command runs in your own session and uses your plan or API credit like the rest of your work. You burn through your quota and the project doesn’t get any better.

What changed with the new rules?

After that episode the Claude Code team capped the rounds: after the third, the reviewer asks the author to step back and reconsider the approach. It also limited later re-reviews to the new changes only and banned repeating findings already posted. On internal pull requests, the numbers are these:

  • pass after a single review-and-fix round: from 65% to 78%;
  • need 5 or more rounds: from 8.9% to 1.5%;
  • average reviews before passing: from 2.08 to 1.32.

From June to September, merged pull requests to the Claude Code codebase more than doubled, and the share of changes that had to be reverted because they broke something fell by more than 40%. That figure covers the whole review system the team built, round limits included: more code shipped and fewer steps back.

What are the 5 lines to copy into CLAUDE.md?

/code-review is the command Claude Code uses to reread your code the way a colleague would. What to check, though, is up to you, in your project’s CLAUDE.md file. These are my 5 lines, built on the advice in Anthropic’s post (I wrote them in Italian; here they are in English):

# Review rules
- An error here means: the total shown to the customer is wrong.
- At most 3 style comments: leave the rest alone.
- For every finding, give the file and line. No guesses without proof.
- The summary starts with the number of problems found. If there's nothing to fix, say so.
- Review: 3 rounds at most. After the third, stop and suggest changing the approach.
  1. What an error means. The first line tells Claude Code what really matters in your project. In quoting software, an error is a wrong total shown to the customer. This is the line to adapt: Anthropic’s post mentions docs, where an error is false information, and config, where it’s a misroute.
  2. At most 3 style comments. That way the review doesn’t fill up with pointless details the agent then fixes one by one.
  3. File and line for every problem. Claude Code has to point to where the problem is, with real proof. No guesses inferred from a function’s name.
  4. The summary starts with the number of problems. If there’s nothing to fix, Claude Code says so. It doesn’t have to find something.
  5. 3 rounds at most. After the third, Claude Code stops and, at most, suggests a different approach.

Every review loads your CLAUDE.md, so it pays to keep it short: I explained here why you should revisit it often. These 5 lines fit without weighing it down.

What difference do the rules make?

I ran the same review with and without the rules. Without rules I got 3 findings in English, one of them off topic. With the rules I got 2 problems in Italian, with a concrete example of what the customer sees: a taxable amount of €0 instead of €450.

The whole difference is in the first line. When Claude Code knows that an error is a wrong total, it looks for exactly that and describes it in terms of what it means for the people using the software.

What changes on a Team or Enterprise plan?

On a Team or Enterprise plan you also get Code Review, Anthropic’s service that automatically reviews every pull request on GitHub. You can put the same rules in a REVIEW.md file at the root of the repository. The service reads both CLAUDE.md and REVIEW.md, and it takes REVIEW.md from the default branch: merge it there first for it to take effect.

The /code-review command on your own machine, on the other hand, reads only CLAUDE.md and works on any plan. That’s why rules you want applied in both places belong in CLAUDE.md. Anthropic’s automated app maintenance also goes through Claude Code Review before a human check: I covered how it works here.

Where to start?

Copy the 5 lines into your CLAUDE.md, change the first one to whatever a real error means in your project, and run /code-review before you ship. Your next review will have a clear goal and an end.

Sources

  • How the Claude Code team does code review — Post by Addy Osmani, Morgan Westlee Lunt and Qing Wang, October 15, 2026: a CLI PR with more than 50 review rounds overnight, about 59% of findings on code present since the first pass, a 3-round cap, PRs passing after one round from 65% to 78%, needing 5+ rounds from 8.9% to 1.5%, mean reviews from 2.08 to 1.32; from June to September merged PRs more than doubled and the revert share fell by more than 40%; Code Review available on Team and Enterprise plans
  • Review locally with /code-review — Claude Code documentation, checked on November 10, 2026: /code-review works on any plan, counts toward session usage, follows CLAUDE.md and doesn’t read REVIEW.md
  • Customize Code Review — Claude Code documentation, checked on November 10, 2026: the Code Review service on GitHub reads CLAUDE.md and REVIEW.md, and takes REVIEW.md from the default or base branch, never from the pull request’s own changes

Want to know what this means for your product?

If you're building software with AI and want a second opinion on how you're working, tell me about your project.

Tell me about your project
Claude CodeCode reviewAI agentsAI development

Follow the blog

One email for every new article

I only write when an article is out: title, summary and link. You can unsubscribe with one click from any email.

RSS feed

An RSS feed is the up-to-date list of articles: add it to a reader app like Feedly or Inoreader and new articles show up there, no email needed.

lucadidomenico.studio/en/blog/rss.xml