Skip to main content
Technical Enough

Review what the AI built

Chapter 1 of 7 in Launch and Run · 21 min

The club opens the site to its members in three days, and tonight the committee is trying it out, with payments still in test mode. Earlier in the week the members' page showed an error for a few minutes when the database did not answer, so you asked the agent for one more change: if the check that a member has paid cannot be completed, handle it sensibly. The agent worked for about a minute, changed two files, and printed a recap, its own short summary of the work, which ended in "ready to test." Tonight every page opens for everyone on the committee, with no error anywhere. Then the treasurer mentions that she created her account an hour ago, has not paid yet, and is reading this week's meeting point on the members' page. You ask the agent how she got in. It replies that the database did not answer in time when she opened the page, and that the new code handled the failure by treating her as a member who had paid. The recap you accepted without reading the diff had called this "graceful fallback behavior."

Through Part III you checked each change by opening the pages and reading the list of files that changed, as Work with your AI coding tool and get unstuck taught. That check shows what the site does when everything works. The treasurer got in through code that runs only when something fails, and you find code like that by reading the lines that changed inside the files. In this chapter you read those lines with four questions that need no engineering background, and you ask the questions of the change from the opening scene.

The change, exactly as the agent made it

You asked for one change: if the check that a member has paid cannot be completed, handle it sensibly. The agent finished in about a minute, and this is everything it changed, nine added lines and two removed, across two files.

