Omniscio

OmniscioGuidesPromptsCode review

Claude Code prompt for code review

A review prompt fails in one of two ways. It finds nothing useful because it was asked to find everything, or it changes the code while reviewing it so you cannot tell a finding from a fix. Both are fixed by what you ask for, not by the model.

A review is only worth reading if it would change what you ship. The prompt below is built so its answer can be argued with: a file, a line, and the input that breaks it.

Checked against Anthropic's Claude Code documentation on November 25, 2026. By the Omniscio team. Updated .

The prompt

Paste this into a Claude Code session that is on the branch you want reviewed. Replace main with whatever your repository calls its base branch.

Run the test suite first and tell me whether it passes, with the command you ran.

Review the changes on this branch against main. For each changed file, tell me what could go wrong at runtime. Skip style.

For every finding give me: the file and line, the input that breaks it, and the smallest change that fixes it. Rank them by severity, most serious first. If a finding is a guess, say it is a guess.

Do not edit anything until I say go.

It is short on purpose. Claude reads the diff itself, so naming files or describing what changed is work it would have done anyway. What it cannot guess is what you consider a finding, in what order you want them, and whether you want the code touched.

Why each line is there

"Run the test suite first … with the command you ran"

Opening with the check is deliberate. Claude stops when the work looks done, and asking for the test run before the review means the answer begins with whether the branch is even in a state worth reviewing. Asking for the command as well is what turns it passed into evidence: all tests pass on its own tells you very little, and reading the output is faster than re-running it.

"the changes on this branch against main"

This is the scope. Claude Code's own review reads your branch's commits ahead of its upstream branch plus your uncommitted changes, which is the right unit for a review: the code that is about to land. Naming it in the prompt also stops the other failure, where a reviewer wanders into untouched files and reports things that were already true before your change.

"what could go wrong at runtime. Skip style."

This is the most valuable line in the prompt. A reviewer that is asked to find problems will always find something, and if you fix every finding you end up with extra abstraction layers and tests for cases that cannot happen. Anthropic's own wording for this is to skip style. Saying it in your own words does the same job, and naming the failure you care about narrows it further: a runtime failure has an input, and a style note does not.

"the input that breaks it"

This converts an opinion into a finding. A claim that a function is fragile costs nothing to make and nothing to check; a claim that { items: null } throws on line 42 can be true or false, and you can see which in a few seconds. It works because it forces the reviewer to construct the case rather than recognise a pattern.

"Rank them by severity, most serious first"

Telling Claude how you want the answer is one of the patterns Anthropic names for a working prompt. A review is read top to bottom, often while deciding whether to ship, so the order carries the judgement. Without it you get findings in file order, which is alphabetical rather than important.

"If a finding is a guess, say it is a guess"

A review report is evidence, and evidence that is not labelled by confidence is worse than none: you spend the same time on a certainty and a hunch. This line costs one sentence and separates the two.

"For each changed file … the smallest change that fixes it"

The per-file framing keeps the review tied to the diff instead of to the codebase. The second half is the scope limiter: a reviewer asked for a fix will propose the fix it would have written, which is often a rewrite. Asking for the smallest change that fixes the finding keeps the report proportional to the problem, and leaves the decision about a bigger change to you.

"Do not edit anything until I say go"

The review stays readable: nothing it reports has been changed underneath it, and each finding can be accepted or rejected on its own. It also keeps the review a review — the moment the findings are applied, the diff you are reading is a fix as well as a report, and you can no longer tell which change came from which finding.

If you would rather have both in one pass, that is what /code-review --fix is for, and its edits go through your permission mode like any other edit. The trade-off is the one above, not a rule against it.

The subagent version

A review is one of the cases where a subagent earns its cost. It reads a lot of files and returns a short report, and the same docs put a reviewer that has not seen how the code was written on the list of things subagents are good for. The file reads land in the subagent's context window instead of yours, so a long session does not carry them for the rest of the day.

Ask for it in the prompt you already have:

use a subagent to review this branch's diff against main, report only what
could fail at runtime and skip style, and give the file, line and breaking input
for each finding. Do not edit anything until I say go.

Anthropic uses almost this wording in its own best-practices page, with the review pointed at a spec: review the diff against the spec, check every requirement is implemented and the listed edge cases have tests, report gaps that affect correctness and skip style. Copying the shape is the point. The same page's note about skip style is worth reading twice.

Give it read-only tools

A subagent defined in .claude/agents/ can be limited to tools: Read, Grep, Glob, and that limit is enforced by Claude Code rather than requested in the prompt. One trap: a reviewer denied Edit and Write can still change files through Bash, so drop that too if the point is that it cannot write.

There is a worked example of the file itself on this site: the code reviewer subagent, and five complete files side by side in the subagent examples.

When not to bother

A subagent gathers context your conversation already has, so on a small diff it can be slower than asking in place, and it costs its own requests against the same usage. On a small diff, the plain prompt is usually the better trade.

What good output looks like

