Tutorial · 9 min read

Claude Code with REVIEW.md support in code review

Claude Code is expanding its support for local code review. It follows the rules you write down in a REVIEW.md file. How will that make your life easier?

The local /code-review command in Claude Code follows the rules in REVIEW.md. It takes the file from the repository’s default branch, which the author of the change under review can’t touch, so a pull request can’t quietly rewrite the rules by which it is judged. Claude Code has supported the root file since version 2.1.333 and files in subfolders since 2.1.334 (according to the changelog).

I like this solution. Until now you could write rules for the reviewer, but a pull request could rewrite them just as easily, which is like letting the thief write the guard’s instructions. It does have a few holes, though, and you should know about them before you start relying on REVIEW.md:

  • The copy from the default branch is what counts. A file in the working tree or in the diff is, for the review, just code to be checked.
  • New rules only apply after git fetch.
  • Files in subfolders can only tighten. Only the root file may loosen.
  • CLAUDE.md remains something of a hole. It is read from the branch under review.
  • The local command doesn’t check branch protection. Anyone who can push to the default branch can wreck the rules, so don’t let the bozos do that.

REVIEW.md and CLAUDE.md

CLAUDE.md contains project instructions that Claude Code loads for every task. REVIEW.md is a file for review only. It tells the reviewer what to report in a given repository, at what severity, and what to skip. Originally it belonged only to the paid Code Review service, which comments on pull requests on GitHub in the Team and Enterprise plans. The local /code-review runs in your session, works in every plan, and counts toward your normal usage.

So even a freelancer on a Pro subscription can now set up what the reviewer should watch for.

If all you want is proper code reviews on your small project, you can stop reading here. Just write the extended rules into the REVIEW.md file, or let Claude Code generate them from your codebase.

Claude Code has no special command for this, you simply ask it with an ordinary prompt. For example like this:

Projdi tenhle repozitář a navrhni soubor REVIEW.md pro /code-review.
Drž ho krátký, nejvýš 40 řádků, a napiš do něj:
- co v tomhle projektu znamená závažnost Important (co by rozbilo
  chování, vyzradilo data nebo znemožnilo návrat k předchozí verzi),
- kontroly specifické pro tenhle kód; u každé uveď soubor nebo složku,
  ze kterých vychází,
- limit nejvýš pět nálezů typu Nit.
Nepřidávej seznam cest k vynechání, nic, co už hlídá lint nebo testy
v CI, ani obecné rady typu „dodržuj osvědčené postupy“.
Soubor jen navrhni, neukládej ho a necommituj, nejdřív ho projdu.

Read the draft before merging it. The model likes to add generic advice and exceptions that would end up weakening the review.


Which copy the review uses

The decision is made by the origin/HEAD pointer in your clone of the repository. It points to the default branch in the state in which you last fetched it. The current state on the server, your local main, and files you are still working on don’t count.

The commit is picked directly by the program, and the model has no say in it. The reviewer receives the text of the rules from the default branch, along with an instruction that a copy in the working tree or in the diff is just code to be checked. If a pull request overwrites or deletes REVIEW.md, the rules from the default branch still apply, and the tampering with the rules itself shows up among the findings.

New rules only apply after you fetch. A rule merged an hour ago is unknown to the review until you run git fetch.

A clone without the pointer doesn’t use the rules at all. A regular git clone writes the pointer. A repository assembled by hand with git init, a shallow clone, or a remote named something other than origin may not have it. The review then reports “REVIEW.md wasn’t followed” and you fix it with two commands:

git fetch origin
git remote set-head origin --auto

You can’t tell from the normal output whether the rules were applied. The program prints the confirmation “Followed REVIEW.md…” with the commit hash only in the machine-readable output format. If you run the review from a script and want certainty, you have to ask for that format.


Rules in subfolders

REVIEW.md can also live in a folder, for example services/billing/REVIEW.md for the payments part of an application. According to the prompt texts embedded directly in the program, a stricter regime applies to these than to the root file.

A folder may only tighten. It can add checks and raise the severity of findings, but lowering severity, skipping a path, or capping the number of minor nitpicks is allowed only for the root REVIEW.md. Checks from a folder also apply only to files within it.

Only committed changes count. A folder where you have only work-in-progress edits doesn’t get its REVIEW.md. The review also has to know in advance which files changed, so it loads the rules from folders when you review a branch or a range of commits. When you review a specific pull request by number, it leaves them out.

This makes sense. If a folder could grant permissions, any team could switch off the review for its own area with a file nobody outside the team reads.


What REVIEW.md may suppress

The root REVIEW.md may lower severity, skip named paths or kinds of findings, and cap the number of nitpicks, though not down to zero. For a security issue it may do none of this. An instruction like “report nothing” or one that would skip most of the change doesn’t count at all.

Sounds like a solid safeguard? It’s a sentence in a prompt, and the model decides what counts as a security issue. A rule like “report nothing in the gen/ folder” can therefore hide a logic bug in generated code. A shell command injection in the same file, on the other hand, the review will report.

