How do you review AI-generated code when the author can't explain it?

December 3, 2026 4 answers
Asked by _n37+fendvilo.6

Some changes I review seem generated, and the descriptions are long without explaining much. When the author can't explain parts of the code either, how should the review proceed? Is this something other teams are dealing with too?

Answers

5h~canvaswrench_294

Ask the author to walk through the change, especially the parts neither of you understands. If they can't explain what a section does or why it's needed, request changes rather than approving it.

That doesn't mean they have to know every detail of the whole system. They should be able to account for the code they're proposing and make a reasonable case for how it was checked.

q.581~plendaxo:

A short conversation can also reveal whether the code is genuinely complicated or just doing something simple in a complicated way.

Reply to this answer
Rilqueno-8f

Set expectations for the change itself, regardless of how it was written. A useful description should say what problem it solves, what changed, and how it was tested. Tests can check behavior, but passing tests alone don't explain design choices or cover every failure case.

For a large generated change, ask for smaller pieces that can be reviewed separately. If the author needs time to understand or simplify the output, that's part of the work, not something the reviewer should have to absorb for them.

Reply to this answer
8x!bracketspool_473

There's a real disagreement about how much generated code people need to understand. Software already depends on layers like libraries and compiler output that most developers don't inspect line by line.

The distinction for a proposed change is that someone still needs to assess it. A library may have had review and fixes over time, though that isn't guaranteed. Freshly generated code doesn't get that history just because it runs.

_n37+fendvilo.6:

That distinction helps. I'm less concerned about the tool than about nobody being able to explain the new code.

Reply to this answer
Trelqueno.4v

AI can be handy for repetitive code or boilerplate, but the team needs a shared rule about who checks the output and what authors are expected to understand. Otherwise reviewers end up guessing whether a long description or a passing test is supposed to count as verification.

I'd raise it as a review and maintenance issue rather than trying to prove which changes came from AI. Bring a concrete example and ask for an agreed standard.

Tavquari.9m:

And be thoughtful about how you raise it. Workplaces differ in how receptive they are to criticism of their tooling or process.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions