How-to

Claude Caching Helps. Unstable Prefixes and Stale Sessions Waste the Savings.

November 24, 2026

Claude Caching Helps. Unstable Prefixes and Stale Sessions Waste the Savings.

A support agent may send the same product policy and tool definitions with every customer question. If a timestamp changes inside the system prompt, the prefix may stop matching and Claude may have to process it again. Elsewhere, a coding session can carry yesterday’s test output into an unrelated task, sending context the new task does not need.

These are different sources of token waste. Prompt caching can make repeated input cheaper, but it does not remove that input from the request. Session hygiene limits what gets carried forward, but a fresh session does not make a changing prompt cacheable. For builders, the practical approach is to stabilize the context worth reusing, then stop carrying context that no longer belongs.

API caching makes repeated prefixes cheaper, not smaller

Claude prompt caching lets the API reuse a matching prompt prefix. Content must match through the cache breakpoint; changes before that point can prevent reuse of the cached content after it. 1, 2

“Prompt caching is a prefix match. Any change anywhere in the prefix invalidates everything after it.”

— Anthropic 3

Caching changes the price of repeated input, not whether the conversation is sent again. Anthropic’s cost guidance describes agent turns as resending the growing conversation, with cached input billed at a lower read rate than standard input. In the documented Claude API pricing, cache writes cost more than standard input: 1.25 times the normal input price for a five-minute cache and twice the price for a one-hour cache. Rates and behavior can vary by model and platform, so check the pricing for your specific setup before estimating savings. 4, 5

Keep the goals distinct:

  • Make necessary repeated context cheaper: stabilize the prefix and cache it.
  • Avoid unnecessary context: clear, compact, or isolate work that no longer belongs in the session.

A cache hit can reduce the cost of a large conversation without making that conversation smaller.

Freeze the API request’s leading content

For the Claude API, the cache prefix is formed in this order: tools, system, then messages. A change near the beginning can disrupt reuse farther down the prefix. 1, 3

Put stable content first and keep it byte-for-byte consistent across requests. Tool definitions, system instructions, shared context, and examples are candidates for the stable beginning of a prompt. 1

“Place static content (tool definitions, system instructions, context, examples) at the beginning of your prompt.”

— Claude Platform documentation 1

Sort prompt content by how often it changes:

  1. Shared content: core instructions and tool definitions that rarely change.
  2. Session-specific content: project background that stays fixed during one task.
  3. Turn-specific content: the current question, new tool results, or updates.
  4. Request-specific values: timestamps, request IDs, or other values that change every call.

Keep volatile values out of the early prefix. A timestamp or user ID in the system prompt can make otherwise similar requests unique. Tool order and schema serialization matter too: keep the tool list fixed and serialize it deterministically. Move changing values later in the request where possible. 3, 6

For a multi-turn API conversation, append to the history rather than rewriting earlier messages. Edited or reordered history can cause misses; Anthropic’s diagnostic guidance recommends treating history as append-only and returning assistant content and tool results verbatim. 6

Place the breakpoint where stability ends

For API requests, automatic caching is a reasonable starting point when it fits the request pattern. The Claude Cookbook recommends it for most use cases; explicit breakpoints provide more control over what gets cached. 7

“Key takeaway: Place cache_control on the last block whose prefix is identical across the requests you want to share a cache.”

— Claude Platform documentation 1

In practice, put the breakpoint after shared content, not after a question that changes with every request. This schematic shows the stable system block before the variable user message:

system block
  shared support instructions and product policy
  cache_control: ephemeral

user message
  customer-specific question

In a real request, keep any tools and other content before the breakpoint stable too. The Messages API supports cache breakpoints on content blocks, with five-minute and one-hour TTL options. Caching also has minimum prompt-length requirements that vary by model and platform; a breakpoint alone does not guarantee a cache entry. 1, 8, 9

The default cache lifetime is five minutes; a one-hour duration is available at additional write cost. Time spent generating a response counts against the cache lifetime, and using a cache entry refreshes it. Choose a longer TTL only when the gaps between requests justify its higher write price. Changing duration mid-conversation can require rewriting the cache. These details are specific to the relevant Claude API and model behavior, so verify them for your deployment. 1, 5

Diagnose a miss before adding breakpoints

For API requests, inspect cache_read_input_tokens and cache_creation_input_tokens. The first reports input read from cache; the second reports input written to cache. If reads drop to zero, check whether the prompt meets the minimum length and whether something early in the request changed. 1

Claude’s cache diagnostics can compare request structure and identify the earliest divergence, such as a change to the model, system prompt, tools, or message history. The comparison does not prove that a cache hit occurred, so read it alongside the usage counters. Fix the earliest mismatch first; later ones may be hidden behind it. 6

“Below about 80%, look for something breaking the cache (see What breaks the cache).”

— Anthropic 4

Treat that figure as a troubleshooting signal from Anthropic’s guidance, not a universal benchmark or target. A short task with little repeated context has less to cache than a long-running agent loop. Compare similar workloads and investigate a sudden drop rather than optimizing every request toward one percentage.

Claude Code needs a separate session-scope habit

API cache breakpoints and Claude Code session commands solve different problems. Stable prefixes make repeated context cheaper; session hygiene reduces irrelevant context that would otherwise keep accumulating. In Claude Code, use /clear when switching to unrelated work. Use /compact when you need continuity, while remembering that compaction itself can require a substantial request. 10, 11

“Run /clear between tasks. This prevents prior irrelevant context from being sent back to the model, which can reduce token usage.”

— Claude by Anthropic 10

Give each Claude Code session one objective. Files Claude reads and command output can remain in the conversation and be sent again on later turns. Keep startup instructions focused, move specialized instructions into on-demand skills where appropriate, and use /context to see what is taking up space. Set the model and effort before starting; changing them mid-conversation can disrupt caching, though Anthropic documents exceptions for specific models. 5, 10, 11

A subagent can keep a large read or research task out of the main conversation, but it makes its own requests. Use one when isolating that work is worth the additional calls. As a workflow example, 1 Minute Signal coverage of Tech With Tim describes side chats and sub-sessions for parallel work; it does not measure cache savings. For general background, 1 Minute Signal coverage of IBM Technology explains shared-prefix reuse in LLM serving, not Claude-specific billing.

A short checklist for each surface

For the Claude API: keep tools and system content stable; move changing values later; start with automatic caching unless you need a specific breakpoint; preserve earlier messages in an ongoing conversation; and check cache-read usage when repeated requests should reuse a prefix. If reads disappear, inspect the earliest request difference.

For Claude Code: keep one objective per session; use /context to inspect what is accumulating; use /clear when the task changes and /compact when continuity matters.

The operating principle is simple: cache the context you genuinely repeat, and stop sending context you no longer need.

Share this

Tags

Written by: 1 Minute Signal Editorial Team