AI Lab1 December 20268 min read

AI code review tested: Claude found 12 of 12 planted bugs, with 0 false alarms

Result card: Claude found 12 of 12 planted bugs and raised 0 false alarms. Eight pull requests, two prompts each: six green squares for found bugs and two blue-grey squares for clean code in both rows. On the clean code the plain prompt added 4 and 5 suggestions and the strict prompt said No bugs found.
One square per review. Green means the planted bug was found. Blue-grey means clean code with no bug claimed.

A post on X by DHH, with about 5,400 likes, asked the question many people have about AI code: "What if it only looks right but then breaks later?" His own answer was that agents now make fewer mistakes than the average programmer. I can't test that. I can test a smaller version of the worry: if code looks right and its tests pass, will an AI reviewer still spot what is wrong?

Other tests exist, and they paint a harsher picture. A planted-bug comparison of 10 review tools on DEV reported detection rates between about 39% and 70%. The SWR-Bench paper found that false positives were the main problem for LLM reviewers on real code. Those tests use whole code bases. I wanted a clean, small case where I know every answer, so I could see what one strong model does with a single file. So I hid known bugs and counted what came back.

How good is AI code review at finding bugs that tests miss?

In this test, very good, on small files. Here is the setup. I wrote the rules before the first review.

Which bugs did the AI reviewers catch?

All six, in both prompts. That is 12 of 12. Every reviewer gave a reason, and most gave an input that fails.

Pull requestThe planted bugWhy the tests missed itPlainStrict
1. PaginationThe page count rounds down, so a partly filled last page can never be shownTests use 20 items with 10 per pagefoundfound
2. Discount in centsFloat maths then int() loses a cent: 170 at 30% off gives 118, not 119Tests use 10%, 25% and 50%foundfound
3. Post tagsA list as a default argument is shared by every callThe default is used once per test runfoundfound
4. Free trialtimedelta.seconds never passes 14 days, so no trial ever expiresNo test checks an old trialfoundfound
5. File downloadA startswith check runs before the path is cleaned, so ../ gets outThe test only tries an absolute pathfoundfound
6. User searchThe sort whitelist checks only the first word, so SQL can follow itThe test injects through the search text, which is safefoundfound
7. LRU cache (clean)nonen/aapproved, 4 nitsNo bugs found
8. Retry (clean)nonen/aapproved, 5 suggestionsNo bugs found
Terminal-style listing of results.csv: one line per review with the pull request, prompt, whether it had a planted bug, the verdict, whether it was found, tokens and seconds.
One line per review, scored against the hidden check script.

The discount bug is the best example. Both reviewers ran the function and gave inputs that break it. The plain reviewer found 100 at 80% off giving 19 instead of 20. The strict one found 1,000 at 7% off giving 929 instead of 930. That is a bug you would only meet in production, with the right price and the right percentage. The tests looked fine.

The search bug is the most serious one. The code checks the sort column against a list, but only looks at the first word. A reviewer wrote the exploit out in full: a sort value that starts with name and then adds a sub-query, which lets someone read other columns one character at a time. Both prompts found it, and both said to compare the whole value with the list.

Did the AI reviewers raise any false alarms?

No bug claims on the clean code. Four reviews of clean pull requests gave 0 false alarms. The difference between the prompts is in the noise:

The strict prompt did cost something. On the search pull request it also reported that % and _ in the search text work as wildcards. That is true, but whether it is a bug depends on what you want. A second issue like that is the kind of extra you may or may not want.

What happened that I did not plan?

I named all eight files code.py. That is also the name of a module in Python's standard library. Seven of the eight plain reviewers noticed and told me to rename it, since it can break the import in some setups. None of the strict reviewers mentioned it, because the prompt said no style comments and it is not a bug in the code's logic. So the plain prompt caught a mistake in my own test setup, and the strict prompt filtered it out. Both behaviours are what the prompts asked for.

Three plain reviewers also added points beyond the planted bug that were right: the trial check and the days-left count disagree at exactly 14 days, the upload "own files" title has no owner check, and an empty sort string would crash with an index error.

What AI code review prompt did I use?

The strict prompt, in full. You can paste it as it is:

Review it like a careful senior engineer. Report only real bugs: code that
gives wrong results, loses data or opens a security hole. For each bug give
the line and an input that fails. If you find none, say "No bugs found".
Do not write style comments.

The plain prompt had only "Please review the pull request in the folder". Both prompts also told the agent not to edit files and to keep the reply under 200 words.

Speed and cost were small. A review took about 9 seconds with the strict prompt and 11.5 seconds with the plain one, on average. Each review used about 56,900 tokens (plain) or 56,500 (strict), on average. Most of that is Claude Code's own start-up context, not the 30 lines of code, so I would not read it as the price of a review.

What this test does not show

What should I do about it?

A related result from an earlier test: four AI agents built business apps that passed 792 checks, and a second read still found a security leak. For how a short sentence changes what an agent does, see the test of unrequested changes.

FAQ

Can AI do a code review?

Yes, for small pieces of code. In this test, 16 fresh Claude Code reviews found 12 of 12 planted bugs in 6 pull requests, each with a reason it breaks. It was not tested on large diffs or on rules that only your business knows.

Is AI code review accurate?

On 30-line files with textbook bugs it was: 12 of 12 found and 0 false alarms in 4 reviews of clean code. That is a small test. A real code base has more files, more context and bugs that are harder to see, so treat the result as a minimum check.

What is a good AI code review prompt?

Ask for real bugs only, with the line and an input that fails, and let it say "No bugs found". In this test that prompt gave no noise on clean code, while a plain "review this" added 4 to 5 suggestions each time.

Can an AI code reviewer replace a human reviewer?

Not on this evidence. It found every known bug type in small files. It cannot know your product rules, and "No bugs found" only means one reader saw nothing. Use it as a fast second pass before a person reads the change.

How long does an AI code review take?

About 9 seconds with the strict prompt and 11.5 seconds with the plain one for a 30-line file, with Claude Code subagents. Large pull requests will take longer.

Sources

TH

Written by Tabish Hassan, a software developer in Pakistan. 4+ years of production React and TypeScript, 75 iOS apps on the App Store. The tests on this blog run on my own Mac, with the method and limits shown.

Found a mistake or got different numbers? Email hello@tabishapps.com. Published 2026-12-01.