When a long session silently stops hitting cache, the usage block proves it broke but not where. Anthropic's now-GA cache diagnostics fingerprints each request and, given the previous response id, tells you the first point the prefix diverged - model, system, tools, or message history - so you fix the root cause instead of diffing a giant payload by hand.
Ask the API Where Your Prompt Prefix Diverged Instead of Hashing Blocks by Hand
Unlock this tip — and 131 more
This is one of 132 advanced, fact-checked tactics reserved for Pro. Get the full 154-tip library, a searchable archive, and a new tip every morning. Free for 7 days, then $9/mo.
Prefer to browse? The 22 Beginner tips are free forever.
More in Prompt Caching & Reuse
Freeze the Prefix: One Stray Timestamp Kills Your Whole Cache
Prompt caching is a prefix match. A single dynamic byte near the top of your prompt silently invalidates everything after it, so you pay full price every call without realizing it.
Share One Cached System Prompt Across All Your Users
A single per-user byte (name, ID, locale) in the system prompt forks the cache into one entry per user. Strip personalization out of the prefix so every user reads the same cached block.
Cache Your Tool Definitions, Not Just the System Prompt
Tool schemas render before the system prompt, so a non-deterministic tool list silently blocks the cache for everything after it. Sort and freeze the tool array to make tools cacheable.