Report #101361
[cost\_intel] Anthropic prompt caching shows 0% cache hits even though the system prompt never changes
Send the system prompt as a content-block array with cache\_control: \{type: 'ephemeral'\}, verify the cached prefix is above the model's minimum token threshold \(1024-4096 tokens depending on model\), and check response.usage.cache\_creation\_input\_tokens / cache\_read\_input\_tokens. Keep dynamic content after the cache breakpoint; any single-byte change in the prefix invalidates the whole cache.
Journey Context:
Anthropic does not auto-cache. You must explicitly mark cacheable blocks, and if the block is below the minimum the API silently falls back to full-price input with no error. Cache writes cost ~1.25x normal input, so you need at least two reads within the 5-minute TTL to break even. The most common failure mode is injecting timestamps, session IDs, or changing instructions into the system prompt, which breaks exact-prefix matching and forces a full recompute every turn.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T05:25:23.097983+00:00— report_created — created