← Back to Blog

How to Review Code When AI Writes Most of It

Code Review Spec Driven Best Practices

You cannot read every line anymore. You also cannot ship code nobody has checked. The answer is to decide how much to review, and to agree on that as a team. This post gives a simple way to do that.

1. The Big Idea

Code review is not "read everything" or "read nothing". It is a dial. How far you turn it depends on how much damage a change can do.

2. Start with the Spec, Not the Code

The best moment for a human review is before any code exists.

This is the core of Spec Driven Development. If you want the full picture, read Part 1: The Three Problems and Part 2: The Framework.

3. Match Review Depth to Risk

Think of your codebase as a tree.

To decide, ask three questions:

  1. What must not change for the user?
  2. How bad is it if this goes wrong?
  3. Can we undo it quickly?

Changes you can undo easily need less review. Changes you cannot undo, like data migrations, emails, and payments, always need a careful one.

4. Ask for Proof, Not Just Code

A pull request should show that the change works. Ask for:

When the proof is good, you can read less code and still trust the result. Watch out for tests that only repeat the implementation. They always pass and tell you nothing.

Proof is also part of the bigger system around the model. See Harness Engineering for how constraints and feedback loops make AI output reliable.

5. Keep Changes Small

Small pull requests are easier to judge, faster to review, and simpler to roll back. A huge diff makes every review shallow. If a change is big, split it.

6. Let Tools Handle the Small Stuff

Style, formatting, types, and common bugs should be caught by linters, type checkers, and CI. People should spend their time on design, logic, and risk. Do not argue about nits that a tool can fix.

7. Use AI as a Second Reviewer

8. Ship Behind a Gate

Put new features behind a flag, even a simple on/off switch.

Before the rollout, decide what you will watch (errors, speed, key metrics) and what result means "roll back".

9. Merge-Ready Is Not Launch-Ready

Getting code to work is about 80% of the job. The last 20% takes just as long:

This part needs human care and taste.

10. Make It a Team Agreement

None of this works if it lives in one person's head. Write it down:

Whoever opens the PR must be able to explain the change in their own words. If they cannot, it is not ready, no matter who or what wrote it. Keeping these rules in the repo is what Building an Engineering Memory is about.

11. Learn from What Happens

Track bugs and rollbacks, and note where they came from. If AI-written changes in some area stay safe, you can review them more lightly. If they do not, review them more closely. Let evidence set the dial, not gut feeling.

12. Quick Checklist

The goal has not changed: ship good software safely. AI makes writing code fast, so the work moves to the human side. Agree on what to build, check the risk, ask for proof, and take ownership of what goes out.

13. Read More