How we made AI code review 3.4× faster, 65% more thorough, 50% cheaper
Six levers, ranked by what each returned across thousands of production pull requests: agentic workflow, evaluation loop, prompt design, reasoning budget, agent turns, model choice. The one everyone upgrades first came last.
Cost / review
−50%
workflow & evals alone
Review time
2.2 min
was 7.4
Findings / PR
1.45
was 0.88
Precision
94%
was 73% · hand-verified
01The dial everyone turns
More reasoning bought us more spend
Four production experiments against real customer pull requests. Three cost more and changed nothing.
What moved instead
We cut the system prompt from 38,500 characters to 3,400 — deleting every worked example and trap catalogue. Precision went from ~73% to ~94%. Fewer tokens in, better output out.
02Where quality actually lives
Two stages decide everything
Six of eight pipeline stages call a model. Only two bound the outcome — and neither improves when you buy a bigger one.
The review pipeline
Shaded stages are the gates. Everything else is throughput.
01Triage
Select
Decides which changed files a reviewer ever sees.
Recall ceilingA file dropped here cannot be found by any model.
02Parallel review
File agent
correctness
File agent
security
File agent
robustness
03Cross-file
Trace
Traces callers and callees the per-file pass can't see.
04Reflection
Refute
Attacks every finding against the real code. Most die here.
Precision floor73% → 94% precision came from this stage, not the model.
05Posted
Publish
Survivors ranked, merged, posted to the PR.
The failure this explains
For months our triage and dedup ran on a cheap helper model while the reviewing agents ran on the frontier one. Triage silently capped recall; dedup collapsed and posted five comments describing one root cause on a customer PR. Putting the whole pipeline on one model took that PR to six distinct findings — at no extra cost per token.
03The structural win
Read the file once
The investigation is expensive. The perspective is nearly free. Most teams pay for both.
File read three times
Three agents, three investigations, one union at the end.
File read once
One agent applies every lens to context it already has.
Result
Ensemble-grade coverage at a third of the price. This single restructuring is the largest cost reduction in the reviewer that had nothing to do with changing models.
The same principle runs one level down. Before the agent starts, we resolve the callers of every symbol the diff removed with ripgrep and hand it the answers — concrete caller data instead of hoping it greps. Work a lookup can do deterministically should never cost an agent turn, and every turn it saves comes straight off the critical path.
04The bill nobody reads
Context is billed in dollars. Output is billed in seconds.
When we did finally change the model underneath, the amount of context we sent barely moved. What collapsed was generated tokens and round trips — and that, not the price per token, is where four minutes went.
Per review, before and after
Thousands of reviews on each configuration · same fleet, same repositories, back to back.
The reading
We sent essentially the same context and got a better review back in under a third of the time. That is not a pricing story. Prefill is parallel; generation is serial. Cutting 54% of output tokens and 40% of round trips is the entire latency result — a model that reaches the same conclusion in fewer words and fewer turns is faster for reasons that have nothing to do with its rate card.
This is the one lever where the model itself moved the number, and it is worth being precise about which property paid: efficiency, not power. The same benchmark that rewarded a terser model had already refused to reward a stronger one.
Where the money actually goes
Every dollar the review fleet spent, by line item.
The counterintuitive part
86% of our input is served from cache, so re-reading a large repository context is nearly free — uncached input is two tenths of one percent of the bill. Establishing that cache is the single biggest line item on it. The lever most teams reach for is trimming context, and that is not where this bill lives.
We assumed the answer was prefix stability — how often you invalidate the cache rather than how much you send. That was wrong, and the next section is what the number turned out to mean.
05What the bill actually meant
Cache writes are a turn count, not a prefix
Fifty-nine percent of the bill is establishing cache. That reads like a prompt-stability problem. Regressed against 1,384 reviews, it is something else entirely.
A prefix problem
cache_write = 7,690 × calls + 76,306
Which moves the target
Each turn appends a tool result, and that increment is cache-written exactly once. The 59% block is not the cost of standing up context — it is paid per turn, putting 93% of the bill in reach of anything that stops the agent searching. Section 01 measured the same thing from the other end and we misread it: raising the turn ceiling bought 50% more turns at 1.37× the cost. Agents grind to any ceiling.
So we stopped making it search
Every repository is parsed into a structural graph — functions, classes, imports, call edges, test coverage. One query returns the blast radius of a diff.
Naming the edge is what makes it cheap
A ranked file list tells an agent where to look. Naming the edge tells it what to look for — and lets it skip a file instead of opening it to discover it was irrelevant. Depth two is in the graph and deliberately left there: on a 33,000-node repository it reaches 87 files, and returning them costs more than the reading it replaces.
What it returns
Estimated from measured per-turn economics against production volume.
The condition that decides it
Comment volume and acceptance rate must hold. A graph that cuts tokens by making the agent incurious is a regression dressed as a saving, and it would pass a cost dashboard cleanly — so acceptance, not spend, is the number this ships against.
06How we know
Nothing ships on one good run
Run-to-run variance on an agentic reviewer is large enough that almost any change looks like a win if you measure it once.
The evaluation loop
A candidate clears all four stages, or it doesn't reach the fleet.
01Benchmark
Benchmark
10 repos. Ground truth from two rival commercial review bots. Scored per repo, not just on average.
02Hand check
Human
Every comment against its diff. We dropped LLM judges — least reliable part of the whole evaluation.
03One-org rollout
Shadow
Candidate and incumbent run in the same production fleet, same hour.
No deploy to revert04Daily signal
Signal
Per review, per model, every day. Feeds the next candidate's baseline.
The one we didn't ship
A nudge that pushes agents to re-sweep for a second defect looked like a clean +30% recall win. One run, high variance, +49% latency. It is still off. A loop that ships every apparent win is a slower way of guessing.
07The part that's hard to copy
One switch, any provider
The reviewer runs on multiple provider configurations — different vendors, model families and transports — each selectable as a production switch. One environment variable, applied per organization and per review, reversible without a deploy.
Which one serves a given review changes as models and prices do. The durable asset is the switch, the benchmark and the rollout gate, not whatever runs behind them in a given quarter.
Code review alone moves billions of tokens a day through that switch. At that volume the arithmetic changes: one percent of output tokens, one redundant round trip per file, a cache prefix that invalidates slightly too often — none of it is visible in a single review, and all of it is material by the end of the month. That is the real argument for the benchmark and the daily signal. A model migration is a step change you get once; the harness compounds every week you keep measuring it.
Caveat worth stating: “no measured gain” means our instruments didn’t detect one, on our benchmark, for per-file defect detection. Max reasoning may well pay off elsewhere.
Agent Insights
Daily visibility into what every AI workload cost, how long it took, which model ran it, and whether the outcome was any good.
Explore Entelligence