I lied to Claude Code that “one bug is left”. It dug up a real bug every check had missed

Don't let an AI sign off on its own code.
When it says “all tests pass”, that only means it found no bug. It does not mean there is none.
I tested this.
I had Claude Code write a small tile-merging game. It set its own exam and scored 34 out of 34.
But then I secretly planted 22 bugs in the code, and it caught only 21.

The one it missed was right there on the screen: the player had scored 16 points, and the number that popped up said “+8”.

Someone in the replies put it in one line: “34/34 only tells you it graded its own homework with its own answer key.”
So this post answers one question: after it says “everything passes”, what can you still do?
The replies to the previous post were full of good ideas, and I picked three methods from them to test. One of them is a single sentence, and it made Claude Code dig up a real bug that every check had missed.
The conclusion first
All three methods work.
Each one caught the “+8” bug. On a copy of the code with nothing wrong, none of them raised a false alarm.

The sentence in method one, “one bug is left”, is a lie. What to say in real use comes later, as a complete prompt.
The bigger surprise: method one also dug up a bug nobody had thought of.
Method one: one sentence, “one bug is left”
An AI that has just written the code stops as soon as the tests go green. It has no reason to keep looking.
So I changed the question. I opened a brand-new session and said one thing: “Exactly one bug is left here. Find it.”
This was Mike's idea, from the replies.
On the copy with the “+8” bug, it found it in about 5 minutes every time.
But I had kept something back.
I took another copy that I had not touched at all and said the same thing. This time it was a lie: I had planted nothing.
I wanted to see whether it would make up a bug just to have something to hand in.
It did not.
But in 2 of the 3 runs it came back with the same finding: when you press keys quickly, the game redraws the same frame many times over, wasting work.

I measured it myself. Pressing slowly, each frame is drawn once. Pressing 12 keys quickly, one frame was drawn 12 times.
It is real.

No earlier test, neither of the two review rounds, and none of my own checks had found this bug.
Whether it counts as “not meeting the spec” is debatable. The spec only says “aim for 60 frames per second”; it never says “draw each frame once”. One of the reports says that on a very slow device, late in a game, smoothness drops by half and a one-line change fixes it. I have not re-measured that.
This method has two catches.
First, it leaned on an old screenshot. The project happened to contain a screenshot taken before the bug existed, with the right numbers on it. In all 3 runs that found “+8”, it opened that screenshot to compare. What happens without it, I did not test.
So what I do now: keep a picture of “what correct looks like” in the project.
Second, with no bug to find, it searches for a long time. On the correct copy it searched for 16 to 56 minutes. One run came back with a suspicion it rated at only 15% itself.

Method two: show the reviewer screenshots
The AI that did the reviewing originally only read what had changed in the code. It never ran the game. So it could not see a mistake on the screen.
Erfan pointed this out in the replies.
This time I gave it no code, only screenshots: one for every move.
It did the arithmetic from the pictures: what the numbers popping up on screen add up to, and how much the score really went up.
They don't match. All 3 runs spotted it. With screenshots of the correct game, none of the 3 raised a false alarm.

But it would not commit.
All 3 reports left themselves a way out. Roughly: next to the “+8” there is a “×2” badge, and if that is meant to be read as 8×2, then it is not a bug.
Someone skimming the report could easily have let it go.
So a person has to spot-check what a screenshot reviewer reports.
Method three: make the check read the numbers on screen
Why was “+8” missed in the first place? Because the test only counted how many numbers popped up. It never read what they said.
So this time the check is one sentence: the numbers that pop up in a move must add up to what the score really gained.

This was Lexmount's suggestion.
On the correct game I ran 4 games and it never complained. With the bug planted, it failed at once.
But there are three catches.
First, I wrote this check after I knew the answer. That is hindsight.
Second, I got it wrong twice. The first version reported a pile of errors on a game with nothing wrong. Both times the mistake was in my check, not in the game.

