8 minute read

Zero-Cost Code, part 4 of 7. The cost of writing software has gone to near zero. Everything around it just got more expensive. Parts 1 to 3 covered ownership, judgment, and the software factory with the decision latency it exposes. This part covers measurement.

I keep one row per sprint. It holds merged changes and the share an agent opened, AI cost per merged change, lead time, change failure rate, and how much of the work was new capability. It exists to answer one question from finance: what did this work cost, and what did it deliver?

Most organisations can’t answer it. The FinOps Foundation’s State of FinOps 2026 surveyed 1,192 practitioners: 98% now manage AI spend, up from 31% two years ago, and AI cost management is the skill they most need to build.1 The Tokenomics Foundation’s State of Tokenomics surveyed 472 enterprises in 2026: 73% can’t confidently connect AI spend to an outcome their CFO would accept.2 The same survey found that the confident minority track concrete outputs such as tickets and pull requests, not token counts alone.

Everyone has the bill. Almost nobody has joined it to delivery.

Tokens are the wrong unit

Finance doesn’t buy tokens. It buys shipped change: a feature live, a defect closed, a report a regulator accepts.

The billing standards haven’t caught up either. FOCUS, the open spec cloud providers use for cost exports, carries no field for model identity or token type in its current release. Version 1.5 adds them and is scheduled for ratification in December 2026.3 Until then a token is a pricing-unit string and a quantity, sitting in a different system from the pull request it paid for.

So the first job is a join, and it belongs to engineering leadership, not finance.

The ledger

One row per sprint, built from three systems that rarely meet. Synthetic example.

I run one row per sprint, built from three sources.

Ticketing gives plan and flow: say/do (planned work done by sprint end), scope added after the start, cycle time per story, carry-over, and the mix of features, chores and bugs.

The repository gives shipped change: merged pull requests (bots and environment-promotion PRs excluded), the share opened by an agent, the share of changed lines inside those PRs, and DORA’s four (deploy frequency, lead time to production, change failure rate, time to restore).

Tracing gives AI activity: sessions, model cost, the split by model, and what the agent spent its tool calls on (shell and git, code edits, reading, data queries, documentation).

The headline unit is AI dollars per merged PR, and it only means something next to the delivery metrics beside it. A falling cost per PR alongside a rising change failure rate is a warning, not a win.

A worked example

One feature, costed two ways. Synthetic example.

The numbers below are synthetic. The shape matches what I see.

A sprint merges 120 PRs. Agents opened 84 of them, 70%. Model spend for the sprint is $3,000, so AI cost per merged PR is $25.

Zoom into one feature that took 14 of those PRs. Its traced AI spend is $350. A senior engineer spent 3 hours on the specification and decision, and 9 hours reviewing and verifying. At a loaded $180,000 a year over roughly 1,650 productive hours, that’s $109 an hour, so $1,308 of human time. The feature cost $1,658 and reached production in four days.

The counterfactual, estimated from comparable pre-AI work, is seven engineer-days: 56 hours, $6,104, and about three weeks elapsed. On these numbers the AI-assisted feature is 73% cheaper.

Two readings matter.

The machine is the cheap part. 79% of the AI-assisted feature’s cost was human time. Switching to a cheaper model saves a little. Shortening the review through better context, better tests and a clearer specification saves a lot. This is the gate from part 2, priced.

The saving is capacity, not payroll. The 44 hours didn’t leave the payroll. They went to the next bet, or into the review queue. Larridin’s advice to CTOs facing their CFO is sound here: present time savings as added capacity, and show what that capacity bought.4

What the thresholds do

Each headline metric on my scorecard has a green and amber band. DORA’s bands set the delivery thresholds; the rest are starting points I tune. Each one is also compared with the average of the previous three sprints, so a team that slides from great to good sees it.

Thresholds change behaviour, which is the point and also the risk. Pull-request counts reward splitting work, and AI share rewards letting the agent open things it shouldn’t. Pair every volume metric with a quality metric so that gaming one shows up in the other.

State the bounds

The most useful rows on my KPI legend are the caveats.

  • AI share is a lower bound. I attribute a PR to an agent from a marker the agent writes into the description. Remove the marker and the PR looks human.
  • AI cost is an upper bound. Tracing covers everyone whose sessions report to it, across all projects, so cost per PR overstates the cost of this team’s work.
  • AI cost is list-price equivalent, not cash. Tracing prices every token at the API rate. A flat-rate subscription caps what you actually pay. Report both; the next section is about the gap.
  • Throughput doesn’t trend. Stories got smaller when agents started writing tickets, so counts aren’t comparable across that change. Cycle time and feature share hold up.
  • A few large PRs can dominate commit and line counts. Read them as mix, not as effort.
  • Change failure rate is a deploy proxy. It counts failed pipelines, not production incidents.

A finance partner trusts a number with stated bounds far more than a precise number that later moves. The bounds are part of the product.

Price the exposure

One number on the sheet belongs in front of the board, not only the CFO.

On a flat-rate coding-agent plan, the cash bill is capped and the token-equivalent figure is not. The two can sit a long way apart. Part 3 gave a public sense of the range: StrongDM’s rule of thumb of $1,000 a day in tokens per engineer comes to about $20,000 a month, against the $200 plan Simon Willison pays for.5

The ledger reports the ratio between the two as pricing exposure: the multiple you would pay for the same usage if the vendor moved you to metered pricing. Today’s unit costs rest on a price you don’t control, and a delivery model built on agents inherits that dependency.

So forecast AI cost as a range. The flat rate is the floor, list price is the ceiling, and the assumptions sit beside both. A team that knows its exposure can decide in advance what it would do at twice the price: route simple work to smaller models, cap usage, or pay, because the unit cost still beats the counterfactual.

What the CFO asks next

Once the ledger exists, the questions get better. Larridin’s list matches mine: which teams, tools and use cases drive the cost; whether spend correlates with delivery quality; which costs have no owner; what next quarter will cost, as a range with assumptions.4

That last one is where engineering earns a seat. A forecast you can defend comes from a unit cost you’ve measured.

Measure the spec, not only the build

Once the build is cheap, quality moves upstream. The specification and the verification plan now steer the work, so they deserve the scrutiny the diff used to get. Two measures show whether they are getting it: rework rounds, meaning how often a change goes back to the builder after review, and spec returns, meaning how often a reviewer sends the work back because the specification was wrong, not the code. Both are cheap to count and neither is in v0.1 of the spec. They are first on the list for v0.2.

The spec

I’m publishing the metric specification behind this ledger as Sprint Ledger Spec v0.1, under CC BY 4.0. It defines each metric, its source, its formula, its direction and its caveat, plus starting thresholds and the method for a human-versus-machine comparison. It contains no data and names no employer. It works with any ticketing tool, any Git host and any tracing stack that records model cost.

Take it, change it, tell me where it breaks.

Where I might be wrong

The pull request is a poor unit of value. It is. It’s the best unit of shipped change that every team already records, and the spec pairs it with feature share and DORA to stop it standing alone.

Counterfactuals are guesses. Seven engineer-days is an estimate. Use a reference class from your own pre-AI history and publish the range, not the point.

Attribution will get harder. As agents move into every editor and review tool, the line between AI and human change blurs. At some point the useful question stops being “how much did AI write” and becomes “how much did we spend per unit of verified change.” The spec is built so that switch costs nothing.

The question

If your CFO asked tomorrow what your last feature cost, in machine dollars and senior hours, how long would it take you to answer?

Next in Zero-Cost Code, part 5: what this does to the people who used to write the code.