AI Code Review Caught Something My Senior Developer Missed

Last month an AI code review tool flagged a line in a pull request that three human reviewers had already approved. It was a small function, maybe fifteen lines, and it handled refunds for cancelled orders. The model pointed out that the function checked the order status before it checked whether the refund had already been issued, which meant a duplicate refund was possible if the same cancellation was processed twice. None of us had seen it. The tests did not cover it. The senior developer on the team stared at it for a minute and said, out loud, that he had written that function two years ago and had never noticed.

That moment changed how our team thinks about AI review. Not because the tool is magic, and not because we now trust it blindly, but because it made a concrete case for itself in a way a sales page never could. It caught a real bug, in real code, that real people missed. The question is not whether AI review works. The question is where it works, where it fails, and how to use it without letting it quietly make your team worse.

This post is a field report, not a product review. I am going to tell you exactly what the tool caught, what it missed, and how we changed our process around it. If you are thinking about adding AI review to your team, the useful part is the middle of this story, not the beginning.

What the model saw

The bug was a race condition, and race conditions are exactly the kind of thing humans are bad at spotting in review. A human reads code line by line, in order, and builds a mental model of what happens when it runs once. A model does not get tired, and it does not assume the happy path. It looked at the refund function and asked what happens if the same request arrives twice, which is a question a tired reviewer at four in the afternoon does not always ask.

Since that first catch, the tool has found a handful of similar issues. A database query inside a loop that would have slowed to a crawl once the customer table grew. A missing null check on a field that an older version of the mobile app still sends as empty. An error message that included an internal account number, which would have shown up in a customer facing log. None of these were dramatic. All of them would have cost us a bad day later.

The pattern is clear. The tool is strongest on the boring, mechanical kinds of mistakes: order of operations, missing checks, duplicated logic, things that leak data where it should not go. It is a tireless reader of the small stuff, and the small stuff is where most production bugs live.

What it still gets wrong

The tool also produces a steady stream of suggestions that are wrong, and the wrong ones are not random. They cluster around the parts of the codebase where context matters most. It once suggested replacing a hand written caching layer with a standard library, not knowing that the caching layer existed because the standard library did not handle our particular invalidation rule. It flagged a function as too long, not knowing the function was long because it mirrored a legal document line by line on purpose.

The more dangerous failure is the confident wrong answer. The tool does not hedge. It states its suggestions as facts, with the same tone whether it is certain or guessing. A junior developer who is still learning the codebase can easily take a wrong suggestion as a correction from an authority. We saw this happen once, early on, when a developer refactored a working function based on a model suggestion and introduced a bug that took a day to find.

That incident set the rule we still use: the model is a reviewer, not an approver. Its comments are treated the way you would treat comments from a sharp colleague who does not know your system yet. You read them, you check them, and you ignore the ones that miss the context. Nobody merges code because the model said it was fine.

How we use it now

Our process now is simple. The model reviews every pull request and leaves its comments, and a human reviews both the code and the model comments together. We track which model suggestions get accepted and which get dismissed, and we review that list once a month. The acceptance rate has settled around a third, which is about right for a reviewer that is tireless but does not know the system.

We also stopped letting the model review code it has not been given context for. New files get a short note from the author explaining what the code is for, and that note goes to the model as well. The quality of its comments went up noticeably once it knew what it was looking at. Context is the whole game. A reviewer without context, human or machine, guesses.

The other change is that we made the model a teaching tool. When it catches something real, the author writes a one sentence note in the pull request explaining the bug and the fix. Over a few months, that created a small library of real mistakes the team has actually made, written in plain language. New hires read it. It is more useful than any style guide we have ever written.

What the team learned about trust

The biggest change was not in the code. It was in how the team talks about review. Before the tool arrived, a review comment felt like a judgment, and authors got defensive. After a few months of working alongside the model, the tone shifted. The model comments first, the human comments second, and the author reads both as input rather than as a verdict. The review became a conversation, and the conversation got better, because the model had already caught the obvious mistakes and the humans could focus on the interesting ones.

There is a lesson in that for any team thinking about AI tools. The tool does not have to be perfect to be useful. It has to be predictable, and the team has to understand what it is good at and what it is bad at. A tool that is right a third of the time, and wrong in ways the team can recognize, is more useful than a tool that is right half the time and wrong in ways nobody can predict. Predictability is what lets a team build a process around a tool, instead of building a process and hoping the tool fits.

The other lesson is about juniors. The team worried that the model would make junior developers dependent, that they would stop learning to review code themselves. The opposite happened, mostly. Juniors read the model comments, check them against the code, and learn from the ones that are right. They also learn from the ones that are wrong, because figuring out why a suggestion is wrong teaches them more about the codebase than accepting a correct suggestion ever would. The model became a tutor, not a crutch, and the juniors who use it well are the ones who question it most.

AI review did not replace our reviewers. It gave them a second pair of eyes that never gets tired and never skips the boring parts. The senior developer who wrote the refund function still reviews code, and he still catches things the model misses, especially anything that requires knowing why the business works the way it does. The model catches the duplicate refund. The human catches the reason the refund rule exists at all. Together they are better than either one alone, and that is the honest version of the story.