When I first started using AI for code review, the failure mode was obvious almost immediately.
If I handed a model a diff and asked for “feedback,” I got something that looked like review and felt like drag. The output was long, polite, and usually full of advice that was technically defensible but not especially useful. Rename this. Add a comment there. Consider extracting a helper. Improve readability. Add tests. Some of it was fine. Very little of it changed the outcome of the pull request.
That taught me the first rule quickly: an AI code review agent needs a job description, not just access to a patch.
The useful version isn't a model that comments on code; it's a reviewer that knows what kinds of problems it's trying to catch, how much confidence it should claim, and what kind of output makes a busy engineer more likely to act on it.
That has made a much bigger difference for me than model swapping ever did.
The prompt has to force a review order
The code review prompts that work best for me are structured around priorities.
I want the review to look for correctness issues first, then security and robustness problems, then performance traps, and only after that move into maintainability and style. If I do not force that order, the model tends to burn a lot of energy on local polish because local polish is easier to talk about than a subtle bug in control flow or state handling.
That priority stack changed the signal quality right away.
Once the model is told, explicitly, that bugs and failure modes outrank style, the output starts sounding more like a real reviewer. It spends more time on edge cases, missing validation, unsafe assumptions, and incomplete tests. It spends less time proposing tasteful but low-value rewrites.
I also like making the output format rigid. A short summary, a risk table, pinpointed inline notes, minimal patch suggestions, test gaps, and a verdict are much easier to work with than a freeform essay.
The agent needs permission to say less
One of the biggest improvements I made was deciding that silence is better than filler.
A lot of AI review noise comes from the model feeling obligated to populate every category. If the prompt implies that every diff should yield architecture commentary, readability nits, test feedback, and style observations, the agent will invent work for itself. That is how you end up with comments that are not wrong exactly, but also would not change whether the code should merge.
I have had better results once I started biasing the prompt toward real findings and away from completeness theater. If the change is straightforward and the main review comment is “this looks fine, but add one test for the empty-input path,” I want the agent to feel allowed to stop there.
That sounds small, but it changes the tone of the whole system. Developers will keep reading AI review when the comments feel earned. They start ignoring it when every diff triggers the same volume of generic advice.
When the output has a risk register, empty rows are acceptable. When the prompt says to provide a merge recommendation, “approve with nits” can actually mean something.
The best catches are usually in the boring parts
The most useful AI review comments I get are rarely glamorous.
They are the off-by-one condition in a loop that only fails on an empty list. The missing timeout on an outbound request. The new branch that returns a different shape than the existing callers expect. The broad exception handler that quietly swallows the real error. The cleanup path that does not run if a helper throws halfway through. The test that covers the happy path and skips the one case the patch clearly made riskier.
Those are good review findings because they are specific, local, and actionable. They fit the way code review already works.
I have also found AI useful for pattern spotting inside a diff. If a new feature introduces a validation check in one path but not another, or duplicates a subtle assumption in three places, the model often notices the inconsistency quickly. That is especially helpful in larger patches where the logic is spread across multiple files and the human reviewer is holding a lot of context in their head already.
Where it still produces noise is in broad maintainability commentary. Left to itself, a model loves to suggest splitting functions, extracting helpers, renaming variables, or adding comments for clarity. Sometimes those suggestions are good. Often they are just a different taste in code shape.
That is why I try to keep maintainability below correctness, security, and test coverage in the review order. It still matters. It just should not dominate the review unless the design problem is serious enough to affect risk.
Patch suggestions are useful only when they stay small
I like having the agent propose fixes, but only in a narrow way.
The best patch suggestions are surgical. They show the exact guard clause, the missing null check, the more specific exception handling, the corrected condition, or the extra test case. They reduce the cost of acting on a real finding.
The worst patch suggestions try to redesign the code during review.
Once the model starts drafting a different abstraction, a different module boundary, or a cleaner architecture in the middle of a PR review, the conversation usually gets worse. The author has to evaluate a speculative rewrite instead of a concrete issue. The review starts expanding the scope of the change. And the agent gets more opportunities to sound persuasive while drifting away from the actual risk in the patch.
I want review comments that help land the current change safely. If a larger refactor is warranted, I would rather the agent say so plainly and describe it as follow-up work than smuggle it in as a patch suggestion.
That keeps the workflow grounded.
Tests are where the agent earns a lot of trust
One of the most practical uses for AI review is test gap detection.
A decent reviewer prompt can get the model to ask a useful question over and over: what changed here that is still untested?
That often leads to exactly the kind of comments I want. There is no test for malformed input. There is no assertion for the rollback path. There is no case covering the newly introduced false branch. The function now handles retries, but the tests still only prove the one-shot success path. Those comments are easy to validate and usually easy to fix.
I also like having the agent propose test names or small stubs rather than whole suites. That keeps the output in review mode instead of implementation mode. A suggested test_returns_empty_result_when_source_is_missing is often enough to point the author in the right direction.
This is also where AI review complements human review nicely. Human reviewers are often best at judging whether the overall approach is sensible and whether the code matches the intent of the feature. The AI agent is often good at noticing that one branch or one error case did not make it into the tests.
Integration matters more than novelty
I think AI review is most useful when it fits into the existing review workflow quietly.
I do not want it to become a second PR discussion that developers have to manage separately. I want it to produce a compact pass that can run before I look at the change, or alongside the first human review, with comments scoped tightly enough that I can accept, reject, or ignore them quickly.
That means a few practical constraints matter a lot.
The agent should review the diff, not the whole repository by default. It should know the project style when that context is available, but it should not pretend every repo needs the same standards. It should make assumptions explicit when context is missing. And it should be able to focus when the PR says “look closely at performance” or “pay attention to security boundaries.”
I also think it helps to be honest about where the output sits in the decision chain. I do not use AI review as an auto-approve mechanism and I do not treat it as a final gate. I use it as a fast first pass that is good at certain classes of issues and prone to a predictable kind of noise.
What makes it worth keeping
The AI code review setups that have stayed useful for me all share the same traits.
They are biased toward real bugs over style advice. They use an output structure that makes triage fast. They treat patch suggestions as minimal repairs, not refactoring proposals. They pay close attention to tests. They allow the model to return a short review when the change is low risk. And they fit into the ordinary pull request flow instead of trying to replace it.
That is also why I think of this as a companion to the rest of my agent tooling work. The interesting part isn't that a model can review code; it's deciding what kind of reviewer it should be, where it adds signal, and how to keep it from creating a second layer of process around work that already needs human judgment.
AI review becomes useful when it helps a human reviewer spend more attention on the parts that actually require experience. That is the bar I care about. If the agent catches a real bug, points out a missing test, or shortens the path from “something feels off here” to a concrete fix, it has done its job.