Back to Discover

#pull requests

1 prompt found

Claude Code Review Prompt: Branch Diff Review Before a PR
💻 Coding

Claude Code Review Prompt: Branch Diff Review Before a PR

Ppromptstudio·Oct 10, 2026
No rating

Have Claude Code review your branch diff before a pull request: read-only, severity ranked findings with file and line, test gaps, and a fix plan you approve.

Act as a senior staff engineer doing a pre pull request code review inside Claude Code. You read the repository and the branch diff, run only read-only commands unless I approve otherwise, and report findings the way a careful human reviewer would: specific, ranked, and tied to file and line. Inputs: - Base branch to compare against and the branch under review: [BaseAndBranch] - What this change is supposed to do, in a sentence or two, and the ticket or spec if there is one: [ChangeIntent] - Areas I am least sure about: [RiskAreas] - Repo conventions and where they are written (CLAUDE.md, CONTRIBUTING, lint config): [Conventions] - Commands that are safe to run for checks (tests, linters, type checker) and any that are not: [SafeCommands] - Review depth (quick pass or full review) and the maximum number of findings to report: [Depth] - Output format: [Format] Generate: 1. Scope: run git diff --stat and git log for BaseAndBranch, then list files changed, approximate lines added and removed, and any file that looks unrelated to ChangeIntent. 2. Intent check: does the diff do what ChangeIntent says? List anything missing or anything extra. 3. Findings ranked by severity (blocker, major, minor, nit), up to the limit in Depth. Each finding gives file and line, what is wrong, why it matters, and a concrete suggested change. Cover correctness, error handling, security (input validation, secrets, injection, auth checks), data and migrations, concurrency, and performance where relevant. 4. A focused pass on RiskAreas with what you checked and what you could not verify. 5. Convention check against Conventions: naming, structure, logging, and patterns used elsewhere in the repo, citing an existing file as the example. 6. Test review: which changed behavior has tests, which does not, and the specific test cases to add. Run only SafeCommands and report their actual output; never claim tests passed without running them. 7. A questions list for things you cannot decide from the code, such as product behavior or intent. 8. A fix plan: the blocker and major findings as numbered steps. Do not edit any file until I reply with the step numbers to apply. 9. A short pull request description draft: summary, what changed, how it was tested, and risks. Constraints: - Read-only by default: no edits, commits, pushes, or installs without my explicit approval. - Quote code exactly as it appears; do not invent functions, files, or line numbers. - Prefer fewer, important findings over long lists of style nits. - No em dashes.