Claude Code Cost Breakdown: 43% Spent on System Prompts

Claude Code heavy-use logs show fixed context costs 43.3%, and shortening sessions saves more than trimming tool output.
A developer published a week of Claude Code token logs: 2,772 daily calls, 315M cache-read tokens, 2.4M output tokens. Using cost weights of input 1, cache write 1.25, cache read 0.1, output 5, the largest expense is not model responses (25.5%) nor tool output, but the fixed context re-read on every call—system prompt plus tool list—at 43.3% of total cost. Because this overhead is billed repeatedly with each call, the author concludes that shortening sessions and streamlining system prompts and tool sets is more effective than compressing shell output, file reads, and search results. The article notes the data comes from a single heavy user and the weights are self-set approximations, but the structural fact of fixed-context repeated billing remains valuable.
A developer has published a week's worth of Claude Code token logs: an average of 2,772 calls per day, with fixed context (system prompt + tool list) accounting for 43.3% of total cost, while model responses make up only 25.5%. The data shows that shortening sessions saves more money than trimming tool output.
A developer has published a week's worth of their Claude Code token logs: 2,772 calls per day on average, 315 million cached-read tokens, and 2.4 million output tokens. After weighting by cost, the biggest expense is neither the model's responses nor the tool output, but rather the fixed context that gets re-read on every call—the system prompt plus tool list—which accounts for 43.3% of total cost.

A Week of Data at a Glance: High Call Volume, Cache Reads Dominate
This analysis comes from local session logs spanning 2026-10-12 to 10-18, using 7-day daily averages. The three core figures are:
- Daily calls: 2,772
- Daily cache-read tokens: 315M
- Daily output tokens: 2.4M
Nearly 2,800 calls per day means hundreds of model interactions per hour on average—a typical heavy-use scenario. You may not have noticed that cache-read tokens reach 315 million, two orders of magnitude apart from output tokens. This fits the working pattern of agent tools like Claude Code: every round of conversation resends the full context to the model, and the caching mechanism bills this repeated input at a lower unit price.
The author uses the following cost weights: input 1, cache write 1.25, cache read 0.1, output 5. In other words, 1 output token costs the same as 5 input tokens, while cache reads are billed at one-tenth the input price. This weighting system is the prerequisite for understanding the breakdown that follows.
Prompt Caching is a mechanism offered by large model providers such as the Anthropic API: when the prefix portion of a request (e.g., system prompt, tool definitions, long documents) is identical to a previous request, the server can reuse the already-computed KV Cache without re-running forward computation on those tokens. The cached portion is billed at a significantly lower unit price (0.1× the input price in this article), while the first cache write is billed at 1.25×.
For agent tools like Claude Code, every conversation round following a tool call resends the entire "system prompt + tool list + message history." The caching mechanism allows this nearly unchanging prefix to be reused at low cost. This also explains why cache-read tokens reach two orders of magnitude above output tokens—it's not an anomaly, but the inherent shape of the agent's multi-turn loop.
Cost Breakdown: Fixed Context Eats Nearly Half the Budget
The cost share by content slice is as follows:
| Slice | Cost Share |
|---|---|
| Base (system prompt + tool list) | 43.3% |
| Model responses | 25.5% |
| User input + attachments | 21.6% |
| Shell command output | 6.1% |
| Sub-agents | 2.1% |
| File reads | 1.2% |
| Search (grep/glob) | 0.1% |
| MCP and other tools | 0.1% |
| Web scraping | 0.0% |
The most valuable thing about this table is that it overturns two common intuitions.
First, model responses rank only second. The 25.5% share shows that output is indeed expensive (weight 5), but it is not the main cost driver. The real bulk is the system prompt and tool definitions reloaded on every call.
Second, tool output is far less scary than imagined. Shell command output accounts for 6.1%, file reads only 1.2%, and search is nearly negligible. Many developers habitually worry that "tools return too much content and blow up the context," but in this data, waste on the tool side is not the main problem.
System Prompt and Tool Definitions form the fixed prefix of every Claude Code request. The system prompt contains the agent's behavioral guidelines, safety constraints, output format requirements, etc.; the tool list declares all callable tools (file reading, shell execution, search, editing, etc.) in JSON Schema form, each with a name, description, and parameter definitions.
This content barely changes within a single session, yet it is fully resent with every round of calls. In heavy-use scenarios, the more tools and the more detailed their descriptions, the bulkier the fixed prefix—and after being billed across 2,772 calls, it becomes the main cost item. This is precisely the direct basis for the article's recommendation to "streamline custom system prompts and tool sets."
Why Shortening Sessions Beats Trimming Tool Output
The author's conclusion is straightforward: since the largest slice is the fixed context re-read on every call, making sessions shorter yields more obvious savings than trimming tool output.
The mechanism behind this judgment is not complicated. The size of the fixed context (system prompt + tool list) is independent of session length, but it is billed repeatedly on every call. The longer the session and the more calls, the more this fixed overhead gets multiplied. An average of 2,772 calls per day means this 43.3% cost is repeated 2,772 times.
By contrast, tool output only affects the context increment of a single call or a few calls, and shell output, file reads, and search combined amount to less than 8%. Spending effort compressing these has a poor return on investment.
For developers who heavily use agent coding tools, the actionable optimization directions thus become clear:
- Split long tasks into multiple short sessions, and end sessions promptly once goals are achieved
- Streamline custom system prompts and tool sets to reduce the fixed portion re-read on every call
- Focus on the call-count multiplier rather than the bytes returned by a single tool
The multiplier relationship between session length and call count is key to understanding this conclusion. The cost formula for fixed context can be approximated as: fixed prefix token count × call count × cache-read unit price. Shortening sessions does not change the size of the per-call prefix, but directly reduces the multiplier of call count; trimming tool output only affects the incremental portion of individual rounds and has no effect on the multiplier.
In other words, the former is "reducing the number of multiplications," while the latter is "reducing the addend of one term." Given that tool output totals less than 8%, the optimization lever naturally falls on session management.
The Boundaries of This Data
It should be noted that this is a single user's personal logs. An average of 2,772 calls per day represents quite high usage intensity and may not represent the usage distribution of ordinary users. The cost weights are also approximate values set by the author; under different models and billing tiers, the absolute shares of each slice will change.
But the structural fact it reveals still has reference value: in agent-style coding tools, the repeated billing of fixed context is an easily overlooked cost item—and it happens to be the largest share. For teams looking to control Claude Code usage costs, this perspective is worth considering.
Related articles

Bilibili's Hit Dify Tutorial: A Practical Guide to Building 20+ AI Apps from Scratch
A distilled guide to Bilibili's top-rated Dify tutorial: Windows + Docker deployment, MySQL connection, five app types, model integration strategy, and publishing.

Agent Skills Beginner's Guide: From Concepts to Multi-Agent Collaboration in Practice
A comprehensive guide to Agent Skills: core concepts, components, the importance of Description, standardization, beginner learning paths, and multi-agent collaboration.

One Neuron Detects Both Cats and Cars? We Reproduced It and Found a New Explanation
The cat-car neuron reinterpreted: researcher Cammarata argues it distinguishes pointy from round, not cats from cars. We reproduced the experiment and found the new explanation holds on most inputs—but cars are the exception. The interpretability debate continues on language models.