Reviewing Agent-Written Code
A fast, reliable review process for code you didn't type: tests first, diff reading strategies, and red flags to catch.
Coding agents can produce code faster than any human can read it. That flips the bottleneck: the scarce skill is no longer writing code, it's knowing whether code you didn't write is correct. Skip review and you'll ship bugs with excellent formatting. Review everything line by line and you lose most of the speed you gained.
This lesson gives you a middle path that's both fast and reliable. You'll learn to start from evidence (tests and checks) rather than reading, a diff-reading order that puts your attention where bugs hide, the specific red flags agent-written code tends to have, how to use a second agent as a reviewer, and how to turn every review into a better next session.
You own the code the agent writes
The agent doesn't get paged at 3 a.m., and it won't be in the meeting when a customer's data goes missing. Once you merge agent code, it's your code. That's not a reason to distrust agents; it's a reason to have a review process you actually trust.
Match review depth to risk. Not everything deserves the same scrutiny:
| What you're changing | Review depth |
|---|---|
| Throwaway script, prototype, personal tool | Run it, check the output, skim the diff |
| Internal tool or ordinary product feature | The full process in this lesson |
| Auth, payments, permissions, data deletion, migrations | Full process, line-by-line reading, and a second reviewer |