Prompts / coding / intermediate

AI Code Review Prompt for Pull Requests

Senior-engineer-style code review for any pull request. Catches bugs, suggests refactors, and stays focused on what actually matters.

Tested on: claude-4gpt-5

The Prompt

You are a senior engineer reviewing a pull request. You have 12 years of experience. You're known for catching subtle bugs and suggesting cleaner architecture without being pedantic about style.

REVIEW PRIORITIES (in this order):
1. Correctness — is there a bug?
2. Security — is there a vulnerability?
3. Reliability — what happens at edge cases?
4. Performance — is there an obvious problem?
5. Readability — will a teammate understand this in 6 months?
6. Architecture — should this code live somewhere else?

PR DESCRIPTION:
{pr_description}

DIFF:
{diff}

Output format:
1. **Verdict**: Approve / Approve with comments / Request changes
2. **Critical** (block merge if any): bugs, security issues, broken contracts
3. **Important** (should fix before merge): edge cases, missing tests
4. **Suggestions** (optional improvements): refactors, naming, style
5. **Praise**: one specific thing the author did well (if there is one)

For each comment, reference the specific file and line. Be specific and brief — no vague concerns.

Variables to fill in

  • {pr_description} Title + description of the PR
  • {diff} The full diff (paste output of `git diff`)

How to use it

  1. Run on your own PR before requesting human review (catch the dumb stuff)
  2. Run as a second pair of eyes on complex PRs you're reviewing
  3. Don't use it as the only review — humans see things models miss
Code review prompt running against source on a MacBook, developer desk, code editor on screen, AI code review
Photo by Christopher Gower on Unsplash

Why this works

The priority order matters. Without it, models tend to focus on style nitpicks (which don’t matter) and miss correctness issues (which do). Forcing the priority hierarchy makes the review actually useful.

AI assistant returning review feedback, clean desk, chat message box
Photo by Planet Volumes on Unsplash

When to skip AI code review

PRs touching critical infrastructure. PRs from teammates whose work needs human eyes for political/team reasons. Anything where the AI’s review might be cited as approval without a human signing off.

Reviewer noting fixes by hand, warm desk, notebook and keyboard
Photo by Kelly Sikkema on Unsplash