Claude Code Cost: What Running Coding Agents Actually Costs

agentscostclaude-codeai-coding-toolsfleet-ops

Last verified:

On this page
  1. The token cost: cache is the whole story#
  2. Subscription or API: the allowance conversion problem#
  3. Cost per closed outcome, not cost per token#
  4. What the vendor benchmarks measure — and what they miss#
  5. The controls that actually bind#
  6. Verified on#
  7. Where to go deeper#
For terminals & agents: curl -s https://jedarden.com/guides/coding-agent-costs.md

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.

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 as a parable about pets and cattle; it is also the reason this site maintains a subscription-versus-API comparison. 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 — 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. 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) for the models coding agents actually run:

ModelInputOutputCache writeCache 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

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 — one real session, billed:

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.

The billed lines
LineTokensCost (Sonnet 4.6 rates)
Fresh input1.2k$0.00
Output5.3k$0.08
Cache write50.0k$0.19
Cache read940.0k$0.28

My own measurement agrees. The inference-plans artifact 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
The measured buckets
BucketShare of all tokensPer 1M output
Fresh input2.794%5.985M
Cache reads96.082%205.776M
Cache writes0.657%1.406M
Output (incl. billed reasoning)0.467%1.000M

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:

ModelBilled per 1M outputShare that is outputShare 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%
The per-model totals
ModelBilled per 1M output tokens
Opus 5.5$92
Sonnet 5.5$46
Haiku 5.5 (over 100K)$17

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: 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 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:

PlanPrice
Pro$20/month
Max$100/month
Ultra$200/month

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

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):

Week by week
ISO weekEst. list-price useOne plan-dollar bought
W35$1,53633.3×
W36$4,31893.6×
W37$2,60656.5×
W38$2,29249.7×
W39$1,50732.7×
W40$92320.0×
W41$2,01843.7×
W42$1,07223.2×
W43$1834.0×
W44$551.2×

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 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:

Week by week
ISO weekPeak use of the weekly window
W3880%
W3946%
W4030%
W41100% (cap hit Oct 12–13)
W4271%
W4351%
W4448%
W4555%

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. The vendor’s own rate guidance 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 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; 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 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: /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.

Verified on#

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

LayerWhat I run
HostOne bare-metal server, reached only over a mesh VPN — no public ports
Agent harnessClaude Code, headless, plus adapters for other agent CLIs
Trackerbead-rs — repo-local SQLite queue, atomic claims, Git-tracked checkpoint
OrchestratorNEEDLE — deterministic claim → dispatch → outcome loop, agent-CLI-agnostic
Fleet substratetmux 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 — 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) — the enterprise averages, /usage and its attribution breakdown, the agent-team token multiplier, background-usage figure, spend controls
  • Claude API pricing — per-model input, output, and cache rates; the Haiku 100K prompt split

Where to go deeper#