# Claude Code Cost: What Running Coding Agents Actually Costs

> The cache-heavy token math behind coding-agent bills, API versus subscription costs, and why I budget by verified outcomes. Prices checked November 2026.

- Canonical: https://jedarden.com/guides/coding-agent-costs/
- Published: 2026-10-26
- Last verified: November 30, 2026 (2026-11-30)
- Tags: agents, cost, claude-code, ai-coding-tools, fleet-ops

---

**The useful Claude Code cost is cost per verified outcome.** In my
measured mix, **96.5% of input tokens were served from cache**. Pricing that
work means counting fresh input, cache writes, cache reads and output,
then checking what the work delivered. A subscription bill and an
API-equivalent token bill answer different questions; neither alone tells
me what a completed task cost. This guide follows the token bill, the
allowance it consumed and the outcomes I can verify.

For plan prices and free access, I use the separate [Claude Code pricing
guide](/guides/claude-code-pricing/).

The first time I ran headless agents in earnest, I burned through a quarter
of my monthly Anthropic allowance in three days. I told [that
story](/notes/agents-pets-cattle/) as a parable about pets and cattle; it is
also the reason this site maintains a [subscription-versus-API
comparison](/data/inference-plans/). Cost is the thing people ask about first
and plan for last.

Two things about the evidence base, stated up front, as in the other guides.
The vendor facts — plan prices, API rates, the cost-management documentation —
were verified against the live pages on **2026-11-30**; the plan tiers were
re-read along the way on **2026-11-11**, when the $200 tier had become
**Ultra**; every price below carries its access date. Prices move; re-verify
before building on any specific number. The plan tiers and the free routes also have a dedicated,
already-published home on this site — [Claude Code
pricing](/guides/claude-code-pricing/) — so this page spends its words on the
bill rather than re-listing every plan; the two link to each other and are
meant to be read in either order. The operating experience is mine: I am an agentic systems
engineer who runs about twenty headless coding agents, and the usage profile
I cite was measured on my own machine's agent histories and published in full
in the [inference-plans artifact](/data/inference-plans/). Where I generalize
beyond that, I say so.

> **TL;DR** — Price the full token mix, including cache reads and writes.
> In my measured workload, **96.5% of input came from cache**. Compare that
> API-equivalent bill with the allowance a subscription actually delivered,
> then divide spend by **verified, accepted outcomes**. The historical
> quota record is a planning reference; it does not guarantee current
> capacity for another fleet.

## The token cost: cache is the whole story

