Example result: Review a pull request diff before you merge
AI-generated example · PR Review
Updated

Review a pull request diff before you merge

This prompt reviews only what changed in a pull request, like a careful senior teammate. It flags bugs, security problems and missing tests with file and line, and skips the style nitpicks a linter would catch.

text-code-pr-diff-review — claude — 90 words

Act as a careful senior reviewer on my team.

What this PR is meant to do: [GOAL, e.g. add password reset by email]
Diff:
[PASTE git diff OR THE CHANGED FILES]

Review only what changed. Look for bugs, missed edge cases, security problems, breaking changes, missing tests and confusing names. List findings as blocking or non-blocking, each with the file and line, why it matters, and a suggested fix. If the PR does something it did not mean to do, call it out. Skip style nitpicks a linter would catch.

In Claude Code you can just say "review my staged changes" and it reads the diff itself.

Get a better result

What you will get

A review of only the changed code, listing blocking and non-blocking findings with file and line, why each matters and a suggested fix, and a note if the change does something unintended.

Common mistake

The review comments on style that a linter already checks.

Fix: Keep “skip style nitpicks”, and list your linter rules if they are unusual.

Also watch for
  • It misses problems that depend on code outside the diff. Include the functions the diff calls, or ask the AI to list the files it would want to see before approving.
  • Findings come with no severity or proof. Ask for an input or scenario that triggers each blocking issue, so you can reproduce it before you change anything.
Try a variation: ask for missing tests

Add “list the tests this change needs, as test names only”. Comparing that list with the tests in the PR shows the gaps quickly.

Still not right? Reply with this

Now list only the blocking issues, each with a failing scenario and the smallest change that fixes it.

Guides that use this prompt

More chat & writing prompts

See all 465 →