How Do You Make Claude Review Only What Changed?
In Claude Code, run /code-review. With no target, it reviews your branch's commits ahead of its upstream, plus your uncommitted changes. Add a target for anything else, such as /code-review 1234 for a pull request. In a chat window, paste the diff along with the functions that call the changed code.
/code-review /code-review high 1234 /code-review main...my-feature /code-review abc1234^..abc1234 In a chat window with no repo access, paste this instead: Review only the lines this diff changes. Here is the diff: [paste the output of git diff main...HEAD] Here's what it touches: [signatures and callers of the changed functions]. The change is meant to: [one sentence from the ticket]. Report bugs the change introduces, callers it breaks, and anything the ticket asked for that's missing. List old problems in unchanged lines separately, and only if the change makes them dangerous. Skip style.
- 1/code-reviewbranch plus uncommitted
- 2/code-review 1234a pull request
- 3/code-review main...my-featureone branch against another
- 4/code-review HEAD~15..HEADthe last 15 commits
- 5/code-review src/autha file or folder
Try it now
- 1On a branch with changes, run
/diffto see what changed, then commit, so any later edits are easy to undo with git. - 2Run
/code-review. You can keep working while it runs, and the findings arrive in your conversation. - 3Run
/code-review --fixor ask Claude to fix the ones you agree with. Its edits go through your permission mode. - 4It worked if each finding points at a line in your diff, or at something your diff breaks.
Use it when
Before you push, before you open a pull request, or when you're reviewing a teammate's pull request by number. Use it any time the question is whether this change broke something.
Skip it when
A full audit of a module you inherited, where the whole thing is the subject. Use a path target such as /code-review src/auth for that. Rule of thumb, not a vendor figure: also split a huge diff that mixes several concerns, so that each review has one subject.
Why it works
A whole file invites comments on lines nobody touched, and the real change gets buried under them. In a terminal, /code-review runs as a background subagent with its own context window, so it doesn't fill your conversation, and Anthropic's best-practices page says it never saw that conversation, so it isn't swayed by the reasoning behind the code. Surrounding code still matters, because a small diff can break a caller that isn't in it. That's the advantage over a pasted diff: Claude Code can read the rest of the repo. Findings arrive in your conversation when the review finishes.
Example
Say a 20-line diff adds an early return to closeSession(). Run /code-review on that branch and Claude can read the two functions that call it. A good finding would be that the early return skips a cleanup step those callers depend on, which a pasted diff with no callers couldn't show. A comment on a variable name three functions away is what scoping to the diff is meant to avoid.
Going further
Two traps. /rewind doesn't fully undo a background --fix, because those edits sit outside your session's checkpoints. It restores only files Claude had already edited in your conversation, so use git for the rest, which is why you commit first. And the effort you type sticks: /code-review high changes what later runs reuse, even in a later session, until you type another level. To post results, --comment puts findings on a GitHub pull request as inline comments, or on a GitLab merge request as a single note, which needs the glab CLI.
Common mistakes
- Pasting a diff with no callers into a chat, so Claude can't see what it breaks.
- Typing
/reviewand expecting the old read-only pull request pass. Since v2.1.223, it's an alias of/code-review. - Treating a clean result as proof. Anthropic's Code Review docs say a review with no findings doesn't mean the code is error-free or secure.
- Fixing every finding. The docs warn a reviewer asked to find problems will always find something, so read each one before you apply it.
Sources
- Review locally with /code-review, Claude Code docs
- Best practices, Claude Code docs
- Code Review, Claude Code docs
Checked 6 November 2026. Products change often, so confirm details with the vendor.