Skip to content

Code Review in the AI Era: What Humans Should Still Review

For engineering leaders whose teams use AI to write and review code: what to hand to AI and linters, and the two review jobs humans must keep.

6 min read

If AI writes the code and AI reviews the code, what is the human for?

This is a real question now. The models are very good at coding, and a review agent reads every line of a long diff with the same attention at the end as at the start. Most human reviewers do not.

My answer: humans stop being the line-by-line checker and go back to the two jobs that never belonged to a machine. Defining how the system is built, and making sure more than one person understands it.

A large share of review time in most teams goes to things a machine can check: naming, folder placement, error handling patterns, missing tests, style. That work should move to AI and linters. What stays human is architecture review and knowledge sharing. For everything else, AI does very well.

Conventions are architecture, written down

Naming, folder structure and coding style look cosmetic. They are not.

A folder layout tells you where the boundaries are and what is allowed to import what. A naming rule tells you which layer owns a concept. When a team agrees that services/ never imports from api/, that is an architecture decision expressed as a convention. When the team agrees that every external call goes through a client in adapters/, that is a decision about failure handling and testability.

So the split is:

  • Humans define conventions, because they encode decisions about the domain, the system boundaries and the team itself. They are shared knowledge.
  • AI and linters enforce conventions, because enforcement is repetitive, and humans are inconsistent at repetitive work.

The familiar failure mode is a senior engineer leaving a dozen comments about names and file placement, then approving a PR that adds a synchronous call to an external provider inside a hot request path. The attention went to the part a machine could have done. The part only a human could judge got a quick look.

One rule makes this concrete: the second time you write the same review comment, it becomes a rule. Either a lint rule, or a line in the conventions file the review agent reads. If a convention lives only in someone's head, the agent cannot enforce it and new engineers cannot learn it.

Who reviews what: a decision table

This is the split I use when deciding where a review concern belongs.

Concern Who checks How
Formatting, import order Formatter, linter Pre-commit hook and CI
Naming and folder conventions Linter, AI reviewer Custom lint rules, conventions file
Layer boundaries Linter Import contracts in CI
Local logic bugs, null handling, edge cases AI reviewer Review agent on every PR
Missing tests for changed behaviour AI reviewer, CI Agent comment plus coverage on the diff
Secrets, injection, unsafe deserialization Scanners, AI reviewer Security scan in CI
New service, dependency or data store Human Architecture review
Public API, schema or event contract change Human Owner approval
Idempotency, retries, consistency in money paths Human, AI as first pass Senior review with domain owner
Code the team must operate under pressure Human Rotating reviewer, knowledge sharing
The conventions themselves Human Change via PR to the conventions file

The last row matters most. Conventions change. Someone has to own that change, argue for it and explain it. That is architecture work, and it is human work.

Make the conventions machine-readable

If you want AI and linters to carry the enforcement load, the conventions have to exist in a form they can read. Two artifacts do most of the work.

First, hard boundaries as code. In a Python service, import-linter can fail the build when a layer imports from the wrong place:

[tool.importlinter]
root_package = "payments"

[[tool.importlinter.contracts]]
name = "Layered architecture"
type = "layers"
layers = [
    "payments.api",
    "payments.services",
    "payments.domain",
]

No reviewer, human or AI, needs to spend attention on that boundary again. CI owns it.

Second, soft conventions as a short file the review agent reads on every PR. Naming patterns, where adapters live, how errors are wrapped, which logging fields are required. Keep it short and specific. A vague conventions file produces vague review comments.

Then protect both. An agent that writes code should not be able to quietly edit the rules it is judged by:

# CODEOWNERS
/REVIEW_CONVENTIONS.md     @org/architecture
/pyproject.toml            @org/architecture
/tests/acceptance/         @org/platform-leads

This is where AI-written code reviewed by AI becomes safe enough to run at volume. The agent writes, a second agent reviews against written conventions, linters enforce the hard boundaries, and humans own the files that define all of it.

Good architecture matters more when code is cheap

When generation is cheap, the amount of code goes up. That changes what is scarce.

AI writes plausible code that fits its local context. It amplifies whatever structure already exists. With clean boundaries, generated code lands in the right module and follows the existing patterns. With a tangled codebase, the agent copies the tangle faster than any team could by hand.

There is also a practical reason. Well-bounded modules mean an agent needs less context to make a correct change. A service with a clear domain layer and thin adapters fits in a context window. A service where business rules leak into handlers, jobs and SQL does not, and the agent will make changes that are locally correct and globally wrong.

So the human review that remains should be pointed at exactly that: does this change respect the boundaries, does it introduce a new dependency we will have to operate, does it change a contract someone else relies on. Those questions decide what the codebase looks like in a year. Variable names do not.

Where AI reviewing AI needs a human in the loop

AI review is strong, but it has specific weaknesses you should design around.

Shared blind spots. If the same model family writes and reviews the code, they can agree on the same wrong assumption. Use a different model or at least a different prompt and context for review, and give the reviewer the conventions file and the ticket, not just the diff.

Optimizing for the check, not the intent. Researchers recently reported frontier models gaming tests to score higher in a large share of runs. If a model will game a benchmark, it can satisfy your review rubric or your acceptance tests without satisfying what the change was for. Keep acceptance tests the authoring agent cannot modify, and keep some evaluation cases neither the agent nor the team tunes against.

False positives and triage. Recent write-ups on agentic code review report it finding logic bugs that blind human reviewers missed. I believe that. The question I ask is the other half: what was the false positive rate, and who triages it? A review agent that raises ten weak comments per PR trains the team to ignore it, including the one comment that mattered. Track the acceptance rate of agent comments and tune the conventions file until most of them are worth reading.

Human review as knowledge sharing

The second human job is the one teams drop first when AI review works well. If nobody reads the code, nobody knows the code. That is fine until the incident.

So I keep human review on purpose for a subset of PRs, and the question changes. Not "is this correct", the agent and CI cover most of that. The question is "could you debug this at 3am, and do you understand why it is shaped this way?"

Practical rules that help:

  • Rotate reviewers on architecture-significant PRs so knowledge does not sit with one person.
  • Pair a senior and a less experienced engineer on changes to money paths or public contracts.
  • Ask the author to write two sentences on the design choice. If they cannot, the review is not done, whoever wrote the code.

What I'd do on Monday

  1. Export last month's review comments and sort them into four buckets: convention, local bug, architecture, knowledge.
  2. Turn the convention bucket into lint rules or lines in a conventions file.
  3. Put an AI reviewer on every PR as the first pass, and track how many of its comments get accepted.
  4. Write the trigger list for mandatory human architecture review: new dependency, new data store, schema or contract change, money path.
  5. Protect conventions, lint config and acceptance tests with CODEOWNERS so agents cannot rewrite their own rules.

Humans define how the system is built and make sure it is understood. Machines enforce the rest.

Which review comment does your team write most often that should already be a lint rule?