Why Claude Code Costs Spike

Claude Code is billed like cloud compute, and that makes the bill as variable as the work. Every API call in an agentic session re-reads the entire conversation history, so token consumption compounds as the session lengthens. The Quesma instrumentation study visualized this effect in a single project session, with context ballooning from a modest starting size to hundreds of thousands of tokens by mid-session. The same study shows that cache reads dominate the cost breakdown, outweighing output tokens by a wide margin. The agent is spending more money re-reading its own history than it is generating new code, and output tokens cost five times input tokens on every current Claude model, so an agent writing long diffs or explanations pays a steep output premium on top of the compounding context costs.

Model choice multiplies every other cost factor before a session even starts

Switching from a cheap model to Claude Opus 5.5 raises the median cost of a 10-to-49-turn session by roughly fifty-five times for the same session length. The model multiplier is especially dangerous when subagents inherit the parent session’s model choice, since each parallel subagent runs its own full token loop at the same per-token rate. Price does not track capability linearly across the model tier. Choosing between a frontier model and a capable cheap model is a per-task decision. Once a developer sets a session to Opus and launches subagents, every spike mechanism that follows is Opus-priced.

Subagent fan-out: how one command becomes dozens of parallel token loops

Subagent fan-out is the mechanism most likely to produce a bill that shocks an engineering team. A single developer command can orchestrate dozens of independent agents, each consuming a full token loop simultaneously. Fan-out is not always visible to the developer who triggers it. High-level commands abstract the subagent spawning, so the person issuing the command may not know how many parallel loops they started. Claude Code’s native session view exposes a running count of active subagents via the subagent panel and the 'claude agents' command, but it does not expose their individual token consumption in real time.

Context resubmission loops and cache misses: how pauses become expensive

Long sessions and breaks are cost events. Claude Code re-reads its full history on every turn, and it loses its cache discount the moment the cache expires. On a Claude subscription within plan usage, the prompt cache has a one-hour time-to-live for the main conversation (subagents and other requests default to five minutes, and the TTL drops to five minutes once usage credits are drawn). If a developer pauses for an hour and returns, the next turn pays full input rates to re-read everything the session has accumulated. The overnight gap produced the smallest re-write cost of the three gaps shown, but the effect is the same: tokens that were cheap cache reads become full-price input reads. Autocompact events, where Claude Code summarizes and truncates context to avoid hitting the model’s context window, can cause additional re-reads as the compressed context is re-ingested. Retry loops during error handling are a specific form of context resubmission: if an agent fails a tool call and retries, it re-sends the full context each time.

MCP server bloat: how tool definitions inflate every turn before work begins

MCP server definitions are loaded into the context window at the start of every session. An ungoverned fleet of connected servers inflates the token count of every single turn before the agent writes a single line of code. Most enterprises do not have visibility into which MCP servers are connected across their agent fleet, which means they cannot assess the aggregate token overhead those servers are adding to every session. Unofficial and shadow MCP servers compound both the cost and the security problem: they add token overhead the security team cannot see and expose credentials and tool surfaces the access team has not reviewed. Shadow MCP servers appear in the OWASP MCP Top 10 (MCP09:2025) specifically because they are deployed outside normal governance processes.

The subscription-vs-API arbitrage and what Anthropic's 2026 policy shift changed

Many teams were absorbing agentic workloads on flat subscriptions that were never priced for them. Anthropic’s 2026 policy enforcement cycle ended that arbitrage and exposed the true token cost of workflows teams had already normalized. The same source documents the Pylon CEO’s $4,000 three-day overage as a concrete individual case.

What the variance between average and outlier spend means for team budgets

The danger for engineering organizations is not the average cost per developer but the variance. A small number of power users running agentic workflows can consume a disproportionate share of the team’s token budget in ways that standard seat-license budgeting cannot absorb. The shift from flat seat pricing to metered token billing means Claude Code spend now has the variance profile of cloud compute. It needs the same allocation, anomaly-alerting, and budget-cap tooling that cloud FinOps applies to EC2 or S3.

Why existing monitoring and security tools don't see these cost drivers as they happen

The cost spikes are predictable in mechanism but invisible in real time to the monitoring tools most organizations already have. Those tools were built to watch humans accessing systems. Claude Code’s native audit trail stops at the moment a tool call begins. As of May 2026, Anthropic’s own documentation explicitly excluded agent activity from Audit Logs, Compliance API, and Data Exports across every plan tier including Enterprise. Anthropic expanded the Compliance API in August 2026 to include session transcripts for supported Cowork and Claude Code sessions on Enterprise plans. The billing event and the security event are both happening in a blind spot: the organization sees the charge after the session ends but has no record of what the agent did to produce it. Firewalls, CASBs, DLP tools, and endpoint agents were all built on the assumption that a human is making the access decision. None of them can see what an AI coding agent is doing inside a session, what tokens it is sending, or whether a subagent fan-out is in progress. Most enterprise shadow-AI inventory programs were designed for the 2024 problem of detecting unsanctioned tool adoption. They miss the 2026 reality, where agentic capability activates silently inside already-approved tools.

Governing agent actions before they run, not reconstructing spend from logs afterward

Controlling Claude Code costs requires intercepting agent behavior before it runs. Before the subagent spawns, before the MCP server loads its definitions, before the cache expires and the full context re-reads at full price, a governance layer needs to be watching. Discovery of every agent, MCP server, and skill running across the fleet is the prerequisite, because an organization cannot set spend policy on agents it does not know are running. Policy should roll out gradually: audit first to establish the baseline, then warn developers in plain language where they work (the terminal, Slack), then enforce approval or block before destructive or expensive actions run. Warnings that explain cost risk at the moment a developer triggers a fan-out command are more effective than a finance report at month-end showing the damage. Unbound sits between coding agents and the systems they touch, governing actions before they run with audit, warn, block, or approve verdicts. It deploys through existing agent hooks and MDM, so developers do not change how they work. In early production deployments, Unbound has intercepted agents restarting services after code changes, pushing commits without instruction, and connecting to unsanctioned MCP servers. Tying agent spend to shipped work, rather than to raw token consumption, is the FinOps principle that separates governance that speeds teams up from governance that slows them down. The goal is not to restrict what agents can do but to make the best engineer’s habits — scoped tasks, appropriate model selection, bounded session length, governed MCP connections — the default for everyone through guidance, control, and reusable skills.