How to write a code review prompt: six rules and a template
Six rules for writing a code review prompt for Claude Code, Codex, Copilot and Cursor, plus a template you can copy and adapt.
Summary. A code review prompt is the set of instructions that tells a model what to look at in a pull request and what counts as a finding. This post gives six rules for a prompt that works and a ready-made template, and shows which file each of four tools reads those instructions from. We checked each tool’s behaviour against its own documentation on 15 October 2026.
- Require evidence instead of listing topics. “Look for bugs, security and performance” makes the output longer; “if you cannot show the input that produces the wrong result, do not report it” makes it shorter and more accurate.
- Ask for a quote, not a line number. A verbatim quote from the code is the most reliable way to locate a finding and to verify it.
- Each tool reads its instructions from a different file. Claude Code reads
REVIEW.md, Codex a section ofAGENTS.md, Copilot its own instruction files, Cursor.cursor/BUGBOT.md. - A rule for your repository says what to flag and what the safe path is. “Watch out for security” is not a rule; “no email addresses in log lines” is.
Why most code review prompts produce noise
Most code review prompts are a list of topics: “Review this code; look for bugs, security holes, performance and readability.” The model takes the list at its word and writes something under every heading. You get a long, polite comment that is mostly useless. The author of the pull request either reads it all and throws most of it away, or skips it entirely.
What actually changes the output is a demand for evidence: the model reports what it can show and leaves out what it cannot. In diffox, which splits a pull request across 17 specialist agents, every agent’s instructions open with that same requirement (a separate post explains how it works). The six rules below come from that experience and from the tools’ own documentation.

