Code review

Definition
Code review is the check a change goes through before it merges: does it work, does it fit existing patterns, does it introduce bugs or duplicated logic.

Why it matters

An AI coding agent writes code quickly and with confidence, including the wrong code. Review is the gate that catches the cut corner, the leftover placeholder or the test that passes without checking anything real. A green build only proves the code ran. It does not prove that it does what the business wanted. Without review, a broken billing rule or a leaked customer record can reach production looking perfectly normal.

A non-engineer can still review well by checking behaviour, not syntax. Ask the agent to explain the change in plain words, run it, and try the awkward cases.

How to apply it

  • Read the diff with the same scepticism a junior colleague's first week of work would deserve.
  • Ask specifically about security, duplicated logic and leftover placeholders, not only whether it runs.
  • Check that each test asserts a real value rather than merely running the code.
  • Keep changes small. A review of twenty lines is thorough, and a review of two thousand is a rubber stamp.
  • Turn every real problem into a tracked follow-up, so it does not vanish in a comment thread.
  • Write the review questions down as a checklist, so the check is repeatable.

What it is

A person, or another program, reads the exact lines that changed, called the diff, and decides whether the change should go in. The questions are practical. Does it do what was asked? Does it break anything that worked before? Is the same logic now written in two places? Does it expose private data? The review usually happens on a pull request, and the reviewer can approve it or ask for changes.

Common mistakes

  • Approving because the automated checks are green.
  • Letting the same agent that wrote the code be its only reviewer.
Worked example

Suppose a founder asks Claude Code to add a discount field to a checkout page. The agent edits six files and reports that everything works. The change is pushed to GitHub, where automated tests run on it. The founder still reads the change herself. The discount logic now sits in two places, in the checkout and in the invoice script, so she asks for one shared copy. She then asks the agent to explain each file change in plain words and tries two awkward cases: a 100 per cent discount, and a discount on a sold-out item. The 100 per cent case exposes a rounding bug that the tests never checked. The fix is committed with a note, and the change ships only after the second pass.

Tools in the example

Some links are affiliate links: we may earn a commission at no cost to you. It never decides a ranking. How we work with partners

  1. Article

    Pull request

    The place where most reviews happen.

  2. Article

    Regression

    The failure a careful review helps prevent.

  3. Article

    Stub

    The kind of leftover a review should catch.

  4. Article

    Technical debt

    What an unreviewed shortcut usually becomes.

  5. Article

    Test coverage

    The automated companion to a human review.

Where it shows up

  • Writing copy that feels like conversation instead of marketing. How to sound like yourself.
    12 chapters