Claude Caching Cuts Input Costs. It Won’t Fix Bloated Context.
Claude can repeatedly process the same instructions, tool definitions, files and conversation history. Prompt caching can make that repeated input cheaper. It does not make the context smaller.
That distinction matters for builders: caching targets the bill for repeated input, while context control removes material Claude no longer needs. If you treat those as the same problem, you can end up with a lower input cost but a still-cluttered session—or carefully trimmed context that keeps missing the cache.
Cache the stable prefix
For API users, prompt caching lets Claude reuse a matching prompt prefix instead of processing it from scratch. Anthropic’s prompt caching documentation describes a default five-minute cache lifetime that refreshes when cached content is used. The documentation lists a 1.25× base input price for a five-minute cache write and 0.1× for a cache read, with model- and platform-specific details to check against current pricing.
That means a cache write is not free. The savings come when the same prefix is reused: keep paying to write it once, then pay the lower read rate on subsequent requests while the cache remains available. The cost-optimization guidance says the 25% write markup pays back on the second request that hits the cache. If your prompt changes every time, or requests arrive after the cache expires, that calculation may not hold.
The practical rule is to put durable material first: tool definitions, system instructions, shared reference material and examples. Put the changing user request, timestamps and other per-request details after it. In the API, mark the end of the reusable prefix with cache_control.
“Place
cache_controlon the last block whose prefix is identical across the requests you want to share a cache.”— Anthropic 1
A cache hit requires the prefix to match exactly. A change at or before the breakpoint can invalidate the cached portion that follows, so adding a changing value near the top of a prompt can defeat reuse. Anthropic’s prompt-cache rules also note that prompts below the model’s minimum cacheable length are processed without caching, and may not produce an error. Check usage fields such as cache_read_input_tokens and cache_creation_input_tokens; don’t assume the presence of a breakpoint means the cache is working.
Claude Code handles prompt caching for you, so the main levers there are often session design and context control rather than manually setting API breakpoints. In either case, caching changes the price of repeated input, not how many tokens occupy the context window. The context-window documentation makes that distinction explicit: cached prefixes still count toward the window.
Remove context that no longer earns its place
In Claude Code, files Claude reads and command output can remain in the conversation and be sent again on later turns. Caching can make those resends cheaper, but it does not remove them from the context. Anthropic’s guide to Claude Code sessions describes the cost as accumulating across turns: a long session can keep carrying earlier work into later requests.
“You want the context in your session to be short and relevant, so don't carry one task's context into the next:
/clearwhen you start something new, and/compactwhen the earlier part of the same task is done.”— Claude by Anthropic 5
Use /clear between unrelated tasks. For a continuing task, use /compact when earlier investigation has stopped being useful, and tell Claude what the summary must retain. Compaction is lossy, so preserve decisions, unresolved questions, relevant files and test results rather than asking for a generic summary. It also takes a request to summarize the conversation; Anthropic’s Claude Code guidance cautions that a long compaction can itself be costly, particularly after the cache has expired.
Avoid feeding Claude broad, noisy inputs in the first place. A specific request that names the failing test or relevant file can avoid exploratory searches and reads. Use quiet test-runner flags, filter logs before sending them, and return summaries rather than entire tool outputs when the full output is not needed. The cost-management guide recommends using /usage to inspect where usage is going; /context can help identify what is filling the current session.
Tooling is another source of repeated input. Tool definitions consume context, as do accumulated tool results. If an agent has many tools but uses only a few on a given turn, Anthropic’s tool-context guidance describes deferring tool definitions until needed, and using programmatic tool calls to keep intermediate results out of the conversation. These techniques trade off against convenience or latency, so test them on the actual workload. They are most relevant when tool lists or repetitive tool outputs are a meaningful share of the request.
Keep persistent instructions small and current
Context waste can start before the first prompt. CLAUDE.md is loaded at session start in the Claude Code setup described by 1 Minute Signal’s coverage of Mervin Praison. That coverage recounts a narrow project test in which stale instructions remained in the file after the work had changed; it is an example of a risk to audit, not evidence that every setup behaves the same way. 8
“The checkable risk here is persistent instructions nobody rereads.”
— 1 Minute Signal coverage of Mervin Praison 8
Keep project-level instructions focused on rules that matter across tasks. Move specialized workflows into on-demand skills where appropriate, and review persistent notes when they may have become obsolete. The Claude Code cost guide recommends keeping CLAUDE.md concise and moving detailed, workflow-specific instructions into skills that load only when invoked.
For API users, the equivalent is separating a durable system prompt from task-specific data, while checking that the durable portion is actually reused. For both API and Claude Code users, don’t assume that a larger context is automatically better: relevance matters as well as length. Anthropic’s context-editing documentation describes clearing old tool results as one option for long-running workflows, but warns that clearing can invalidate cached prefixes. Batch clears rather than repeatedly removing small amounts, and compare the cache impact with the context-space benefit.
Measure the savings you actually care about
Token reduction is not the same as cost reduction. A recent test summarized in 1 Minute Signal coverage of Nate Herk | AI Automation reported that experimental Claude Code code mode reduced input tokens by about 35% across five comparisons, but by about 17% after cost weighting; three runs were slower. The sample was small and self-reported, so it is a useful reminder to measure your own workflow, not a general performance guarantee. 10
Track cache reads and writes, uncached input, output tokens, latency and task quality. For API calls, compare the actual usage fields across repeated requests. For Claude Code, inspect /usage and /context, then change one thing at a time: prompt structure, tool loading, output filtering or session boundaries. If a change reduces raw input tokens but increases cache writes or slows the workflow, it may not be a net win.
A sensible order is: enable or verify caching for stable, repeated input; remove irrelevant history between tasks; reduce noisy outputs and unnecessary tools; then compact or clear context when it no longer serves the current work. Caching makes repeated context less expensive. Context control makes sure you are not repeatedly carrying context that should have been removed.