The six rules
- Ask for evidence. A finding should come with a concrete input or state that produces the wrong result: “When the list is empty, the average divides by zero.” If the model cannot come up with such a scenario, it should stay quiet. This one sentence gets rid of most “you might also want to look at this” comments.
- Ask for a verbatim quote, not a line number. Models are bad at counting lines, but a quote is something you can search the file for. Anthropic’s documentation recommends the same technique: if the model cannot find a quote that supports a claim, it should retract the claim (source).
- Limit the scope to this change. A review is about problems caused by the lines the pull request adds or changes. Blame today’s author for every flaw in the old code and nobody will read the comment.
- Leave out matters of taste and what your tools already check. Formatting, naming preferences and a missing comment are not review findings; do not have the model repeat what the linter and the type checker already report. Codex’s documentation says the same: leave formatting and lint checks to CI.
- Define severity. Write down what “blocking” and “minor” mean: a wrong result, data loss or a security hole is blocking; something that shows up only on a rare path, or is no more than a misleading name, is minor. Without a definition, every finding comes out “important”.
- Set the output format. Every finding should come with the same fields: file, quote, scenario, wrong result, severity, a one-line fix. If there are no findings, the model should say so in one line and stop, rather than pad out an empty review.
What the six rules have in common is that each describes a check the model can actually make. “Be careful” cannot be checked; “is the quote in the file?” can.
Copy this template and adapt it to your repository
The prompt below puts the six rules together. Its last line sets the language of the comments; change it if your team reviews in another language. Beyond that, there are two places to adapt: the severity definitions and the “do not report” list.
You are reviewing a pull request. Report only defects that this
change introduces or exposes.
A finding is valid only if you can state all three:
1. the code, quoted word for word from the changed lines;
2. a concrete input or state that reaches that code;
3. the wrong result that follows, and what the right one would be.
If you cannot state all three, do not report it.
Do not report: style, formatting, naming taste, missing comments,
anything a linter or a type checker already reports, or code this
change did not touch.
Severity:
- blocking: wrong result, data loss, security hole, or a crash on
an ordinary path
- minor: wrong only on a rare path, or a name, comment or test that
says something the code does not do
For each finding give: file, the quoted code, the scenario, the
wrong result, severity, and a one-line fix.
If you find nothing, write "No findings" and stop.
Write the findings in English.
We kept the template short on purpose. Claude Code’s documentation warns that length has a cost: a long instruction file dilutes the rules that matter most. When you add rules of your own, check whether each new line actually changes a finding.
Which file does each tool read?
Where you write the prompt depends on the tool. We built the table below from each tool’s own documentation on 15 October 2026.
| Tool | Where the instructions go | What it covers | Starting a review |
|---|---|---|---|
| Claude Code Code Review | REVIEW.md (repository root); also CLAUDE.md | REVIEW.md is for reviews only: severity, paths to skip, repository-specific checks. CLAUDE.md violations are flagged as minor findings | When a pull request opens, on every push, or with an @claude review comment |
| Claude Code, local | The /code-review command; for your own prompt, .claude/skills/<name>/SKILL.md | The local command follows CLAUDE.md and does not read REVIEW.md | /code-review in a session (/review is the same command) |
| OpenAI Codex | A ## Code Review Rules section in the nearest AGENTS.md | Repository-specific behaviours that have consequences; on GitHub, only P0 and P1 issues are flagged | An @codex review comment on the pull request |
| GitHub Copilot | .github/copilot-instructions.md, .github/instructions/*.instructions.md, AGENTS.md | Instructions are read from the pull request’s head branch; CLAUDE.md, GEMINI.md and REVIEW.md are read too | Requesting a review from Copilot on the pull request |
| Cursor Bugbot | .cursor/BUGBOT.md | Always the root file, plus any it finds walking up from the changed files | Automatically on every update, or with a cursor review comment |
Source: each tool’s own documentation, 15 October 2026.

Two details are easy to miss. In Claude Code, only the managed Code Review on GitHub reads REVIEW.md; /code-review in the terminal does not. Copilot reads instructions from the pull request’s head branch, the one with your changes, so a pull request that changes an instruction file also changes the rules for its own review.
To turn your own prompt into a command in Claude Code, write a skill: put the template in .claude/skills/review-pr/SKILL.md and add the line !`git diff main...HEAD` at the top. That line runs the command and puts its output into the prompt, so when you type /review-pr, the model finds the diff already there (skills documentation).
Writing rules for your own repository
The template covers the basics; the real value is in your repository’s own rules. These are the things you find yourself saying in every review: which data may not cross which layer, which side effect is dangerous, which contract must not break.

A good rule has three parts, and Codex’s documentation lists all three: the behaviour to flag, why it matters, and the safe path or exception. The third is the one people forget most often: if you do not tell the model the right path, it flags the expected behaviour as a bug too.
- Weak: “Be careful with database queries.”
- Strong: “Every query must be scoped to the caller’s tenant. Safe path: the
scoped()helper. Exception: admin reports.”
You can set the evidence requirement at the repository level too. Claude Code’s documentation gives an example: a claim about behaviour must point to a file and line in the source rather than be inferred from a name. This one rule cuts the false alarms that would otherwise cost the author a round trip.
When one prompt is not enough
Ask one prompt about security, concurrency, tests and rule compliance all at once, and the model splits its attention and finds a little of each. On large changes, split the work instead: each prompt looks for one thing, under the same evidence requirement.
The second step is to check what the model says. A model can sound convincing and still be wrong: it quotes a line that is not in the file, or objects to code the change did not touch. Because you asked for a quote, a program can check this: is the quote really in that file, and does it belong to the changed lines? Claude Code’s documentation describes the same pattern for its managed Code Review: each agent looks for a different class of issue, then a verification step filters out false alarms.
diffox does both steps for you: each of the 17 specialist agents on the team looks for one thing and shows what it found with a verbatim quote from the code; code, not a model, checks the quote. Any sentence in your repository’s root rules file (AGENTS.md or CLAUDE.md) that states an obligation also goes to the agents as a review rule.
Test the rule on a real pull request
You cannot tell whether a prompt is good by reading it. The most practical advice is in Codex’s documentation: open a representative pull request, ask for a review, refine the rules based on the findings, and narrow or remove the instructions that produce noise.
- Try it on a change that contains a violation the rule should catch: does it catch it?
- Try it on a change that uses the safe path: does it stay quiet?
- Try it on an unrelated change: does it still stay quiet?
Review the same pull request twice and you can get two different results, so a single run is not a result. Compare the same few pull requests before and after you add a rule.
Frequently asked questions
How do you write a good code review prompt?
Ask for evidence instead of listing topics: every finding comes with a verbatim quote from the code and a concrete scenario that produces the wrong result, and if the model cannot show both, it does not report it. Limit the review to the changed lines, rule out style comments, define severity and set the output fields.
Where do you put a code review prompt for Claude Code?
For the managed Code Review on GitHub, in the REVIEW.md file at the repository root. The /code-review command in the terminal does not read that file; it follows CLAUDE.md. To turn your own prompt into a command, write .claude/skills/<name>/SKILL.md and call it with /name.
Where do you write review rules for Codex?
In a section headed ## Code Review Rules in the AGENTS.md file closest to the code the rules govern. Rules for the whole repository go in the root file; rules for one service go in the file in that service’s folder. You ask for a review by writing @codex review in a pull request comment.
How do you give GitHub Copilot code review custom instructions?
Write them in .github/copilot-instructions.md or, for particular paths, in .instructions.md files under .github/instructions/; Copilot also reads AGENTS.md, CLAUDE.md, GEMINI.md and REVIEW.md. Instructions are read from the pull request’s head branch.
Where do Cursor Bugbot rules go?
In .cursor/BUGBOT.md files. Bugbot always reads the root file, and also reads the files it finds walking up from the changed files. Team admins can also define rules in the dashboard that apply to every repository.
Does the prompt’s language matter?
What matters is how concrete a rule is, not the language it is written in. State the language of the comments separately. The example in Copilot’s documentation does exactly that: “When performing a code review, respond in Spanish.” The last line of this post’s template does the same job for English.
Does diffox use my own review rules?
Yes. When it reviews a pull request, it reads the repository’s root rules file: AGENTS.md first, CLAUDE.md if there is none. Every sentence in it that states an obligation goes to the specialist agents as a review rule. You do not need to write a separate prompt: the product handles the evidence requirement and the quote check itself.