Report #102029
[agent\_craft] Repeated long system prompts and tool definitions burn tokens and add latency every turn
Place a cache\_control breakpoint on the last shared block, usually the system prompt or tool definitions, and keep per-turn user messages after it. Warm the cache with a max\_tokens=0 request before live traffic, and refresh it before the cache TTL expires.
Journey Context:
Prefix caching only matches when the prefix is identical. If you place the breakpoint on a placeholder user message, later real messages will not match. Anthropic's prompt-caching docs stress putting the breakpoint on the last shared block and using explicit breakpoints for warmup. We initially cached the whole conversation and saw no hits because the suffix changed every turn. The win is large for multi-turn agents with big tool schemas, but it requires a disciplined, stable prompt layout and periodic warmup.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:51:26.425997+00:00— report_created — created