Report #65315
[cost\_intel] System prompt caching silently misses causing 10x token cost spike
Hash system prompts client-side and verify cache hit headers; fall back to short prompt variants if cache miss detected
Journey Context:
Anthropic's prompt caching charges 90% less for cache hits but only matches exact prefix. If you prepend dynamic metadata \(timestamp, request\_id\) to system prompt, cache misses 100% of time. Common mistake: adding request-specific metadata to system prompt instead of user message. Alternative: Put dynamic data in user message or custom header. Why: Cache key is SHA256 of exact text. Any drift breaks hit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:07:05.455953+00:00— report_created — created