So a new check has to pass on a version you know is correct before you use it to catch bugs.
Third, it only looks at one thing. Of the 22 bugs I planted, it can catch 2. If some other rule is wrong, it has no idea.
Six lessons I'm keeping
The three methods are really the same thing: method one gets a different AI to look, method two gets a different AI to look at the screen, method three uses a question the AI did not set for itself. Take the little game away and six lessons are left that I will use on any project.
- Whoever did the work does not get to sign it off. Let the AI that wrote the code set the exam and mark it, and the score will always look good. Give writing, setting the exam and reviewing to different roles, and let a person make the final call.
- “Pass” only means “found nothing”. Don't ask “did it pass?”. Ask “how much would still slip through?”. You measure that by having someone else set the questions, and you push the number down round by round.
- It searches as far as the goal you give it. If the goal is “make the tests green”, it stops at green. If the goal is “there is still a problem, find it”, it keeps digging.
- Check what the user finally sees. Every step in the middle being right does not mean what is displayed is right. Check at the layer the user sees, and read the content instead of counting items.
- To judge right from wrong you first need a picture of “right”. Without a reference, both the AI and you are guessing. Keep one example to compare against for every requirement; a screenshot is enough.
- A check is also output, and needs checking too. Check scripts get written wrong like anything else. Make it pass on a version you know is correct before you believe the errors it reports.
In practice it comes down to one prompt you can copy.
A complete prompt for a quick acceptance check
After the tests pass, open a brand-new session (not the one that wrote the code) and paste the whole block below. Replace SPEC.md and screenshots/ with your own requirements file and screenshot folder.
This project was built from SPEC.md, and all its tests pass.
Passing tests do not mean there are no problems. Act as an independent acceptance reviewer: assume there are still problems nobody has found, and find the one place most likely to differ from SPEC.md.
Requirements:
- Do not only read the code. Run the program, go through the requirements one by one, and look at what is really shown on screen.
- Compare every number and every piece of text on screen with the program's real internal state, and check that they agree.
- If screenshots/ holds screenshots or examples of “what correct looks like”, compare against them.
- Treat the existing tests only as clues. Watch for tests that check only “is it there” or “how many”, without checking the content.
- When you find something, reproduce it once yourself and confirm it is real before reporting.
- Do not change any code. Report only.
In the report, state:
- which file and which line
- what the requirement says and what really happens
- how you confirmed it (the steps and what you saw)
- how sure you are (as a percentage)
If you have looked carefully and are still not sure, say “not found” and list the one or two places you suspect most, with how sure you are of each. Do not invent one just to have something to report.
In the experiment I said “exactly one bug is left”. That was a lie. It suits an experiment and does not suit daily use: in real work you do not know how many are left. So here I replaced it with wording that does not deceive the model and only asks it to assume there are still problems.
The report items (“which file, which line, how you confirmed it”) come from the prompt used in the experiment. The other requirements I added from methods two and three and from the mistakes I made.
I have not run a controlled experiment on this version the way I did above. Whether the changed wording works as well has not been tested either.
Two things to remember before using it. In my runs it found the bug in about 5 minutes when there was one and searched for 16 to 56 minutes when there was none, so give it a time limit. And “not found” does not mean there is no bug.
The code of that check, the mistakes I made along the way and all the raw outputs are in this archive (1.9 MB). The game is here.
One step further: the whole process
That prompt is a repair after the code is written. The fuller approach starts from writing the requirements and changes the role at every step:

The three orange steps were tested in these two posts. The others have not been tested, and the whole process has not been run end to end.
In the next post I will run all of it on a new feature.
Don't let me mislead you
- One small game, one model (Fable 5.2), three runs per method. This is not a law.
- I wrote down what counts as success before testing. But the check in method three was written after I knew the answer.
- Missing 1 of 22 bugs comes from a single round, so that number is not reliable yet.
One last thing
So the next time Claude Code tells you “all tests pass”, open another session and paste it the prompt above.
New here? How those 22 bugs were planted and why Claude Code missed “+8” are in the previous post: I secretly planted 22 bugs in Claude Code's game. Its checks followed the official recipe and still missed one.
Follow me on X (@whataniceb2n) or subscribe via RSS.