Pick a tool 8 min readUpdated 19 Oct 2026
How to Review AI-Generated Code (Even When You Work Alone)
How to review AI-generated code as a solo builder: checks to run first, what to read in the diff, a sample prompt, and how Anthropic's team does it.
To review AI-generated code, start with checks a machine can run and make the agent show you the output: tests, a build, a linter, and the main user flow working in the real app. Then have a second agent review the diff in a fresh session. Spend your own attention on the parts that are risky or hard to undo, like auth, payments, data deletion and deploy settings. Don't try to read every line of everything. That's the short version of the best practices for reviewing AI-generated code, and it's close to how Anthropic says its Claude Code team works, which we cover below.
Start with the checks you can actually run
If you're building alone, you're both the author and the reviewer. The most useful thing you can do is make "done" something you can check, not something the agent says. We cover how to set that up, including protecting test files and running an acceptance check on the live deploy, in our definition of done for AI coding agents. We won't repeat it here.
Two tools on our directory fit this step. Playwright MCP is Microsoft's open-source MCP server that lets a coding agent drive a browser, so the agent can click through a flow instead of describing it. Our QA Bot runs an acceptance checklist on the live deploy and reports pass or fail before you ship.
How to check AI-generated code by reading the diff
Once the checks pass, read the diff, meaning the list of changed lines, rather than the whole codebase. In our view, these questions catch most of what matters for a solo builder:
- Did it solve the problem I asked about? Compare the change with your original request. Agents sometimes fix a nearby problem, or the symptom instead of the cause.
- What did it touch that I didn't ask for? Unexpected edits to config, tests, dependencies or unrelated files deserve a closer look.
- Did any tests or checks get weaker? A deleted assertion or a skipped test can be what made things "pass."
- Is anything sensitive in the diff? Look for keys, tokens, open database rules or debug settings. Our vibe coding security checklist lists what to look for.
- Can I undo it? If you couldn't revert this change in a few minutes, slow down.
You don't need to understand every line of a docs fix. You do want to understand a change to sign-up, billing or data deletion.
A worked example: how Anthropic's Claude Code team reviews code
Anthropic published a detailed account of its own process in How the Claude Code team does code review (Oct 15, 2026, by Addy Osmani, Morgan Westlee Lunt and Qing Wang). It's a useful model of a code review process with AI because the team is writing code at high volume. The post repeats Anthropic's earlier statement that Claude writes about 90 percent of Claude Code's own code. It also says that from June to September, merged pull requests to Claude Code's codebase more than doubled, while the share that had to be reverted fell by more than 40 percent.
The post describes the review as layers, not a single gate:
- Checks before the pull request. Claude runs the tests, build and linter and shows the output instead of just saying it's done. Then a second agent reviews the diff in a fresh context.
- AI review on every pull request. An automated reviewer reads the diff against the whole repo and the PR's stated purpose. A PR can't merge while any finding is still open. The author either fixes it or closes the thread with a short reason.
- Security review on every pull request. A separate pass looks at security, and its open findings block the merge in the same way.
- Required CI. Lint, type checks, tests across platforms and a build. A failing check blocks the merge.
- Risk-based human approval. A classifier reads the change and sets how many people must approve it: none, one or two. The post says low-risk changes like docs can need no human approval once the automated checks are green, while some sensitive paths always need a person. An agent's approval never counts as a person's: automated review can clear a low-risk change, but it can't fill a slot that calls for a human. Whoever directed the agent counts as one of the required reviewers.
- Merge queue. Approved changes then go through a merge queue.
After the merge, the post describes feature flags, internal use first, staged releases and fast rollback. The team's norm is summed up in a short line: "you land it, you own it."
What to borrow from it as a solo builder
The post ends with advice for adopting the process. The parts that apply to one person with an agent are:
- Give the agent checks it can run, and list them in a short CLAUDE.md file. The post says every review loads this file, so the team keeps it short and points to other docs from there.
- Add three headings to your PR template: Testing, Risk and How to revert. The post says Claude can fill these in, but the person who asked for the change signs off. Working alone, that person is you.
- Cap review rounds. The post describes an agent author and an agent reviewer going back and forth for more than fifty rounds overnight on one PR. The team now caps it: after three rounds, the reviewer asks the author to step back and rethink the approach, and later passes look only at the new diff.
If you use Claude Code and want its built-in review features, our Claude Code tool page covers them. Other agents such as Codex and Cursor can do a fresh-session review too, if you give them the diff and clear instructions.
On GitHub, protected branches can require status checks to pass, pull request reviews and conversations to be resolved before merging. In our view, that's the closest thing a solo builder has to a merge that open findings can block.
An AI code review prompt you can adapt
This is our own example, written for this guide. We haven't tested it, so adjust it for your project. Run it in a fresh agent session that didn't write the code.
You are reviewing a diff you did not write. Do not edit any files.
Context: [one or two sentences on what the change is supposed to do]
Read the diff and the files it touches. Then report:
1. Does the change do what the context says? If not, what is missing?
2. Bugs or likely bugs. For each, give the file and line, and why.
3. Any edits to tests, config, dependencies, auth, payments or data
deletion, and whether each looks intended.
4. Any secrets, keys or debug settings in the diff.
5. How to revert this change.
Start with a count of findings. If there is nothing to fix, say so
plainly. Skip style comments unless they hide a bug.
A few points in it come from the Anthropic post: reviewing in a fresh context, asking for a file and line as evidence, starting with a count and saying so plainly when there's nothing to fix, and leaving out style nits. The rest is our suggestion.
Where you still decide
The Anthropic post says people moved from reading every diff to the decisions machines are bad at. Those are whether to build something at all, risky code, architecture others will copy, reading the evidence, and owning the outcome. For a solo builder, in our view, that last one is the whole job: the agent can write and review, but you're the one shipping it. Before launch, run through our pre-launch checklist for vibe-coded apps.
FAQ
Can I just ask the same agent to review its own code? It's better than nothing, but the Anthropic post describes a second agent reviewing the diff in a fresh context. In our view, a new session that didn't write the code is the safer default.
Do I need to read every line of AI-generated code? Not always. Match the effort to the risk. Read changes to auth, payments, data and deploy settings closely, and rely on checks for low-risk changes like copy edits.
What are AI code review best practices in one line? Machine-run checks first, a fresh-context review of the diff, human attention on risky paths, and an easy way to roll back.
How many review rounds should I allow? The Anthropic post says its team caps it at three rounds before asking the author to rethink the approach. In our view, that's a sensible starting point.
Does an AI approval count as a code review? In Anthropic's process, no: an agent's approval never replaces a required human approval.
Sources
All checked Oct 19, 2026.
- Anthropic, How the Claude Code team does code review (Oct 15, 2026): https://claude.dev/blog/solving-code-review-at-anthropic/
- GitHub Docs, About protected branches: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches
- Vibe Coders HQ, Playwright MCP: https://vibecodershq.com/tools/playwright-mcp
- Vibe Coders HQ, QA Bot: https://vibecodershq.com/bots/qa-bot