diffox
Blog

What is REVIEW.md, and where do code review rules go?

Which file and which branch do AI code review tools read your rules from? We read six tools’ docs, from REVIEW.md to Copilot and Bugbot.

ShareXLinkedIn

Summary. REVIEW.md is the instructions file that Claude Code’s Code Review service reads only when it reviews a pull request. Other AI code review tools have files of their own. On 5 November 2026 we read the documentation of Claude Code Review, GitHub Copilot code review, Cursor Bugbot, OpenAI Codex, Gemini Code Assist and CodeRabbit: which file each one reads, from which branch, and what each recommends for a rule that works.

  • Each tool has its own file. According to their documentation, only Claude Code Review and Copilot read REVIEW.md. Codex looks at a section in AGENTS.md, Bugbot at .cursor/BUGBOT.md, Gemini Code Assist at .gemini/styleguide.md and CodeRabbit at .coderabbit.yaml.
  • The tools read the rules from different branches. Claude Code Review reads REVIEW.md from the branch the pull request merges into or from the default branch, never from the pull request’s own changes. Copilot reads its instructions from the pull request’s own branch: a pull request that changes the instructions file also changes its own review.
  • Claude Code follows instructions that narrow a review only from a protected branch. Lines that lower a finding’s severity, exclude a file or a path, or cap minor comments are not applied unless REVIEW.md is on a protected default branch.
  • A rule that works is short, specific and close to the code. Codex suggests starting with 2–3 rules, GitHub with 10–20 instructions. What the documentation recommends: say plainly what counts as a problem and what not to report, show the right way, leave lint to CI, and try the rule on a real pull request.

What is REVIEW.md, and how is it different from CLAUDE.md?

6AI code review tools whose documentation we read
2tools say they read REVIEW.md: Claude Code Review and Copilot
2tools read instructions from the reviewed pull request’s branch: Copilot and CodeRabbit
2–3short rules: where Codex suggests you start

In the AGENTS.md and CLAUDE.md post we covered the rules files of coding agents, and in the code review prompt post the rules of a good review instruction. One of the five questions in the post on reviewing AI-generated code was “Does it follow the repository’s rules?” This post looks at how those rules reach the AI tools that review pull requests: which tool reads which file, which branch it takes the rule from, and what it recommends for a rule that works.

According to Claude Code’s documentation, REVIEW.md is the instructions file the Code Review service uses only when it reviews pull requests. It goes in the repository root and says three things: what counts as a finding, at what severity it is reported, and what to skip. CLAUDE.md, on the other hand, holds the project instructions Claude Code reads for every task. Code Review reads it too, and reports a change that breaks its rules as a finding. So REVIEW.md doesn’t replace CLAUDE.md; it sits beside it.

According to the documentation, the text of REVIEW.md is given to the agents that find and verify issues as the repository’s review instructions, and the step that writes the final review consults it before settling severity and writing the summary. Code Review gives every finding a severity level: Important is a bug that should be fixed before merging; Nit, a minor issue worth fixing that doesn’t block the merge; Pre-existing, a bug that was in the code before this pull request. A REVIEW.md in a subfolder adds rules for changes in that folder, on top of the root file.

One detail often gets mixed up: the /code-review command you run in the terminal is a separate tool. It doesn’t read REVIEW.md and follows only CLAUDE.md. That is why the documentation suggests putting a rule you want applied in both places in CLAUDE.md, and a rule that belongs only to pull request review in REVIEW.md.

If REVIEW.md grows long, you can split the rules into separate files and include them in the root file: a line holding only @ and the file’s name is enough. You can include at most 8 files, and REVIEW.md and the files it includes must stay under 150,000 bytes combined. The same way, you can include a skill’s SKILL.md file; a skill is a package of instructions an agent loads when it needs them. Code Review doesn’t run the skill; it only reads its text as rules. And included files only take effect when REVIEW.md is read from a protected branch.

Which review tool reads which file?

The rules file has a different name in each tool, and some tools read other tools’ files too. We read the documentation of all six on 5 November 2026:

