2026-11-06 · 5 min read

What One Claude Code Task Actually Costs

A bugfix, a scaffold, and a refactor are three different bills: task-level Claude Code cost anatomy — turns, context growth, what a task runs.

Monthly numbers hide the number that actually changes your behavior: what one task costs. A quick bugfix and an afternoon refactor are not the same product, yet the invoice shows them as one blur. This post breaks agent spend down to the unit you actually decide on — the task.

Disclosure up front: I operate Teapot Router, a gateway for GPT and Claude Code. The anatomy below is protocol economics, not product claims — it applies to any Anthropic-compatible endpoint.

The month hides the task

Monthly averages are honest accounting and useless steering. Inside any single developer's month, task-level cost varies far more than person-level cost ever does — the same developer's tasks can differ by an order of magnitude depending on shape, not effort. Three shapes cover almost everything agents do:

  1. The surgical bugfix. Few turns, tight context, the file was already read earlier — cache does most of the work. The cheapest shape, and the one that makes agents feel free.
  2. The scaffold or greenfield feature. Many turns, but context grows predictably and the stable prefix (instructions, conventions, earlier files) caches well. Mid-cost, very predictable.
  3. The deep refactor or marathon session. Hundreds of turns, context snowballing turn after turn, cache hit rate deciding the bill more than the model's sticker price. This is where budgets go to die.

The context snowball

Here is the mechanism that makes task three expensive: agents are stateless at the wire. Turn 15 re-sends the conversation so far — system prompt, files read, tool results included. Each turn's input grows with everything before it, so cost-per-turn climbs through a long session even at a fixed per-token price. A session chopped into scoped tasks pays for its context once each; one endless session pays for all of it, over and over. Session shape is a cost decision as much as a productivity one.

Why the same task bills differently

Two developers run the same refactor and see very different bills. The usual suspects, in order of impact: cache behavior (a stable prefix re-read cheaply versus a volatile one re-paid cold), session discipline (fresh scoped sessions versus one rolling mega-session), and model routing (flagship for every step versus flagship for the hard asks only). None of these show up on a sticker price — they show up in per-request ledger data, which is the only place to adjudicate "why was this expensive."

Meter at the task, decide at the task

If your gateway lets you label requests or assign keys per project, the task becomes your cost unit: this refactor cost this much, this bugfix lane costs that much per week. That granularity is what makes the monthly budget from our previous post defensible — you're no longer arguing about a magic average, you're reading a per-task ledger. Where labeling isn't available, scoped sessions plus per-project keys are a workable proxy.

The month is the budget unit; the task is the decision unit. Know your three task shapes, watch the context snowball, and read cost where it's metered — per request, per task — and the monthly number stops surprising anyone.

FAQ

How much does a typical Claude Code task cost?

There is no honest universal figure — it depends entirely on task shape (turns, context growth, cache behavior). Model your shapes with the calculator at teapotrouter.com/en/claude-code-cost-calculator, then verify against your own per-request ledger after a week.

Why did my small task cost so much?

Almost always the context snowball: a long-running session where every turn re-pays the conversation so far, or a cache-miss pattern that keeps re-reading cold context. Both are visible in per-request token columns before they're visible in dollars.

How do I attribute costs to specific tasks?

Label requests or use per-project keys at the gateway, then group the per-request ledger by label. Where labels aren't available, scoped sessions plus per-project keys are the practical proxy.

All posts