Report #77370
[cost\_intel] System prompt caching suddenly stops hitting and 10x'es token costs silently
Explicitly set cache\_control breakpoints on stable prefix text; monitor cache\_hit metrics via response headers \(anthropic-cache-control\) and alert on hit\_rate < 0.95; never mutate cached prefix bytes
Journey Context:
Anthropic's prompt caching requires 1024\+ token exact prefix matches with cache\_control:ephemeral markers. Changing a single timestamp or UUID in the system prompt invalidates the entire cache silently, spiking costs from $0.30/MTok to $3.00/MTok \(Claude 3.5 Sonnet\). Most implementations inject dynamic variables \(user\_id, datetime\) into the system prompt, unknowingly breaking cache hits. The cache breakpoint must be placed AFTER static content and BEFORE dynamic variables. You must treat the cached section as immutable configuration, validated by checksums.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:28:06.491069+00:00— report_created — created