The rules files six AI code review tools read, how each ties a rule to a folder or a path, and the size limit its documentation gives
ToolRules fileRules by folder or pathSize limit
Claude Code ReviewREVIEW.md, CLAUDE.mdREVIEW.md and CLAUDE.md in a subfolder, for the files changed in that folderREVIEW.md and the files it includes: 150,000 bytes combined, at most 8 files
GitHub Copilot code review.github/copilot-instructions.md, .github/instructions/*.instructions.md; also AGENTS.md, CLAUDE.md, GEMINI.md, REVIEW.md.instructions.md files with an applyTo patternNo limit stated; it recommends about 1,000 lines per file at most
Cursor Bugbot.cursor/BUGBOT.md; in the dashboard, team rules, learned rules and manual rulesBUGBOT.md files found walking up from the changed file; path patterns on dashboard rules30,000 characters per rule, 100,000 in total
OpenAI CodexThe ## Code Review Rules section of AGENTS.mdThe AGENTS.md closest to the changed file, together with the root oneNot stated in the documentation
Gemini Code Assist.gemini/styleguide.md; settings in .gemini/config.yamlNo rules by path in the documentation; ignore_patterns to exclude filesNot stated in the documentation
CodeRabbitpath_instructions in .coderabbit.yaml; also AGENTS.md, CLAUDE.md, GEMINI.md, Copilot’s and Cursor’s rules filesGlob patterns in path_instructions; AGENTS.md and CLAUDE.md in a subfolder apply to that folder onlyNot stated in the documentation

Source: the tools’ documentation, 5 November 2026. “Not stated in the documentation”: we found no sentence about it on the pages we read that day. Copilot’s line count is not a limit; it is GitHub’s recommendation.

Two things follow from the table. First, one rule can reach more than one tool. Copilot also reads CLAUDE.md, GEMINI.md and REVIEW.md; CodeRabbit automatically uses AGENTS.md, CLAUDE.md and Copilot’s instructions files as review criteria. If two review tools run on one repository, a rule you write for one can change the other’s review as well. Second, your coding agent’s rules don’t always reach the review: Cursor’s project rules under .cursor/rules/ don’t apply to Bugbot.

The documentation also says where a shared rule goes. GitHub recommends AGENTS.md for standing rules you want to share across tools, and copilot-instructions.md for rules that are Copilot’s alone. Claude Code’s advice above is the same: put a shared rule in the shared file, and a rule that belongs only to review in the tool’s own file.

You can also give rules to every repository from one place. In Copilot, organization custom instructions apply to Copilot code review too; in Bugbot, team admins write team rules that apply to all repositories; in Gemini Code Assist, a feature in preview gives one style guide to several repositories from the Google Cloud console. Bugbot can even write rules for you: with learning on, it draws rules from pull requests that are merged or closed, and it saves an @cursor remember comment on a pull request as a rule.

Which branch is the rule read from, and why does it matter?

While a pull request is under review, the repository exists in two versions: the one on the base branch it will merge into, and the one on the pull request’s own branch. The rules file is read from one of the two. Here is the difference: if the rule is read from the pull request’s own branch, a pull request that changes the rules file has also changed the rules of its own review. The tools fall into two groups:

Which branch is the rule read from?. From the base branch: REVIEW.md, bugbot.yaml. Claude Code Review · Bugbot: A PR can’t change its own review. A rule change has to be merged first. From the pull request’s own branch: copilot-instructions.md, .coderabbit.yaml. Copilot · CodeRabbit: A PR can change its own review. Try the change in the same PR; review it like code.
For pull requests from forks, CodeRabbit uses the target branch’s configuration. The documentation of Codex, Gemini Code Assist and Bugbot (for BUGBOT.md) doesn’t say which branch they read. Source: the tools’ documentation, 5 November 2026.

Claude Code Review reads REVIEW.md from the base branch or from the default branch, never from the pull request’s own changes. For a change to REVIEW.md to reach reviews, it has to be merged first. Bugbot also reads its settings file, .cursor/config/bugbot.yaml, from the base branch; in its documentation’s words, a pull request can’t change how Bugbot reviews itself.

Claude Code goes one step further. It follows three kinds of instruction in REVIEW.md only when it reads the file from a protected default branch: lowering a finding’s severity; excluding a path, a file or a kind of issue; and capping the number of Nit comments. All three make the review say less. If the default branch isn’t protected, Code Review reads only the root file; if it can’t confirm whether the branch is protected, it reads no REVIEW.md at all and says so in the pull request’s check run. What counts as protection on the default branch is a classic branch protection rule or a ruleset. The ruleset has to either restrict updates or require a pull request with at least one approval; if it requires an approval, it must also dismiss it on a new push or require it to come after the last push.

Copilot, by contrast, reads custom instructions, agent instructions and skills from the pull request’s own branch. Its documentation presents this as a convenience: you can try a change to the instructions in the same pull request without merging it. The other side of it: a pull request that changes the instructions file is reviewed with the instructions it wrote itself. CodeRabbit also takes its configuration from the branch under review; for pull requests from forks, it uses the target branch’s configuration. Codex’s and Gemini Code Assist’s documentation doesn’t say which branch the rules are read from.

If your tool reads the rules from the pull request’s branch, or its documentation doesn’t say, review a change to the rules file like code. On GitHub, the tool for that is CODEOWNERS: pull requests use this file’s version on the base branch, so a pull request can’t choose its own approver by changing CODEOWNERS. If you require code owner approval in branch protection, every change that touches a rules file waits for its owner’s approval before the merge. Cursor’s documentation recommends the same for Bugbot’s settings file: use code review and CODEOWNERS to limit who can change it. An example CODEOWNERS:

.github/CODEOWNERS
# Rules files of the AI reviewers: a change needs this team's approval
REVIEW.md                         @your-org/review-owners
CLAUDE.md                         @your-org/review-owners
AGENTS.md                         @your-org/review-owners
BUGBOT.md                         @your-org/review-owners
/.github/copilot-instructions.md  @your-org/review-owners
/.github/instructions/            @your-org/review-owners
/.gemini/                         @your-org/review-owners
/.coderabbit.yaml                 @your-org/review-owners
/.cursor/config/bugbot.yaml       @your-org/review-owners

A rules file is text the model reads. We covered how instructions hidden in a pull request can steer review tools in the prompt injection post.

How do you write a review rule that works?

The vendors give very similar advice:

A review rule that works. What the vendors’ documentation recommends. Start short: Codex suggests 2–⁠3 rules to start, GitHub 10–⁠20 instructions. Be specific: Say what the problem is, where, and why. Show the right way: Without the safe path, the model may take expected behaviour for a bug. Say what not to report: Generated files, lock files, what CI already checks. Keep the rule close to the code: A file in the subfolder, or a path pattern. Ask for evidence: A claim about behaviour cites a file and line.
Source: the documentation of Claude Code, GitHub and OpenAI Codex, 5 November 2026. Where each row comes from is in the paragraphs below.

Start short. According to GitHub’s tutorial, some instructions can be overlooked in very long instructions files. The tutorial recommends keeping a file under about 1,000 lines and starting with 10–20 specific instructions. Codex’s documentation tells you to start with fewer: 2–3 short rules that describe the checks reviewers often have to explain.

Be specific, and show the right way. According to Codex, a good rule describes something specific to your repository that has consequences: a compatibility constraint that must not break, a data boundary that must not be crossed or an unsafe side effect, and why it matters. Write down the safe path or the exception too; the documentation asks for it so that the model can tell a real issue from expected behaviour. GitHub recommends short, imperative bullet points, distinct headings, and code examples that show the correct and the incorrect pattern side by side.

Say what not to report. Claude Code’s example REVIEW.md has a “Do not report” list: lint, formatting and type errors that CI already checks, generated files, lock files. Codex also asks you to leave formatting, lint and other mechanical checks to CI. For paths you don’t want to leave out entirely, Claude Code’s documentation suggests a higher bar instead of a ban. Its example: “in scripts/, only report if near-certain and severe.”

GitHub also lists instructions Copilot doesn’t support: trying to change the format of its comments, asking it to block a merge until its comments are resolved, telling it to follow standards at an external link, or vague requests such as “be more accurate” and “don’t miss any issues”. According to the tutorial, vague requests like these don’t improve the review; they only add noise. A standard that lives at an external link has to be copied into the file itself.

Keep the rule close to the code. Instead of writing every rule in the root file, tie it to the folder it concerns; five of the tools in the table have a way to do that. According to GitHub, this keeps language-specific rules off the wrong files. According to Codex, unrelated changes then don’t have to carry a service’s rules.

Ask for evidence. For findings that turn out to be wrong, Claude Code’s documentation suggests an evidence requirement: a claim about behaviour has to point to a file and line in the source instead of guessing from a name. According to the documentation, this cuts the false alarms that would otherwise cost the author a round trip. We covered the evidence requirement in detail in the code review prompt post.

An example REVIEW.md to start from

The file below is an example that puts this advice together; it is not any real repository’s rules. We had a payment service in mind: change the paths and the rules to fit your own repository.

REVIEW.md
# Review instructions

## What is Important here
- Important: wrong amounts, data leaks, broken auth.
- Also Important: a migration that cannot be rolled back.
- Style, naming and refactoring: Nit at most.

## Always check
- Amounts are integer cents, never floats.
  Safe path: the Money type. Exception: display only.
- Every query filters by the caller's account.
  Safe path: scoped_query(). Exception: admin reports.
- A new endpoint checks permissions before reading data.

## Evidence
- A behavior claim cites the file and line that prove it.
- Never infer behavior from a function's name.

## Do not report
- Lint, formatting, type errors: CI checks them.
- Generated code under gen/ and lock files.
- In scripts/, only near-certain, severe problems.
EXAMPLE. Four headings, four jobs. REVIEW.md: ## What is Important here / - Important: wrong amounts, data leaks, broken auth. / - Style, naming and refactoring: Nit at most. / ## Always check / - Amounts are integer cents, never floats. /   Safe path: the Money type. Exception: display only. / ## Evidence / - A behavior claim cites the file and line that prove it. / ## Do not report / - Lint, formatting, type errors: CI checks them.. What is Important: Defines severity for your repository. Always check: A rule to check on every pull request, with its safe path. Evidence: Asks for a finding’s evidence, cutting false alarms. Do not report: Skips CI’s job and generated files.
The four headings of the example file. The rule and path names were made up for a payment service.

In Claude Code, two parts of the file need a protected branch: the line that lowers style comments to Nit lowers a severity, and the “Do not report” list excludes paths and kinds of issue. If REVIEW.md isn’t on a protected default branch, these two are not applied. Change the severity names to suit your tool as well: Claude Code has Important and Nit, while Codex on GitHub reports only P0 and P1 issues. Copilot reads REVIEW.md already; for Bugbot you can put the same text in .cursor/BUGBOT.md, and for Codex under a ## Code Review Rules heading in AGENTS.md.

How do you know whether a rule works?

You judge a rule by trying it on a real pull request, not by reading it, and that is what the documentation recommends too. Codex tells you to open a pull request that represents your repository well, ask for @codex review, refine the rule based on the findings, and narrow or remove instructions that produce noise. GitHub recommends adding instructions one at a time or in small groups and testing each time with a new pull request, and it adds a warning: Copilot may not follow every instruction perfectly every time. CodeRabbit asks you to watch a few reviews before adding a path instruction.

Some tools also show which rules were used. In Bugbot, comment bugbot run verbose=true on a pull request and you get a table of every rule that went into that review, with the truncated and omitted ones flagged; the dashboard shows how many findings each rule produced and what share of them the team accepted. CodeRabbit lists the rules files it used separately in the review summary. And Claude Code Review says so in the check run when it read REVIEW.md from an unprotected branch, couldn’t apply it at all, or skipped included files.

The final decision still rests with the team. Codex’s documentation says so plainly: review rules don’t replace tests, branch protection or required approvals. Claude Code Review doesn’t approve or block the pull request either. Our AI code review tool, diffox, also posts its findings on the pull request as comments: each one is classed as Critical, Warning or Suggestion, and diffox never blocks a merge. Whether a review tool’s approval should count toward a merge is the subject of a separate post.

Frequently asked questions

What is REVIEW.md?

It is the instructions file in the repository root that Claude Code’s Code Review service reads only when it reviews pull requests. It says what counts as a finding, at what severity to report it and what to skip; a REVIEW.md in a subfolder adds rules for changes in that folder. Code Review reads it from the branch the pull request merges into or from the default branch, never from the pull request’s own changes. GitHub Copilot code review reads REVIEW.md too.

What is the difference between REVIEW.md and CLAUDE.md?

CLAUDE.md holds the project instructions Claude Code reads for every task; Code Review reads it as project context and reports a change that breaks its rules as a finding. REVIEW.md is for review alone: severity, paths to skip, rules to check on every pull request. The /code-review command in the terminal reads CLAUDE.md and not REVIEW.md. Put a rule you want applied in both places in CLAUDE.md.

Where do Copilot code review instructions go?

For the whole repository, in .github/copilot-instructions.md; for rules that apply only to some files, in .instructions.md files under .github/instructions/ that start with an applyTo pattern. To keep an instructions file out of code review, add excludeAgent: "code-review" to its frontmatter. Copilot also reads AGENTS.md, CLAUDE.md, GEMINI.md and REVIEW.md. The instructions are read from the pull request’s own branch, so you can try a change in the same pull request without merging it.

How do you write Bugbot rules?

In .cursor/BUGBOT.md files. Bugbot always reads the root file, and also the ones it finds walking up from the changed files; Cursor’s project rules under .cursor/rules/ don’t apply to Bugbot. Team admins can write team rules for all repositories, and rules for a single repository can be written in the dashboard. With learning on, Bugbot draws rules from pull requests that are merged or closed, and an @cursor remember comment adds a rule too. bugbot run verbose=true shows which rules a review used.

Does AGENTS.md affect code review?

It depends on the tool. Codex reads its review rules from the ## Code Review Rules section of AGENTS.md; the AGENTS.md closest to the changed file applies together with the root one. Copilot code review and CodeRabbit read AGENTS.md too. Claude Code Review’s documentation describes CLAUDE.md and REVIEW.md instead, and AGENTS.md doesn’t come up on the Bugbot and Gemini Code Assist pages we read.

Can a pull request change its own review rules?

It depends on the tool. Claude Code Review reads REVIEW.md from the base branch or the default branch, never from the pull request’s changes, and Bugbot’s settings file is read from the base branch too. Copilot, by contrast, reads its instructions from the pull request’s own branch: a pull request that changes the instructions file also changes the rules of its own review. If you add the rules files to CODEOWNERS and require code owner approval in branch protection, every change to those files waits for its owner’s approval before the merge.