Loading0%
Skip to content

Measure AI coding agents by cost per merged change, not per task

Details

Published
Language
English
Reading
5 min

Token price is not what an AI coding agent costs. Measure cost per reviewed, merged change, plus merge and rework rates: review is the bottleneck.

AI agentscode reviewengineering metrics

The run finished and the dashboard says it was cheap. Then the pull request lands in your queue, and you spend the next hour reading the diff and deciding if you trust it.

Short answer first: the price of tokens is not what an AI coding agent costs you. The real cost is everything until a change is reviewed, merged and still merged a week later, and the scarce part of that is your attention.

So the unit I would rather track is cost per merged change. This note explains why, and how I would start measuring it without pretending I already have the numbers.

An old balance scale on a dark table, a tiny glowing coin on one pan and a tall stack of paper on the other pan, which hangs much lower, while a person in a dark coat looks at the stack

Why is token price the wrong number to watch?

This week two posts reached my feed a few hours apart. On Wednesday, swyx shared Eugene Yan's breakdown of 12 public AI evals and put one line in quotes on top: "Cost per task is a misleading metric; the scarce resource is human attention, not token cost."

He added a warning I agree with. Charts that reduce every model to two numbers can hide serious reliability problems.

That same night, Tibo, whose profile says he works on Codex and ChatGPT at OpenAI, posted a billing fix. A mistake at the launch of GPT-6.2 had discounted usage, so by his numbers the same work now reaches plan limits 40% faster on Astra and 25% faster on Sol.

He said past usage would not be charged and gave users a banked reset. I quoted it on Thursday morning with one line: we are finishing 2026 and this kind of mistake still happens.

Put together, the two posts say the same thing from opposite sides. The price per token moves when a vendor decides it moves, and it is still the cheapest part of the bill.

What does an AI agent change really cost?

Count everything a change consumes before it is safe on main. The model run is one part, and the rest is people:

  1. The tokens and tool calls for the run, including retries you never saw.
  2. The time someone spends reading the diff and deciding whether to trust it.
  3. The back and forth when review finds a problem and the agent tries again.
  4. The fix that comes later when a merged change turns out to be wrong.

Only the first item shows up on the invoice. The other three are paid in attention, and attention does not get cheaper when a model does.

That is what I meant on Thursday night:

Cheaper tokens don't make agent work cheaper. The bottleneck is reviewing what the agent shipped and deciding if I trust it. I'd rather measure cost per merged change than cost per task.

Andersson Quintero, on X

Why is review the bottleneck, and not the model?

An agent can open more pull requests in an afternoon than a person can read with care. The queue grows at the speed of the agent and drains at the speed of the reviewer.

I review every change an agent proposes before it reaches main, and nothing merges under my name without that step. I explained why in the note about vendor rules and human approval gates, and that gate is exactly the cost I pay in person.

Review also gets harder the less code you write by hand, which I covered in why you review worse when you stop writing code. A cheaper model that produces more diffs makes that problem bigger, not smaller.

A line of five small gray robots, each holding a closed parcel, waiting in front of one desk where a person opens a single parcel under a blue lamp

What is cost per merged change?

It fits in one sentence. Add up what a stretch of agent work cost, meaning tokens plus human review time plus rework, and divide it by the changes that were merged and stayed merged.

A task the agent finished but nobody merged counts as cost with no output. A change that merged and needed a fix the next week counts twice, and those are exactly the cases a cost per task chart hides.

I am not giving you my own number in this note. A metric is only worth publishing with the data behind it, so the method comes first.

How do you measure the reliability of an AI coding agent?

swyx's warning was about reliability, so I asked him how he would measure it. Merge rate after review, or rework rate? Those are the numbers I actually feel as a tech lead.

Here is how I would frame them, as questions your own repository history can answer.

Merge rate after review: of the changes an agent sent to review, how many merged without a person rewriting them? When that rate is low, every cheap run buys a review that ends in nothing.

Rework rate: of the changes that merged, how many needed a follow up fix or a revert within a window you choose? When that rate is high, review is letting problems through, and the cost moves to a place where it is harder to see.

Review time per change: how long did someone spend before saying yes or no? You do not need a stopwatch, because the time from opening the pull request to a decision already shows where attention goes.

A bearded man in a hoodie drops a glowing blue marble into a jar full of blue marbles, next to a second jar holding a few gray marbles, while a small robot watches from the end of the shelf

What can you change in your team next week?

Pick one repository where agents already open pull requests. Label those pull requests so you can find them later, and link every rework fix back to the change it repairs.

After a few weeks, put three things side by side: what the runs cost, how many of those changes merged, and how many came back. That comparison tells you more than any price per million tokens.

If an expensive model gets merged more often with less rework, it may be the cheap option. If a cheap model floods the review queue, it is the expensive one.

Is cost per merged change a perfect metric?

No. Small changes merge more easily, so a team can game it by splitting work, and some valuable changes are big and slow to review on purpose.

It also says nothing about whether the change was worth making. That still needs a person who knows the product.

But it points at the right scarce resource. Tokens will keep getting cheaper and billing rules can change overnight, as this week showed, while your hours of careful review stay the same.