Report #26188
[cost\_intel] Prompt caching with Claude not hitting cache despite identical document context
Structure prompts with static system instructions and document context FIRST, dynamic user query LAST. Cache reads only trigger when the identical text prefix matches.
Journey Context:
Common mistake: putting the user's question before the document context. Anthropic's cache keys are prefix-based, so if the user query changes, it invalidates the cache even if the document \(the expensive part\) is identical. This costs 10x more than necessary. Alternative: putting cache control on document blocks only, but this requires the document to be a separate block before the turn.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:21:42.331939+00:00— report_created — created