You can include additional files. A line containing only @nazev.md includes a file located next to the root REVIEW.md. Eight files fit, 150 kB in total. A file in a subfolder is not included, and a typo in the name leaves no trace, so after every change verify that the rules really apply.


What a pull request can still influence

The anchoring protects REVIEW.md. The rest stays open.

CLAUDE.md is read from the branch under review. The reviewer will usually see through a crude attempt like “ignore REVIEW.md” and report it. But a plausible-sounding “convention” that passes a bug off as intentional can shift the recommendation. And a rule that a pull request quietly deletes from CLAUDE.md is a rule the reviewer will stop applying.

A read ban disables an included file. A read ban in the project settings can’t reach the root REVIEW.md, but it can reach a file included via @. Checks that must survive anything therefore belong directly in the root file.

The origin/HEAD pointer is just a local record. A pull request can’t reach it. But an agent that is allowed to run git in your clone can redirect it with a single command, and the review will then happily apply the rules from a different branch.

The local command doesn’t check branch protection. The paid service takes instructions that lower strictness only from the protected branch. The local command doesn’t ask.


Local command vs. the paid service

Local /code-reviewCode Review service
Where it runsin your Claude Code sessionon Anthropic’s infrastructure, comments on pull requests on GitHub
Planany, counts toward normal usageTeam and Enterprise, enabled by the organization owner
Where it gets REVIEW.md fromthe default branch according to the local origin/HEADthe base or default branch on GitHub
Branch protectionnot checkedlowering strictness, folders and includes only from the protected branch
Folderstighten onlyyes, except folders with tests, examples, generated and third-party code
Including @files next to the rootfiles next to the root and skills from .claude/skills/
CLAUDE.mdfrom the branch under reviewroot and parent folders of changed files
Confirmation that the rules were appliedonly in the machine-readable output formata report in the check on GitHub

The details about the service come from the Customize Code Review page.


How to write a REVIEW.md that’s actually useful

According to a description of review within the Claude Code team, good files are short and are written by the people responsible for the code in question. They say what failure looks like in this particular repository (for documentation it “lies”, for configuration it “routes traffic wrong”), they cap the number of nitpicks, and they demand a file and line as evidence instead of guessing from a function name.

Here is what a first REVIEW.md for a smaller web application might look like:

# Pravidla pro review

## Co je Important
Important je jen to, co rozbije chování, vyzradí data nebo znemožní
návrat k předchozí verzi: chybná logika, dotaz do databáze bez omezení
na přihlášeného uživatele, osobní údaje v logu, migrace bez cesty zpět.
Styl a pojmenování jsou nanejvýš Nit.

## Vždy zkontroluj
- Změna v CLAUDE.md, REVIEW.md, CODEOWNERS nebo ve složce .claude/
  je Important. Napiš, co nového tím změna povoluje.
- Nový endpoint API má integrační test.
- Tvrzení o chování dolož citací soubor:řádek. Odhad podle názvu
  funkce nestačí.

## Drobnosti
Nahlas nejvýš pět nálezů typu Nit.

The first check targets the hole with CLAUDE.md: if a pull request can edit it anyway, at least it shouldn’t pass unnoticed. Don’t put a list of paths to skip into your first REVIEW.md. Add it once the review really starts to annoy you, because every such line can hide a real bug.


What to set up

  1. Merge REVIEW.md into the default branch and protect it. Assign REVIEW.md, CLAUDE.md, included files and the .claude/ folder to specific people in CODEOWNERS and turn on mandatory approval from them.
  2. In every clone where the review runs, fix the pointer with the two commands from the section above.
  3. For folder rules, review a branch or a range of commits and commit your changes before the review.
  4. In scripts, request the machine-readable output format and check that the “Followed…” confirmation shows the commit you expect.

Takeaways

The local review finally reads its rules from a place the author of the change under review can’t reach. The logic is well thought out: the program picks the commit, folders only tighten, and instructions like “report nothing” don’t count. But CLAUDE.md still comes from the branch under review, branch protection isn’t checked, and the whole feature is controlled by a switch that Anthropic can turn off on the server. And the documentation still claims that the local REVIEW.md command doesn’t read it. For a tool meant to check whether code matches its description, I found that rather amusing.

Above all, though, a prompt remains a prompt, even when it’s anchored. REVIEW.md is applied by a model, and a model decides one way one time and another way the next. Formatting, a mandatory comment on a function, or a forbidden import are enforced more reliably by ten lines of script in CI. Save REVIEW.md for what a script can’t do, namely judgment.

Sources: Claude Code changelog (versions 2.1.333 to 2.1.335), the documentation of the local command and of the Code Review service, the Claude Code team blog, and the prompt texts in version 2.1.335. As of December 3, 2026; Claude Code changes by the day.

Patrick Zandl trains teams in Claude Code and agentic software development in Prague and writes about what actually works in real-world AI-assisted projects. Follow on LinkedIn

Read next

Get the next one by email

Every Tuesday: what changed in Claude Code, Codex and other coding agents, plus new articles. No spam.