Loading
perf(anthropic): place cache breakpoints on final two messages
The prompt-cache breakpoint was placed on a single message (the penultimate one). Because an agentic turn appends several message blocks (assistant tool_call -> tool_result -> ...), that single breakpoint can drift more than Anthropic's 20-block lookback window behind the current position. When it does, the next request fails to prefix-match and pays for a fresh cache write instead of a cheap read. Place breakpoints on the last two messages instead. The second trailing breakpoint keeps a prior write inside the lookback window as the conversation grows, so subsequent requests read the cached prefix. Breakpoints are free (you only pay for tokens actually written/read), so this raises the cache hit rate in multi-turn tool-using sessions at no cost. Refs prompt-caching lookback semantics: https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching