Claude Code now warns in the log when a custom endpoint is throwing away your prompt cache.
What's wrong with this entry?
Claude Code now watches whether prompt caching is actually taking effect. After three turns in a row with 20,000 or more input tokens and essentially no cache being written or read, it logs a warning that a custom endpoint is discarding the cache, which shows up as slower, more expensive turns.
- Emits
api_prompt_cache_coveragewith acache_coverage_lossoutcome plus the consecutive-turn count and token counts. - A one-time confirmation on the same event fires instead when caching is seen working.
- The check runs for providers reached through a gateway, and conditionally for the first-party API.
sustained uncovered input with a cache breakpoint on the wire through a custom endpoint
Strings lifted out of the shipped bundle, so the claim above can be checked against them.