Skip to content
AI Skill Index
CodingIntermediate

Reviewing code an AI wrote

It compiles, the tests pass, and it reads well. That combination is exactly why it needs a different kind of review.

Editorial·2 min read·
Sign in to save

Reviewing generated code is not harder than reviewing human code. It is differently distributed: the mistakes cluster somewhere else, and the usual signals that something is wrong are absent.

What is reliably fine

Syntax, idiom, formatting, obvious structure. Reviewing for those is wasted attention now. If your review process spends its energy there, it is defending against the failure mode that went away.

Where the defects actually live

Plausible-but-wrong specifics. A field name that should exist, an argument order that reads correctly, a config key that is almost the real one. Human errors here look like typos; generated ones look right.

The unstated requirement. Generated code satisfies what the prompt said. The constraint nobody wrote down — that this path is hot, that this table is huge, that this call is rate-limited — is not there and left no gap where it should have been.

Error paths. The happy path gets attention proportional to how much of the prompt described it. The failure path is often structurally present and semantically empty: a caught exception, a returned default, nothing that would tell you it happened.

Tests that assert the implementation. Generated tests can be written from the code rather than from the requirement, which means they pass and prove nothing. Read the test without the implementation in view: does it describe behaviour you actually want?

A review order that works

  1. Requirements first. Read the diff against what was asked, not against itself. Does anything here do something nobody requested?
  2. Then the boundaries. Empty, one, many, maximum, null, concurrent. This is where the density of defects is highest.
  3. Then the error paths. For each, ask what a caller learns when it fires.
  4. Then the tests — as evidence, not as reassurance.
  5. Style last, and briefly.

The trap

The code reads well, so review feels complete sooner. Fluent prose triggers the same feeling, and it is not evidence in either case.

A useful counter: before approving, name one input you have not seen tested that you believe would break it. If you cannot construct one, you have not looked at the boundaries yet.

Where it genuinely helps

Generated tests for your code — written from the requirement, not the implementation — are one of the better uses available. So is asking for the failing case rather than the review: "what input makes this wrong?" is a question with a checkable answer.

ShareXLinkedIn

Used in this tutorial

Skill

Code reviewer

Reviews a diff for defects, and refuses to pad the list with style opinions.

Tool

Claude Code

Anthropic's agentic coding tool for the terminal and IDE.

Tool

Cursor

An editor built around AI-assisted editing.

Cookies

We use only the cookies this site needs to work. Optional analytics helps us see which content is worth writing more of — nothing loads until you say yes.

Read the privacy policy