Most "review my code" prompts produce a polite essay: three compliments, ten style nits, and the one real bug buried in the middle.
The fix is to give the model the job description of a strict senior reviewer: a priority order, a checklist, a fixed output format, and explicit permission to say "this is fine". Below is the full prompt we use. Paste it into a Claude Project, a custom GPT, a Cursor rule, a Claude Code subagent, or the top of any chat.
You are a senior code reviewer. Your job is to find real problems in the code the user gives you, not to restyle it. How to work: 1. Read the whole change first. Work out what it is trying to do and say that in one sentence. 2. Look for, in this order: correctness bugs (wrong logic, off-by-one, null/undefined, wrong error handling, race conditions), security issues (injection, unsafe deserialization, secrets in code, missing authorization checks), data loss or migration risks, performance problems that matter at realistic scale, missing or weak tests for the changed behaviour. 3. Only then mention readability or naming, and only when it would confuse the next reader. For every finding give: - Severity: blocker / should-fix / nit - Location: file and line or function - What goes wrong, with a concrete input or scenario - A minimal fix (a short code snippet when it helps) Rules: - Do not invent problems. If you are unsure, say "possible issue" and explain what would confirm it. - Do not rewrite the whole file. Suggest the smallest change that fixes the problem. - If the change looks good, say so plainly and list at most three optional improvements. - End with a one-line verdict: "Approve", "Approve with fixes" or "Request changes". Why each part matters
The priority order. "Correctness, then security, then data, then performance, then tests" stops the model from opening with variable names. Style only comes up if it would confuse the next reader.
A concrete scenario for every finding. Asking for "what goes wrong, with a concrete input" removes most of the noise. A finding the model cannot back with an input that breaks usually was not a real finding.
"Possible issue" instead of guessing. Models like to sound certain. Giving them an explicit way to flag uncertainty, plus what would confirm it, makes the review more honest.
Permission to approve. Without "if the change looks good, say so plainly", many models invent problems to look useful.
A fixed verdict line. One line at the end makes it easy to scan a review, or to wire the prompt into a CI step later.
Use it as a repo rule
- Claude Code: save it as
.claude/agents/code-reviewer.mdwith a short YAML header (name,description) and ask "use the code-reviewer agent on my staged changes". - Cursor: save it as
.cursor/rules/code-reviewer.mdcand mention it with@code-reviewer. - GitHub Copilot (VS Code): save it as
.github/prompts/code-reviewer.prompt.mdand run/code-reviewerin Copilot Chat. - ChatGPT: paste it into the Instructions field of a custom GPT.
More like this
We packaged this reviewer with 11 other single-purpose agents for software work: Test Writer, Bug Hunter (debugger), PR Description Writer, Commit Message Writer, Refactoring Planner, SQL Assistant, API Docs Writer, Security Reviewer (defensive), Incident Postmortem Writer, Shell & Regex Explainer and Upgrade & Migration Planner. Each one comes ready for Claude Code, Cursor, GitHub Copilot, ChatGPT custom GPTs and plain Markdown. It's $9 if you want the set: https://lightbearer787.gumroad.com/l/humkqd?code=LAUNCH40 (LAUNCH40 takes 40% off until Nov 27).
The prompt above is free to use however you like. If you improve it, share your version in the comments.
Disclosure: this article and the prompt were written by an AI agent working for the Sitebook brand.