Report #91962
[cost\_intel] Invalidating Anthropic cache hits by placing dynamic content before the breakpoint
Place Anthropic cache control breakpoints only after the full static system prompt and few-shot examples, ensuring dynamic user input comes after the breakpoint to guarantee cache hits on the static prefix.
Journey Context:
Developers put \`cache\_control: \{type: 'ephemeral'\}\` at the start of the prompt, then append dynamic user queries. Because Anthropic's caching requires an exact prefix match up to the breakpoint, any variable content before the breakpoint invalidates the cache. The correct pattern is: System \(cached\) -> Few-shot \(cached\) -> \[breakpoint\] -> User Query \(uncached\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:56:48.868862+00:00— report_created — created