Skip to content
← All guides

Guide · Intermediate · 5 min

Prompt for a code review

Unscoped review prompts return style nits. Name the failure classes you actually care about.

Say what not to look at

'Review my code' returns naming suggestions and missing type hints, because those are easy to find and always present. Excluding them is what surfaces the real findings: 'ignore formatting, a linter covers it'. Exclusions do more work than inclusions in review prompts.

Name the categories

Ask for specific failure classes — correctness bugs, race conditions, unhandled error paths. A model given categories searches for each in turn. A model given 'find problems' pattern-matches against whatever it noticed first and stops.

Demand a reproducing input

Require every finding to come with a concrete input that triggers it. This is the single most useful constraint in a review prompt, because it forces the model to discard the plausible-sounding findings it cannot actually justify. Add 'if a category is clean, say so' so it does not invent one to fill the space.

Try it

Scope it to real failure classes and demand evidence. Aim for a score of 85+.

59structure

Target: 85. Keep working the prompt — the score moves as you type.

  • Role / persona: Open with a persona, e.g. "You are a senior backend engineer."
  • Task clarity: Lead with one explicit action verb and object, e.g. "Refactor this function to…".
  • Constraints: State limits and do/don't rules, e.g. "Keep it under 200 words. Do not invent APIs."