AI Code Review Is Polite, Fast and Confidently Wrong About Context
The same refactor PR took a colleague three days to review; an AI produced line-by-line notes in ten seconds, politely. Two weeks in, the division of labour was clearly wrong: AI is strong on local correctness and weak on architecture and intent. Six practices for using it properly, plus a human/AI split table.
📜 Table of Contents
- 1. Where it is strong, where it is not
- 2. Method 1: feed the diff, not the repo
- 3. Method 2: three passes, one dimension each
- 4. Method 3: make it restate intent first
- 5. Method 4: ban vague advice
- 6. Method 5: write the baseline down
- 7. Method 6: split the work
- 8. Tooling
- 9. What actually worried me
- FAQ
- Related
📖 Keep reading
AI code review is polite, fast, and confidently blind to context
I opened a refactor PR touching seventeen files. A colleague got to it three days later with a blunt comment: "this abstraction has no reason to exist."
I fed the same diff to an AI. Ten seconds, line by line, and it caught two null-path bugs I had missed. The phrasing: "if user is None, the attribute access on line 42 raises; add a guard or a default."
Three more PRs gave the same pattern: faster, more thorough on branches, gentler.
What worried me came later — the division of labour was wrong.
1. Where it is strong, where it is not
| Dimension | AI | Note |
|---|---|---|
| Style, naming | strong | stable when rules are explicit |
| Null, bounds, exception paths | strong | scans every branch |
| Obvious security issues | strong | pattern matching |
| Test coverage gaps | good | lists untested branches |
| Is this abstraction needed | weak | needs history across modules |
| Should we add this dependency | weak | lacks org and ops context |
| Does it match product intent | weak | nobody told it the intent |
| Will this be debt in three months | weakest | sees only today's version |
AI reviews whether the code is correct; humans review whether the code should exist.
2. Method 1: feed the diff, not the repo
A review pack has four parts:
- One-line intent of the change
- Full unified diff with 3 lines of context
- Signatures of called functions and implemented interfaces
- Team rules, at most ten lines
Part 3 matters: without the callee's contract the model guesses, and guesses confidently.
3. Method 2: three passes, one dimension each
Correctness: only defects that break runtime — nulls, bounds, unhandled exceptions, races, leaks. File:line, trigger condition, consequence, minimal fix. No style.
Architecture: given a module-responsibility note, flag redundant abstractions, cycles, business logic in the wrong layer. Output design decisions, not code restatement.
Security and ops: secrets in code or logs, unvalidated input, new external dependencies, changes that break monitoring.
Pass one is machine-verifiable (run the tests). Pass two produces a candidate list for humans, not conclusions.
4. Method 3: make it restate intent first
First, in three sentences, describe what this PR does and how it assumes
callers will use it. If the information is insufficient, say what you need.
Then review.
The dangerous failure is not a missed bug — it is a plausible recommendation built on a wrong reading. The restatement exposes that immediately.
5. Method 4: ban vague advice
Require, for every finding: a reproducible trigger, a minimal fix under ten lines, and a [preference] tag for anything that is taste. Volume halves; usefulness rises.
6. Method 5: write the baseline down
- All external input validated before business logic
- DB access only in the repository layer
- New dependencies need size and licence noted in the PR
- Type hints on public functions
- No swallowed exceptions
Writing the baseline also exposes where the team never actually agreed.
7. Method 6: split the work
| Stage | Who | Why |
|---|---|---|
| Style, format | AI | rules are explicit |
| Defect scan | AI first, human reviews blockers | humans tire, models do not |
| Coverage gaps | AI lists | mechanical |
| Abstraction needed? | human | cross-module, cross-time |
| New dependency? | human | size, licence, ops cost |
| Merge | human | accountability |
| Written conclusion | human, AI summarizes | must be signed |
The only hard rule: the approve comes from a person. AI output is review material, not a review verdict.
8. Tooling
| Option | Fits | Trade-off |
|---|---|---|
| Built-in platform review (e.g. Copilot PR review) | already on that platform | lowest setup, limited custom rules |
| Bots (CodeRabbit, Qodo Merge) | teams of 5+ | summaries and line notes; free tiers change, check each site |
| Self-built CI script calling an API | custom rules or privacy needs | full control, prompt holds the baseline |
For self-built, decide the compliance question first: proprietary code either stays local on an open model, or only a de-identified summary leaves.
9. What actually worried me
Not replacement. The risk is a flow that looks reviewed: PR → AI comments → author fixes → merge. Every step leaves a record, and the thing that mattered is gone — two people arguing for half an hour about whether the abstraction earns its place.
That half hour produces no code. It produces three months of design consistency.
So I use AI review before submitting, to clear mechanical issues, then take a clean diff to a human for the part worth discussing. Less human time, better discussion.
FAQ
False positive rate? Low for defects and style; high for architecture, where recommendations ignore project history. Treat those as a discussion list.
Is sending company code to an API allowed? Depends on contract and data terms. Check training-data clauses, and use local models or de-identified summaries for sensitive work.
Will the team lose review skill? Reading diffs for null checks, no. Judging design, yes. Keep the human-only questions explicitly human.
Worth a bot for two people? Not yet. Paste the diff into a chat model. Bots pay off when rules must be enforced consistently.
Free tiers and pricing change; check each vendor's site.
Related
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.