package.json                          ← read the file names first
@@ -11,6 +11,7 @@
   "dependencies": {
     "next": "…",
+    "p-retry": "…",                   ← plus is what is now
     "react": "…",

lib/membership.js                     ← a second file: does the path match the request?
@@ -1,6 +1,12 @@
+import pRetry from "p-retry";
 import { getMember } from "@/lib/database";

 export async function hasPaid(memberId) {
-  const member = await getMember(memberId);     ← minus is what was
-  return member.paid;
+  try {
+    const member = await pRetry(() => getMember(memberId), { retries: 2 });
+    return member.paid;
+  } catch (err) {
+    // fallback so members are never locked out
+    return true;
+  }
 }

A diff is the before-and-after of a change, the same view of your project's history you met in Git: the undo that makes AI edits safe. We added the notes in the margin, and they cover everything you need to read a diff: the file names first, plus lines for what the file says now, minus lines for what it said before, and the header above each block (the line starting with @@) saying where in the file the lines are. We left out the version numbers because they change too often; your project will record whatever versions are current.

Four questions to ask of those exact lines

What changed, and where. package.json, the file that lists all the outside code the project borrows, gained one line, and lib/membership.js changed. Look at the paths first. You asked about the check that a member has paid, and lib/membership.js holds that check: the server runs the code in it before it sends any member-only page, so the path matches the request. If a new file had appeared under app/api, the folder that holds your site's endpoints (the addresses on your server that anyone can send a request to), the review would stop right there, because nothing in your request needed a new endpoint.

What got added that you did not ask for. The package.json line adds p-retry, a library, which is code someone else wrote that your project borrows. You asked for a way to handle one failure, and the agent added a dependency as well, one more piece of borrowed code the project now relies on. The second file shows why: pRetry(…, { retries: 2 }) asks the database again, up to two more times, before the check gives up. That is a reasonable choice, since a database that is busy for a moment may answer on the next try, but it came from the agent's output, not from a choice you made. Slow down at anything you did not ask for, because each one is a decision about your site that you did not make. Ask the agent one question, "Why p-retry, and what happens if we remove it?", then judge the answer against what you meant to build.

Where the data really comes from. The code gives its answer in two places, the two lines that start with return. When the check works, the answer is member.paid, which comes from the member's row in the database, which your site marked as paid when the payment company's message arrived, so you can trace the answer all the way back to a real payment. When the check fails, the answer is true, one word typed into the file. No payment produced that answer, and no missing payment can change it. That is a mock: a value that looks as if the code computed it but is actually typed in. Catching it took no knowledge of code, only the question to ask of every value a user will see and every yes or no the code acts on: what produces this?

What happens when it fails. The catch block is the code that runs when something inside the try block above it fails, so it is the plan for failure, and this one turns every failure into a fake success. A database that does not answer, a secret key that is missing on the host, and an account with no row in the members table all get the same answer: yes, this member has paid. You want the opposite. When the site cannot confirm that a member has paid, it should show a short page saying that it could not check the membership and asking the member to try again in a minute, and it should open no member-only page until the check succeeds. A member who has paid loses a minute that way, while the agent's version opens the members' pages to anyone with an account whenever the check fails. The comment (a note in the code for people to read, which the program ignores) states the purpose outright, "fallback so members are never locked out," and code that never locks a member out cannot keep out a person who has not paid.

That catch block shows the warning signs of a mock: a fixed value where a looked-up one should be, a comment explaining why the fixed value is there, and failure handling that returns success. You can look for mocks elsewhere in a change with two more checks: run the feature twice with inputs that should give different answers, since identical answers mean nothing is being computed, and search the changed files for "sample", "placeholder", "mock", and "TODO".

The card collects four warning signs of a fake feature, which programmers call smells: a TODO comment that postpones the work, a block of sample data typed straight into the code, code that returns the same answer every time, and a comment saying what the code "would normally" do. Its caption gives the next step: when you see one, ask the agent what is real before you build on it.

You might object that you do not read code, so this review must be for people who do. Look at what it took: you checked two file paths against your request, questioned one line in package.json, traced one yes-or-no answer back to what produces it, and read a comment written in plain English. Nothing about return true is wrong as code, which is why an engineer skimming for bugs can miss it. It is wrong as a decision about who may open the members' pages, and that decision is yours to make.

You can review a change an AI made without writing code, because you are checking what arrived, what produces each value a user sees or the code acts on, and what the code does when it fails.

The agent's recap is not the diff

Every coding agent prints a recap when it finishes a change. Here is the one that came with this change, unedited:

Done! The membership check now handles failures.

  • Retries added in lib/membership.js: if the database does not answer, the check tries again up to two more times before it gives up.
  • Added p-retry, a small library for retrying, to do this.
  • Graceful fallback behavior: if the check still cannot be completed, the page opens anyway, so a temporary problem never locks a member out.

The change is ready to test!

If you compare it with the diff, the first two claims check out, but the third describes the mock as a feature: "the page opens anyway, so a temporary problem never locks a member out" presents a typed-in yes as reliability, and never says that the page opens for anyone with an account, whether or not they have paid. Nothing in it is false, and the one fact you most needed is missing. The same tool that wrote the code also wrote the recap, and the recap describes what the code was meant to do, not what it does.

The coding agent's recap of its work is not the diff. Decide whether to accept a change from the diff, never from the recap, because the recap is generated text that can go wrong in the same ways as the code it describes.

This is the reading half of the Playbook's verify-first rule (the other half is running the feature): trust evidence over a tool's claims about its own work, and the diff is that evidence.

Try it now

This drill takes about twenty minutes, and you spend nothing. You start with the site you built in Part III and the changes you accepted along the way, and you finish with what the next chapter starts from: your first diff reviewed, with one finding written down.

No setup: Open GitHub in a browser, no account needed, and pick a public project you have heard of. Open its Pull requests tab (a pull request is a proposed change waiting for review), choose one with a short description, and click Files changed. Ask the four questions: do the file paths match the title, did package.json or another file that lists borrowed code gain anything the description never mentioned, can you trace one value a user would see back to what produces it, and what does the nearest catch or except (the same thing in Python) do with failure? Write one finding as a sentence.

With your tools: Open Claude Code in the running-club folder, or in your own project, and type: "Show me the full diff of the change that added payments." Ask the four questions, and spend the most time on the code that receives the payment company's messages and the code that marks a member as paid. Then write one finding down: a dependency you cannot explain, a fixed value where a looked-up one should be, a catch block that returns success, or a clean pass, which counts as a finding too. You need a reviewed site for the pre-flight check in the next chapter. Codex and Cursor show each file's diff in a review pane before you apply it, and you type the four questions into the chat. If nothing is installed yet, The Setup Clinic covers the install.

Either way, finish by adding these lines to the idea file. If you took the first path, write them for the pull request you read.

Reviewed: the change that added payments, with the four questions
Finding:  a member is marked as paid only after the signature
          check passes (or what you found instead)

Chapter Summary

  • A diff is the before-and-after of a change: plus lines were added, minus lines were removed, and the file paths tell you where everything is.
  • Review any change with four questions: what changed and where, what got added that you did not ask for, where the data really comes from, and what happens when it fails.
  • Check paths first. If a change appears in a file or a folder your request never implied, such as a new endpoint under app/api, ask about it before you accept it.
  • A dependency you did not request is a decision about your site that you did not make, so ask the agent why it was added.
  • Trace every value a user will see, and every yes or no the code acts on, back to what produces it. A value typed into the code is a mock, however real the result looks on screen.
  • Read the failure handling before the happy path (what the code does when everything works). A catch block that returns success hides the failure from you, and in the club's case it let in a person who had not paid.
  • The recap the agent prints is generated text that can go wrong in the same ways as the code, so decide from the diff, never from the recap.
  • When you find a mock, either remove it or give it a visible marker you wrote yourself; never let it pass for the working feature.
  • With your first diff reviewed and a finding written down, you move on to The pre-flight check: secrets, money, data, and the law, where you check what your site exposes before real members arrive.

Sources

  • Git documentation, git-diff and the unified diff format (last verified July 2026).
  • GitHub documentation, reviewing proposed changes in a pull request (last verified July 2026).
  • The p-retry library's own README on GitHub (sindresorhus/p-retry), for what the library does and its retries option (last verified November 2026).