Reference · How-to · ~8 min

How to use AI for code review

Use AI as a **second pair of eyes** — not a merge approver.

Use AI as a **second pair of eyes** — not a merge approver.

Steps

1. Paste **one file or diff** at a time (or point Copilot/Cursor at the PR)

2. Ask for: bugs, edge cases, security, readability — **separately**

3. Ignore stylistic nitpicks you don't care about; fix real issues

4. **Run tests** — AI won't catch everything

5. Never paste **secrets** or production credentials

Copy-paste prompt

Review this code for:
1. Logic bugs and edge cases
2. Security issues (injection, auth, secrets)
3. One suggestion to simplify
Be specific — cite line numbers. If unsure, say so.

[paste diff]

Watch out

  • AI may suggest "fixes" that break behavior
  • It hallucinates APIs — verify against docs
  • Security findings need human confirmation
  • **Try the lessons:** `work-helper` · `spot-wrong-answers`