Report #98119
[cost\_intel] Anthropic prompt caching destroyed by one dynamic token in the system prompt
Split the prompt into multiple cache\_control breakpoints: tools first, then static system instructions, then dynamic context. Keep each breakpoint block byte-identical across requests, and move variable content downstream of the last breakpoint.
Journey Context:
Anthropic requires 100% identical prompt segments for a cache hit and builds the prefix in fixed order: tools, system, then messages. A common mistake is a single monolithic system prompt that includes 'Today is \{date\}', which invalidates the whole cache on every call. Anthropic also charges cache writes at 1.25x base input \(5-minute TTL\) or 2x \(1-hour TTL\), so a miss is actively more expensive than no caching. Multiple breakpoints let stable material stay cached while per-request variables live after the last breakpoint.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T05:15:39.582774+00:00— report_created — created