Under every plan sits the same substrate: API token pricing. The current
per-million-token list rates (verified **2026-11-30** at
[platform.claude.com](https://platform.claude.com/docs/en/about-claude/pricing))
for the models coding agents actually run:

<div class="cac-scroll">

| Model | Input | Output | Cache write | Cache read |
| --- | --- | --- | --- | --- |
| Opus 5.5 | $4.00 | $20.00 | $5.00 | $0.20 |
| Sonnet 5.5 | $2.00 | $10.00 | $2.50 | $0.10 |
| Haiku 5.5 (over 100K) | $0.50 | $2.50 | $0.625 | $0.05 |

</div>

The cache-write column is the default five-minute entry; one-hour cache
writes cost more ($8 / $4 / $1 respectively) and batch inference costs
less; neither changes the story below. Note the Haiku
footnote: the headline Haiku rates ($0.10 input, $0.01 cache read) apply only
to prompts under 100K tokens. Agentic sessions live above that line — a
context window carrying a codebase, tool definitions, and a working history
blows past 100K in minutes — so a fleet quote built on the cheap tier is
fiction.

Two entries new on the page since this guide's first draft, both of which
move an agentic bill. Claude 4.7-and-later models use a newer tokenizer that
produces roughly **30% more tokens for the same text**, so the same code
review carries about a third more billed tokens on a current model than on
Sonnet 4.6 and earlier. And the frontier has moved up a price class above
Opus: the newest models list at **$8 in / $40 out** with a $0.20 cache read
— the cache discount holds at the top of the list, but the fresh-input rate
doubles. Anthropic's hosted agent layer, Claude Managed Agents, adds
**$0.08 per session-hour of runtime** on top of tokens — small next to the
token line of a real session, but the first non-token line the platform has
metered.

Now the part the price list hides. Here is the vendor's own worked example
from the [cost documentation](https://code.claude.com/docs/en/costs) — one
real session, billed:

```text
claude-sonnet-4-6: 1.2k input, 5.3k output, 940.0k cache read, 50.0k cache write ($0.55)
```

Read what that session is made of: 1,200 fresh-input tokens against **940,000
cache-read tokens**. The session's dollar figure is mostly the agent
re-reading its own context at a fifth of a cent per thousand. That is not an
outlier; it is the shape of every coding-agent workload, because an agent
that verifies its work sends the whole conversation back with every tool
call.

<div data-cac-exhibit="worked">

<details>
<summary>The billed lines</summary>

| Line | Tokens | Cost (Sonnet 4.6 rates) |
| --- | ---: | ---: |
| Fresh input | 1.2k | $0.00 |
| Output | 5.3k | $0.08 |
| Cache write | 50.0k | $0.19 |
| Cache read | 940.0k | $0.28 |

</details>


</div>

My own measurement agrees. The [inference-plans
artifact](/data/inference-plans/) opens with a scan of my locally recorded
agent histories — 82.06 billion tokens across Claude Code, Codex, and ZCode
sessions (an accumulated snapshot, not one billing month):

- Fresh input: 2.79% of all tokens
- Cache reads: **96.08%**
- Cache writes: 0.66%
- Billable output: 0.47%
- Total input-to-output ratio: 213 : 1

<div data-cac-exhibit="mix">

<details>
<summary>The measured buckets</summary>

| Bucket | Share of all tokens | Per 1M output |
| --- | ---: | ---: |
| Fresh input | 2.794% | 5.985M |
| Cache reads | 96.082% | 205.776M |
| Cache writes | 0.657% | 1.406M |
| Output (incl. billed reasoning) | 0.467% | 1.000M |

</details>


</div>

Put the measured mix together with the list rates and you get what an
agentic session actually costs per million output tokens — the honest unit,
since output is the scarce thing:

| Model | Billed per 1M output | Share that is output | Share that is cache reads |
| --- | ---: | ---: | ---: |
| Opus 5.5 | $92.13 | ~22% | ~45% |
| Sonnet 5.5 | $46.06 | ~22% | ~45% |
| Haiku 5.5 | $16.66 | ~15% | ~62% |

<div data-cac-exhibit="unitcost">

<details>
<summary>The per-model totals</summary>

| Model | Billed per 1M output tokens |
| --- | ---: |
| Opus 5.5 | $92 |
| Sonnet 5.5 | $46 |
| Haiku 5.5 (over 100K) | $17 |

</details>


</div>

Three conclusions fall out of that table, and none of them is "tokens are
expensive":

1. **Output is a minority of the bill** — about 22% at Opus and Sonnet list
   rates, 15% at Haiku. Intuitions tuned on "output tokens cost 5× input"
   are aiming at the wrong line.
2. **Cache reads are the biggest single line** — 45% of the total at Opus and
   Sonnet rates, 62% at Haiku. The practical lever is not spending less; it
   is keeping the cache warm, because a cache miss after the cache lifetime
   expires re-processes the full context at fresh-input rates.
3. **Caching is why agentic coding is economical at all.** Bill the same
   measured mix entirely at Sonnet's fresh-input rate and it comes to about
   $436 per million output tokens; with caching it is $46 — roughly nine
   times cheaper. The discount isn't a pricing gimmick; it's the vendor
   pricing what inference actually is for a long-running agent.

Two multipliers move this math in practice, both documented in the [cost
documentation](https://code.claude.com/docs/en/costs): extended-thinking
tokens are billed as output, and the default thinking budget can reach tens
of thousands of tokens per request; and agent teams run roughly **7× the
tokens** of a standard session in plan mode, because every teammate carries
its own context window. Background usage, by contrast — summarization and
status checks while a session sits idle — is typically under $0.04 per
session. Noise, not signal.

## Subscription or API: the allowance conversion problem

A subscription buys an allowance that expires. An API bills for the work
requested. Both can be economical, and the hard part is that they are priced
in units that don't convert — the [inference-plans
artifact](/data/inference-plans/#convert-the-allowance-before-comparing-it)
does that conversion properly for twenty-plus offers, so I will not repeat it
here. What follows instead is the calculator form of the question: pick a
model and a workload, price the month at list rates with my measured mix,
and compare the API equivalent with the monthly subscription price. A price
comparison alone does not establish that an allowance covers that workload.
These monthly prices are comparison denominators, checked November 30, 2026:

| Plan | Price |
| --- | --- |
| Pro | $20/month |
| Max | $100/month |
| Ultra | $200/month |

<div data-cac-exhibit="calculator">

The interactive calculator needs JavaScript. The same arithmetic is
published at [the inference-plans artifact](/data/inference-plans/), and the
tables above carry the rates and mix it uses.

</div>

For a **person**, compare the plan price with your own measured workload and
check `/usage` for the allowance you actually receive. A subscription can
cost less than equivalent API tokens, but neither a human-paced day nor
these fleet measurements guarantees that a five-hour window will last.
In my measured $200-per-month account weeks, every completed week delivered
more API list-price equivalent than that week's prorated subscription cost
(about $46, using 52 weeks per year):

<div data-cac-exhibit="plandollar">

<details>
<summary>Week by week</summary>

| ISO week | Est. list-price use | One plan-dollar bought |
| --- | ---: | ---: |
| W35 | $1,536 | 33.3× |
| W36 | $4,318 | 93.6× |
| W37 | $2,606 | 56.5× |
| W38 | $2,292 | 49.7× |
| W39 | $1,507 | 32.7× |
| W40 | $923 | 20.0× |
| W41 | $2,018 | 43.7× |
| W42 | $1,072 | 23.2× |
| W43 | $183 | 4.0× |
| W44 | $55 | 1.2× |

</details>


</div>

For **unattended work**, the windows are the constraint, not the dollars. A
fleet does not pace itself; it runs until something stops it, and the first
thing that stops it is a five-hour or weekly window hitting empty —
[the unit-economics note](/notes/unit-economics-of-cattle/) calls this the
moment you find out your spend control is missing. Measured on the $200
account my fleet runs on, over eight completed weeks from mid-September to
mid-November 2026:

<div data-cac-exhibit="windows">

<details>
<summary>Week by week</summary>

| ISO week | Peak use of the weekly window |
| --- | ---: |
| W38 | 80% |
| W39 | 46% |
| W40 | 30% |
| W41 | 100% (cap hit Oct 12–13) |
| W42 | 71% |
| W43 | 51% |
| W44 | 48% |
| W45 | 55% |

</details>


</div>

In those historical governed windows, the **whole account consumed 210
percentage points over 837 alive worker-hours**: about **0.25 percentage
points per worker-hour**, or **42.2 points projected over 168 hours**.
The numerator includes my own steering, and alive hours include idle time.
This is a shared-account planning reference, not an isolated worker cost
or a guarantee of how many workers a current allowance supports. Workload
and plan allowances changed during and after the study. The five-hour
windows averaged 5.8% across 17 samples; in this observed workload the
weekly allowance was the tighter constraint. Ultra's current verified-account
shape has no five-hour limit; other plan-window rules and prices are in the
[pricing guide](/guides/claude-code-pricing/). The vendor's own [rate
guidance](https://code.claude.com/docs/en/costs) for teams scales tokens
per minute *down* with team size, because fewer people use a large
allocation concurrently; an unattended fleet is the degenerate case where
every worker is concurrent all the time.

What I run instead, in one paragraph: a component beside the fleet that
**forecasts each window** (at the current burn rate, do we hit the wall
before the clock resets?), **sets headcount** (the fleet shrinks when the
forecast says the window runs out early, and grows when capacity will be
left on the table), and applies a **hard brake that drops the fleet to zero**
if any window crosses 98%, because hitting the provider's ceiling is the one
failure mode worse than stopping. In a cattle system the throttle is not a
per-request limit. It is headcount. The
[orchestration guide's budget section](/guides/agent-orchestration/#budgets-and-observability)
covers how this sits next to the dispatch loop.

Usage credits blur the line from the other direction: a subscription that
keeps billing at API rates after the cap. For a fleet that is a pressure
valve, and like every pressure valve it needs a limit set on it *before* the
first overage, not after — the same docs cover per-member and per-
organization spend caps.

## Cost per closed outcome, not cost per token

Here is the argument I keep re-deriving the expensive way, written down once:
**tokens are an input cost, not an output measurement.** A worker that burns
200K tokens to close one task uses 200K per outcome. A worker that burns
800K tokens to close five uses 160K per outcome: **20% less**, assuming the
same token mix and prices and that all six outcomes passed their acceptance
checks. Comparing only the workers' total tokens would miss that result. The full
case is in [the unit-economics
note](/notes/unit-economics-of-cattle/); the short version is that the
denominator has to be the work the system delivered, because token cost
without an outcome attached is just spend.

Subscriptions make this worse in a specific way: inside a seat allowance,
marginal cost is invisible by design. You cannot compute cost per outcome
from a plan that meters nothing in dollars — which is why the component
described above also **prices every token the fleet burns at API list rates,
per model**, including cache reads and writes. The subscription hides the
marginal cost; putting it back is what makes cost per closed task
computable at all.

This is also where the vendor's own numbers stop, which is the honest
boundary of what any vendor cost page can tell you.

## What the vendor benchmarks measure — and what they miss

The cost documentation publishes enterprise deployment averages, and they
are useful for budgeting a rollout: **around $13 per developer per active
day and $150–250 per developer per month**, with 90% of users below $30 per
active day (verified 2026-11-30). If you are writing a budget request for a
team pilot, start there.

Three things those averages cannot tell you, from the other side of an
unattended deployment:

- **They measure spend, not delivered work.** An honest AI coding tools cost
  analysis needs three columns — spend, allowance consumed, and accepted
  outcomes — and the vendor can only ever supply the first. The
  [inference-plans artifact](/data/inference-plans/#the-next-analysis-should-measure-accepted-work)
  ends on exactly this point: the next revision of any comparison should
  measure accepted work, not tokens.
- **They are averages over human-paced usage.** My measured mix — 96.5%
  cache hits, 213:1 input-to-output — is what unattended sessions do to the
  shape of a bill. A fleet runs hotter, longer, and flatter than a
  developer's working day, and the average has no tail for it.
- **They predate your prompt habits.** Cache miss rates, thinking budgets,
  and team-of-agents concurrency are all local choices with local bill
  consequences. The average cannot see them; your `/usage` breakdown and
  OpenTelemetry export can.

## The controls that actually bind

Vendor-documented, all verified 2026-11-30 in the [cost
documentation](https://code.claude.com/docs/en/costs): `/usage` for session
cost and plan-window state, with a breakdown attributing recent usage to
skills, subagents, and MCP servers; a prompt-cache line (Claude Code
v2.1.251+) reporting the share of input tokens served from cache, the
misses, and whether the cache is warm — this guide's central quantity,
reported live; workspace spend limits for API
organizations; per-member and per-organization spend caps where usage
credits are enabled; model matching — Sonnet for most work, Opus reserved
for the requests that need it; `/clear` between unrelated tasks, since stale
context rides along on every subsequent message; and OpenTelemetry export,
which the docs call the only option that streams per-user token and cost
metrics into your own stack across every setup.

Mine, structural rather than habitual, because a fleet does not form
habits: forecast the window instead of watching the meter; scale headcount
instead of throttling requests; convert every token to list price so the
outcome math stays computable; and brake hard before the provider's ceiling
instead of discovering it. Each of those is a property of the system around
the agents, not a setting inside them — which is the recurring lesson of
[every failure that changed how the fleet is
built](/guides/agent-orchestration/#failure-modes-that-changed-the-design).

## Verified on

The operating claims come from the stack I run agents on, October 2026:

| Layer | What I run |
| --- | --- |
| Host | One bare-metal server, reached only over a mesh VPN — no public ports |
| Agent harness | Claude Code, headless, plus adapters for other agent CLIs |
| Tracker | [`bead-rs`](https://github.com/jedarden/bead-rs) — repo-local SQLite queue, atomic claims, Git-tracked checkpoint |
| Orchestrator | NEEDLE — deterministic claim → dispatch → outcome loop, agent-CLI-agnostic |
| Fleet substrate | `tmux` sessions, one supervisor per worker |

Disclosure, same as always: the tracker and the orchestrator are mine, which
matters for the claims about how pricing conversion and window forecasting
behave — you should know the author of the claim is also the author of the
code.

Vendor documentation verified **2026-11-30**; plan tiers first re-read
**2026-11-11** when Max 20x became Ultra (prices move fast; re-verify before
building on any specific line):

- [Claude plans and pricing](https://claude.com/pricing) — plan prices,
  five-hour and weekly windows, shared-pool wording, usage credits, the Max
  and Ultra API-credit amounts (2026-11-30, unchanged from 2026-11-11)
- [Manage costs effectively (Claude Code docs)](https://code.claude.com/docs/en/costs) —
  the enterprise averages, `/usage` and its attribution breakdown, the agent-team
  token multiplier, background-usage figure, spend controls
- [Claude API pricing](https://platform.claude.com/docs/en/about-claude/pricing) —
  per-model input, output, and cache rates; the Haiku 100K prompt split

## Where to go deeper

- [AI coding plans vs. API pricing](/data/inference-plans/) — the maintained
  comparison this guide draws its measured mix from: 25+ subscriptions
  converted to tokens per dollar, with source-checked prices, automation
  rules, and a changelog.
- [The unit economics of running cattle](/notes/unit-economics-of-cattle/) —
  cost governance as its own component: forecast, headcount, and cost per
  closed outcome.
- [Agents, pets, and cattle](/notes/agents-pets-cattle/) — the parable, and
  the quarter-of-the-limit story that started this thread.
- [What breaks at twenty agents](/notes/what-breaks-at-twenty-agents/) — the
  failure taxonomy, including the ones that show up as line items.
- [Agent orchestration in production](/guides/agent-orchestration/) — the
  control loop a fleet needs before cost becomes a line item:
  [budgets and observability](/guides/agent-orchestration/#budgets-and-observability).
- [Claude Code agent teams](/guides/claude-code-agent-teams/) — the
  documented feature behind the 7× token multiplier, and what it changes.
- [How to roll out AI coding tools to a team](/guides/rolling-out-coding-agents/) —
  where per-user spend visibility fits in a rollout, and why the pilot sets
  the alert thresholds.