A useful answer to this prompt has four properties, and you can check each one by eye in under a minute.

  • It starts with the test result. One line: the command, and whether it passed. If the suite was already failing, that is the finding, and everything else is secondary.
  • Every finding has an input. A file, a line, and the value or sequence that breaks it. A finding with no input is a hypothesis, and the prompt asked for it to be labelled as one.
  • Nothing is a style note. No naming, no "consider extracting", no suggestion to add a type to something that already has one. If those dominate the answer, the skip style line was missing or too polite.
  • It is ordered by what would hurt most. A data-loss bug ahead of a null check, not the order the files appear in.

The one thing a good answer will not do is pad. A two-finding review of a two-file diff is a complete review, and a prompt that rewards volume gets volume.

The common failure

The review comes back full of improvements you did not ask for, you apply them because they sound reasonable, and the diff grows a layer of abstraction that nobody needed. Anthropic describes exactly this: ask a reviewer to find problems and it will always find something.

The fix is not a stronger adjective. It is a narrower question:

  • Name the failure class. What could go wrong at runtime is a question with a right answer; what do you think is not.
  • Say what to skip, in the words of the thing you do not want. skip style is two words and it works.
  • Require the input. A finding that cannot produce one is a hypothesis, and a hypothesis you have not asked to be labelled will be presented as fact.
  • Keep the reviewer out of the editor. Reviewing and fixing in one pass hides which change came from which finding.

There is a second failure worth knowing, in the opposite direction: a review that only agrees with you. That is why the version that runs in its own subagent, or in a fresh session, is better than the one in the conversation that wrote the code — it did not watch the reasoning that produced it and is not trying to be consistent with it.

Make it a one-word command

For the common case, type /code-review. It reviews the changes on your branch, reports correctness bugs in your conversation, takes a target after the command so you can point it at a pull request number, a branch, a path or a commit range, and takes --fix and --comment when you want the findings applied or posted. In a terminal session it runs as a background subagent, so the review does not fill your conversation.

When you want your own version every time, save the prompt as a skill: a procedure saved at .claude/skills/<name>/SKILL.md that you can run as /skill-name. Unlike a line in CLAUDE.md, a skill's body loads only when it is used, so a long review checklist costs almost nothing until the moment it runs.

The mechanics are on the skills guide, with worked files in the skills examples. If what you want instead is the conventions a review should check against, that belongs in a CLAUDE.md, which every session reads at the start.

How this page was written

Everything here about how Claude Code runs a review, what /code-review covers, and what Anthropic recommends asking for was read from Anthropic's Claude Code documentation on November 25, 2026, and every factual sentence is checked against the wording in the Sources below.

The prompt is ours. It follows the patterns Anthropic documents for a prompt that works, but it is an example written for this site, not a prompt Anthropic publishes, and this page does not claim it improves any particular codebase. Replace main with the name your repository uses for its base branch before you use it.

Sources

  • Anthropic's Review locally with /code-review, for what the command reviews, the background subagent, and the --fix and --comment flags, read November 25, 2026.
  • Anthropic's Best practices for Claude Code, for the note that a reviewer asked to find problems always finds something, the skip style wording, asking for evidence, the review-against-a-spec prompt, what subagents cost, and the reviewer with read-only tools, read November 25, 2026.
  • Anthropic's Prompt library, for the pattern of saying how you want the answer, read November 25, 2026.
  • Anthropic's Create custom subagents, for the tool limit and the note that a reviewer without Edit and Write can still write through Bash, read November 25, 2026.
  • Anthropic's Extend Claude with skills, for where a skill lives and when its body loads, read November 25, 2026.
  • Google's autocomplete suggestions for "claude code prompt for code review" and "claude code code review prompt", read November 25, 2026, for the queries this page answers.

Common questions

What is a good Claude Code prompt for code review?

One that names the diff, asks for runtime failures rather than style, requires the input that breaks each finding, and asks for the test command and its output. The prompt at the top of this page is an example you can copy and point at your own branch.

Should the reviewer be allowed to edit the code?

Not while it is reviewing. A reviewer that edits mixes finding and fixing in one pass, so you cannot tell which change came from which finding. Ask for the report, then say go. If you do want the fixes applied in the same pass, /code-review --fix is the documented way to do it.

Why does the review keep finding style problems?

Because a reviewer asked to find problems will always find something. Anthropic's guidance on its own review prompt is to say what to skip, and the words it uses are skip style. Without that line you end up with extra abstraction layers and tests for cases that cannot happen.

Does /code-review do the same job?

It covers the common case: your branch's changes, correctness bugs reported in your conversation, run in a background subagent in a terminal session, charged to your own session's usage. Write your own prompt when you want the review pointed at a spec, a specific risk, or a format you choose.

Can a subagent reviewer edit my files?

Only if it has a tool that can. Limiting it to Read, Grep, Glob is enforced by Claude Code rather than requested, but a reviewer that still has Bash can change files through it.

Your review runs in one session. You probably run more than one.

A review prompt runs inside one Claude Code session, and most of the friction is not the prompt — it is the fifth session you are keeping track of. Omniscio is a desktop app for running Claude Code and other coding agents side by side, with one list of sessions and one inbox, so an agent only interrupts you when a decision needs you.

The features page lists what is in it today, pricing covers the plans, and you can download it for Windows, macOS or Linux.