Article

Your AI coding bill isn't paying for code

Why agentic coding detached the cost from the sticker price, and what actually brings it back

So, I went through 33 days of my own Claude Code logs looking for something expensive, and found it in the gaps. Not in the work. In the gaps BETWEEN the work.

207 times in those 33 days I left a session for more than an hour and came back to it. Each time, the next turn rewrote about 470,000 tokens of context into the cache, because the cache had expired while I was making tea (or, more honestly, doing my day job). Those 207 turns cost $972 at API rates. Read warm, the same context would've cost $48. That's 22% of everything my main sessions spent, for the privilege of walking away from the keyboard.

Nobody budgets for that. Nobody even knows it's there. And that, in one number, is AI coding-agent bill shock: the cost has come loose from anything you'd think to look at.

The sticker price is the wrong number

Every coding tool sells you a seat. $20 a month, $100, $200. A seat is a familiar thing, it's how we've bought software for twenty years, so a seat is what finance budgets for.

But an agent doesn't use a seat. It uses tokens, and how many it uses depends on how long it runs, how much it reads, how many helpers it spawns and how often it starts again from cold. None of those are on the price list. They're decided by the agent, minute by minute, while you're not watching.

Uber found this out the expensive way. In April its CTO, Praveen Neppalli Naga, told The Information that Claude Code had got through the company's AI budget for the whole of 2026 in about four months, and that he was "back to the drawing board". The heaviest users were reportedly running $500 to $2,000 a month each, against a typical $150 to $250. A month later an AI consultant told Axios that one client had spent half a billion dollars in a single month after not putting usage limits on its Claude licences. One anonymous source, so treat it as a parable rather than a fact. But it's a parable everybody recognised.

Cursor found out from the other side. In June 2025 it swapped its Pro plan's 500 requests a month for a $20 pool of usage priced at API rates, and a lot of people ran out long before the month did. On 4 July it apologised, said the change hadn't been communicated clearly, and refunded unexpected charges from the previous three weeks.

And it isn't just the big names. In this year's State of FinOps survey, 98% of the 1,192 respondents were managing AI spend, up from 31% two years earlier. Nobody sets up a cost-management practice for something that behaves itself.

The seat price anchored everybody's expectations, and then the work moved underneath it.

What you're actually paying for

Here's the part that surprised me most. You'd think the cost of a coding agent is the code it writes. Nope.

I priced every response in those 33 days at the published API rates: about $4,560 in total. The tokens the models actually WROTE came to 8% of that. Cache reads were 62%. Cache writes, 29%.

Why? Because an agent conversation is stateless. Every turn, the whole thing gets sent back: your instructions, every file it's opened, every bit of tool output, everything it's said so far. My main sessions averaged about 455,000 tokens of prompt per turn. The model rereads all of it, every single time, to write a few hundred tokens of reply.

Prompt caching is what keeps this survivable. If the start of the conversation hasn't changed, the provider serves it from cache at a tenth of the normal input price (a twentieth on the newest Opus), and 98% of my main-session prompt tokens came from cache. But a tenth of a lot is still a lot. Thousands of cheap rereads, at 455k tokens a go, is how you get to 62%.

So the first rule of agent cost is a dull one. Long conversations cost more per step than short ones, and the cost of a step is mostly the context, not the model's answer.

The hour

Caches don't last forever. By Anthropic's own docs a cached prompt lives for five minutes by default, and writing it costs 1.25 times the normal input price. You can keep it for an hour instead, at twice the input price. Every main-session write in my logs was the 1-hour kind, which pays for itself as long as you come back inside the hour.

Come back after it, and the whole conversation gets written again, at the higher rate. That's my 207 restarts. Median size, 457,000 tokens. On Opus 5.5 that's about $3.65 every time you return from lunch, against 9 cents if the cache had still been warm.

And it isn't just me and my lunch breaks. On 15 October a Mac user filed a bug after leaving a seven-agent workflow running overnight. The laptop went to sleep, and (the way they read their transcripts) after every wake-up the agents wrote their whole context back into the cache. The workflow panel said 2.5 million tokens. The transcripts said about 50.6 million tokens of cache WRITES, plus 377 million of reads, and their weekly limit dropped by about a quarter. The computer was asleep. The meter wasn't.

