By Sagar Shankaran, Founder of CallSphere
A realistic end-to-end build: how a support-agent team cut latency and cost with prompt caching on Claude, from slow response to a shipped, measured win.
Key takeaways
Abstract advice about prompt caching with Claude is easy to nod along to and hard to act on. So this post does something different: it walks through one realistic build from the symptom that started it to the shipped, measured outcome. The team is a fictional-but-typical one — a five-person group running a customer-support agent on Claude that answers questions over a product knowledge base and can call a few tools. Their problem is concrete, their fix is concrete, and every decision along the way is one you will face if you do this yourself.
We will not skip the messy parts. The first attempt does not work cleanly, the cache mysteriously stops hitting, and the team has to debug it. That is the realistic path, and seeing it end to end is more useful than a tidy success story.
The team's support agent works like this. Each user question is answered by Claude with a hefty request: a detailed system prompt describing tone and escalation rules, definitions for four tools (order lookup, refund status, shipping estimate, and a knowledge search), and a chunk of frequently-referenced policy text pasted inline so the agent answers consistently. Then the user's actual question is appended at the end. Every single request reships that entire stable mass — easily several thousand tokens — before the model even sees the question.
Two symptoms drove the project. First, time-to-first-token was poor: users waited noticeably before the answer began streaming, because the model had to process those thousands of prefix tokens every time. Second, input cost dominated the bill. The answers were short, but the input was enormous and repeated on every request. The team realized the same multi-thousand-token prefix was being reprocessed thousands of times a day, identical each time. That is the textbook signature of a workload that caching was built for.
The fix began not with the API but with the request layout. The team reorganized every request into a strict order: system prompt first, then tool definitions, then the inline policy text, then — and only then — the user's question and any per-conversation context. The principle was simple: everything that is identical across requests goes up top, everything that changes goes at the bottom. Then they placed a cache breakpoint at the boundary between the stable mass and the user turn.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
Here is the shape of the restructured request. The cacheable block is everything in the system content; the user turn carries only what is specific to this conversation:
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": SYSTEM_PROMPT + TOOL_DOCS + POLICY_TEXT,
"cache_control": {"type": "ephemeral"}
},
{
"type": "text",
"text": f"Customer question: {question}"
}
]
}
]
The key line is cache_control on the stable block. It tells Claude this prefix is a caching boundary: process it once, reuse it on subsequent requests that begin with the identical bytes. The user's question, appended as a separate piece with no cache marker, is the volatile tail that changes every call. On the first request, the team saw cache_creation_input_tokens jump — the cache was being written. They expected the next request to read it back cheaply.
flowchart TD
A["User asks a question"] --> B["Assemble request: system + tools + policy, then question"]
B --> C{"First request with this prefix?"}
C -->|Yes| D["Cache write: process whole prefix"]
C -->|No| E["Cache read: skip prefix processing"]
D --> F["Claude answers, may call a tool"]
E --> F
F --> G["Stream answer, log usage fields"]
G --> H{"cache_read ratio rising?"}
H -->|No| I["Debug volatile leak in prefix"]
H -->|Yes| J["Win confirmed, monitor"]
It did not work on the first try. The team shipped to staging, ran a hundred test questions, and saw cache_creation_input_tokens on nearly every request — the cache was being written constantly but almost never read. Costs had not dropped. This is the most common caching surprise, and the cause is almost always the same: something in the supposedly-stable prefix was not actually stable.
They bisected. By logging the exact prefix bytes and diffing two consecutive requests, they found it: the policy text was being assembled from a dictionary whose key order was not fixed, so the serialized policy came out in a slightly different order each time. The bytes differed, so Claude correctly treated each as a new prefix and wrote a fresh cache entry it would never read again. The fix was one line — sort the keys before serializing — and suddenly the second request and every one after it showed a large cache_read_input_tokens value and a near-zero creation value. The cache was warm.
The lesson the team wrote into their runbook: a cache that always writes and never reads means your prefix is not byte-stable. Diff two consecutive prefixes and find the wobble. It is never the API; it is always something in your own assembly that you did not realize was non-deterministic.
With the cache warm, the results were exactly what the workload predicted. Time-to-first-token on the hot path dropped sharply, because the model no longer reprocessed thousands of prefix tokens on each request — it read them from cache. Per-request input cost fell substantially on every cached read, since cache-read tokens are far cheaper than fresh input tokens. Critically, the team confirmed with an eval suite that answer quality was identical: caching changed the cost and speed of producing the same outputs, not the outputs themselves.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
They also learned where caching did not help. A handful of admin and onboarding flows ran each prefix only once or twice; there, caching paid the write premium without enough reads to recover it, so they left those uncached. The win was concentrated exactly where the brief promised: the high-traffic path with a large, repeated, stable prefix.
| Aspect | Before caching | After caching |
|---|---|---|
| Prefix processing | Reprocessed every request | Processed once, then read from cache |
| Time-to-first-token (hot path) | Slow, noticeable wait | Markedly faster |
| Input cost per request | High and repeated | Low on every cache read |
| Answer quality | Baseline | Identical (verified by eval) |
cache_read vs cache_creation from day one, which is how they caught the silent miss immediately.The structural work — reordering the request and adding a breakpoint — is often an afternoon. The realistic time sink is the debugging detour when the cache does not hit, plus writing the eval to confirm quality. Budget a few days end to end for a careful first rollout, much less for subsequent ones once the team knows the pattern.
Less so. Caching pays off when the stable prefix is large and reused often; a small prefix gives little to save. If your requests are dominated by a short instruction and a long user turn, caching will not move your numbers much, and you can skip it for that path.
They ran the same set of inputs through the agent before and after the caching change and compared outputs with an eval suite. Because caching only affects how the prefix is processed, not the model's reasoning, the answers matched — and having that proof on record prevented future false blame.
Reusing the multi-thousand-token stable prefix on the high-traffic path. That prefix was being reprocessed on every one of thousands of daily requests; turning those into cheap cache reads is where almost all of the latency and cost improvement came from.
This same end-to-end discipline — find the hot path, restructure, measure, ship — is how CallSphere builds agentic voice and chat assistants that answer every call and message, use tools mid-conversation, and book work 24/7. See it live at callsphere.ai.
Source & attribution: This is an independent, original explainer inspired by Anthropic's coverage on the Claude blog. Claude, Claude Code, Claude Cowork, Claude Opus, and the Model Context Protocol are products and trademarks of Anthropic. CallSphere is not affiliated with or endorsed by Anthropic.

Written by
Sagar Shankaran· Founder, CallSphere
LinkedInSagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
Anthropic's Claude Fable 5 and Mythos 5 explained: pricing, availability, frontier benchmarks, the dual-model safeguard architecture, and what they mean for AI agents.
Where Claude Code, MCP, and multi-agent systems are taking GTM engineering next, and how to prepare your team now for standing and multi-agent workflows.
Where Claude Cowork and the Claude agent ecosystem are heading next — standing agents, MCP, skills as a moat — and the concrete moves to prepare your team now.
The metrics, leading signals, and anti-metrics that prove Claude Cowork is working — acceptance rate, time-to-outcome, and why usage counts mislead.
Shipping an agentic GTM workflow is easy; proving it works is hard. The metrics, signals, and eval loops that show a Claude Code rebuild is paying off.
A realistic end-to-end Claude Cowork use case: a quarterly vendor-spend review from vague ask to shipped deliverable, with every agentic step shown.
© 2026 CallSphere Inc. All rights reserved.
Made within San Francisco
Watch how CallSphere handles real customer calls, schedules appointments, and processes payments — live.
Try Live DemoBook a DemoCalculate Your ROI