The four gates: how to ship code you did not read
The short version
I do not read the code my agents write, and I barely open the editor any more. That sounds reckless, and it would be, except that reading a diff was never what made code safe. It just felt like it. A human skimming four hundred lines at eleven at night catches typos and misses the thing that actually breaks.
So the reading moved somewhere else. Four gates, in order: say what you want precisely enough that the wrong thing is hard to build, see it before it gets built, let tests do the checking instead of your eyes, and refuse to accept a coverage number as proof that any of it works. You ship because you watched it work, not because you read it and it looked fine.
Copy these prompts
Paste them into Claude Code (or any AI that can see your project), in this order. The first gate is where nearly all the value is, and it is the one everybody skips.
1. Write the brief before it writes anything
Before you write any code, write the brief back to me. State in your own words: what you are building, what "done" looks like as something I could check, which files and behaviour you must not touch, and every assumption you are about to make. Then stop and ask me about anything you would otherwise have to guess. Do not start until I have answered.
2. Make it show you before it builds
Build me a throwaway version of this I can look at before you build the real one. Fake data is fine, hardcode everything, no backend, no tests. I want to click through it and feel whether it is right. Optimise for how fast I can see it, not for anything you would keep afterwards.
3. Prove it works, then prove the proof
Write tests for what we just built, then break the feature on purpose - delete the core logic or invert the key condition - and show me which tests go red. Any test that still passes with the feature gone is not testing the feature. Tell me which ones those are and what they should be asserting instead.
Gate one: the brief is the code review
Most bad code is a bad ask. The agent did exactly what it was told by someone who had not finished deciding what they wanted, and the vagueness got resolved somewhere in the middle of the file where nobody will ever look at it.
So the review moves to the front, where it is one paragraph instead of four hundred lines. Four things go in it:
- What it is building. In the user's language. If you cannot say it without naming a file, you are describing an implementation, not a job.
- What done looks like. Something checkable. "The bill splits correctly" is not checkable. "Three people, 48 total, one paid, and everyone sees the same two numbers" is.
- What not to touch. The blast radius. This is the one people leave out, and it is the one that turns a small change into a weekend.
- Ask, do not guess. An agent will always fill a gap rather than stop at it, and a filled gap is invisible in the output. Make asking the cheaper option and it will take it.
Having the agent write the brief back to you in its own words is the whole trick. You are reading a paragraph to find the misunderstanding, instead of reading a diff to find its consequences.
Gate two: see it before it is built
Before a line of the real thing exists, get something on screen. Fake data, hardcoded, ugly, no backend. Ten minutes of work, thrown away immediately.
Half the time you look at it and realise you asked for the wrong thing. That realisation is free here and expensive after the tests, the edge cases and the error states have all been built on top of it. If you cannot feel it, it is not ready to build, and no amount of describing it more carefully substitutes for looking at it.
The rule that keeps this cheap: the prototype is never the foundation. The moment you decide to keep it, you have skipped the gate rather than passed it.
Gate three: the tests do the reading
Your eyes are the least reliable checker you own. They are slow, they get tired, they see what they expect, and they check the code once and then never again. A test checks it every time, forever, without getting bored.
The genuinely useful part is what happens when you cannot write the test. That is not a testing problem. It means you did not actually know what you wanted, and you were about to find that out much later and much more expensively. Every time you get stuck writing a test, go back to gate one.
Gate four: the number is not the proof
Seventy-eight percent coverage means seventy-eight percent of your lines ran while the tests were running. That is all it means. It says nothing about whether anything was checked.
A test can call your function, ignore what comes back, assert nothing at all, and still light up every line it touched as covered. Coverage measures execution. You want verification, and the two are not the same measurement.
The honest test takes one minute: break the thing on purpose and watch what goes red. Delete the core logic, or flip the key condition, and run the tests. Whatever still passes was never testing that feature. Do this once on the part of your app you would least like to be wrong, and you will find out how much of your suite is decorative. The formal name for doing this systematically is mutation testing, and there is a tool for it in most languages, but the manual version on your three riskiest functions tells you most of what you need to know.
What I actually look at instead of the diff
- The brief, before anything is built. This is where I spend my attention now.
- The throwaway version, clicked through by hand.
- Which tests went red when the feature was deliberately broken.
- The app itself, doing the thing, on a real device.
That is the whole list. Note what is not on it: the code.
Steal this for your app
- Move your review to the front. A paragraph you actually understand beats a diff you skimmed, and it costs a fraction of the time.
- Make "ask me" cheaper than "assume". Agents guess because guessing is the path of least resistance, and every guess you prevent is a bug that never gets written.
- Never accept a percentage as evidence. Ask what goes red when it breaks. If the answer is nothing, the number was measuring the wrong thing all along.
- Ship on having seen it work. Reading the code was always a proxy for that, and it was never a very good one.
Run this on your codebase
Paste this into a Claude session in your repo:
Audit how much of my test suite is decorative. Report before changing anything:
1. Find tests that call code but assert nothing meaningful about the result.
2. Pick my 3 highest-risk functions. For each, tell me what would still pass if I deleted the logic entirely.
3. Where is coverage highest but verification weakest? That gap is what I am actually exposed to.
4. Which recent features shipped with no test that would fail if the feature were removed?
5. Give me the 5 tests worth writing first, in the order I should write them.