Anthropic clearly noticed. On 14 October Lydia Hallie announced idle compaction in Claude Code: just before the cache expires, an idle session gets summarised, so when you come back it reprocesses a summary instead of the whole conversation. You lose some fidelity (it's a summary), and you can switch it off, but for a long session it turns a $3.65 restart into small change.

If your tool doesn't do that, you can do it by hand. Finish a piece of work, write down where you got to, and start a fresh session rather than resurrecting a 400k-token one the next morning.

Loops and fan-out

The restarts are slow and steady. The runaways are the ones that make the news.

In June an employee at the fintech Slash ran up about $80,000 in AI credits on the company card building a "brainrot shooter". Slash's public response was to ask people to play the game so they could write it off as a marketing expense. Funny. Also exactly what happens when nobody sets a ceiling.

The newer version of the same story is fan-out. Agents can now start other agents, and those can run in parallel, and nothing in the price list tells you how many you just started. On 15 October a Claude Code user filed a bug: they'd asked for a single audit of one Excel file, with a standing instruction never to use multi-agent runs, and the session launched 137 agents anyway. About 16 million tokens and 1,475 tool calls in 62 minutes, half their weekly allowance gone, and they had to stop it by hand. The same day, someone on Hacker News described asking Claude Code a question and watching it spawn around 70 agents that "consumed all my usage immediately".

In fairness, fan-out isn't automatically expensive. My own 160 subagents across those 33 days were 4% of the bill, because each one did a short job, handed back an answer and stopped. Fan-out gets expensive when nobody set a limit and nobody's watching. Which is most of the time.

Cheap models have cliffs

The obvious fix is to send the grunt work to a cheaper model. It works, and it's the right instinct, but read the price card properly first.

Claude Haiku 5.5 costs $0.10 per million input tokens and $0.50 out, which is lovely, up to a 100,000-token prompt. Past that, every request goes on a second card at five times the price. Cached tokens count towards the line.

I checked my own subagents against it. 54% of their requests were over 100,000 tokens, mostly cached context they were rereading. Swap them all to the cheap model and over half land on the expensive card. Cheap model, wrong side of the cliff.

What actually helps

None of this needs a product. Most of it needs a habit, and the first habit needs data.

Measure by session, not by month. A monthly invoice tells you that you spent the money. It can't tell you it was 207 cold restarts, or one runaway workflow, or one person's 455k-token session they never closed. Break the spend down by session, repository and person, and the causes show up on their own. If your provider gives you token counts per request (they all do), you can do this with a script.

Set a cap before the agent starts, not after. A cap on a monthly bill is a postmortem. What you want is a budget per task or per session, and a way to kill a run that's blowing through it. The 137-agent run would've been a 5-minute annoyance with a cap on it.

Keep the context short and stable. Anything that changes the start of the prompt (a timestamp, a reordered tool list, a fresh system message) throws the cache away. Short sessions with a written handover beat one heroic session that lives for a week.

Mind the hour. If you're stepping away for longer than the cache lasts, either let the tool compact the session or end it properly.

Route by need, then check the card. Most agent requests don't need the frontier model, but a cheap model at a big prompt can cost more than you think. Route the short, read-light work down and keep the big-context work where it is.

The disclosure bit

I build a tool for this, so take the following with the appropriate pinch of salt. OmnisRouter is a free, open-source router that sits in front of your agents and writes a receipt for every request. OmnisVigil turns those receipts into spend by project, repo and person, with budget caps and a kill switch. The numbers in this article came from the same idea, done with a hundred lines of Python against my own logs, which is to say you don't need my tool to find your 22%. You do need to look.

How I counted

  • Source: the session logs Claude Code keeps under ~/.claude/projects, 28 August to 29 September 2026. Each response counted once by its message id, subagents included.
  • Prices: the published per-million-token API rates. Cache reads at each model's published read price (0.1x input on Opus 4.8, which was 92% of the spend), cache writes at 1.25x input for the 5-minute cache and 2x for the 1-hour cache.
  • A "cold restart" is a main-session turn that came more than 60 minutes after the previous one and wrote more than 20,000 tokens to cache.
  • I'm on a flat subscription. The dollar figures are what the same work would have cost on the API, not what I paid.

Rob

Find your own 22%

OmnisVigil is in early access and free for one. Run OmnisRouter in collect mode on a machine using your Claude subscription. It reads your usage read-only, reprices it, and shows you the cold restarts, the runaways and what routing would have saved.