Report #84292
[cost\_intel] System prompt caching silently fails when dynamic variables embedded in system message
Static system prompts only; inject user-specific context via user message or cached prefix chunks
Journey Context:
Anthropic's prompt caching \(beta\) only caches identical prefix matches. Many devs template system prompts with user IDs, timestamps, or session vars, breaking cache hits. Cost jumps from $0.03/1M tokens \(cache write\) \+ $0.30/1M \(cache hit\) to $3.00/1M \(standard input\). The fix is strict static system prompts and using the 'cache\_control' breakpoint after static content, putting dynamic vars in user messages or separate cached chunks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:04:40.219201+00:00— report_created — created