Replies: 1 comment
-
|
Your diagnosis is technically correct — tools are part of the prompt cache prefix, so removing one (or adding, or reordering) invalidates the cached prefix from that point forward. The cost jump matches: removing The hash data in your forensic logs (system block hashes, tools Two follow-ups from your data:
Thanks for the dashboard work — this is the kind of forensic detail that makes proxy-layer debugging tractable. — Chris |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Possible cache bust when Advisor mode changes tool set
I think I may have found a prompt cache bust related to Advisor mode / tool-set changes in Claude Code. It often happens around 5 minutes after the advisor is called.
I built a small live dashboard that leverages
quota-status.js/ the quota status history JSONL to watch cache reads, cache writes, hit rate, tool diffs, model usage, session totals, and per-request cost in real time. That dashboard surfaced this pattern.Environment
26200.80372.1.1193.2.0What I observed
During a long-running session, the prompt cache appeared stable, then completely missed when Advisor disappeared from the available tool set.
#139$0.0339#140$0.0314#141$0.2967-advisor#142$0.0305+advisor#143$0.0290Important transition:
Why I think this matters
This looks like removing advisor from the tool set invalidated the prompt cache. The request did not look like a new session, model switch, or normal subagent cold start. It looks like a tool-list mutation caused the cached prefix to miss.
Since tools are part of the prompt cache prefix, changing the available tool definitions mid-session could force a full cache rewrite. In this case, the cost for the affected request was roughly 9-10x higher than the surrounding requests.
Question
Is this expected behavior when Advisor mode toggles tools?
If yes, it might be worth documenting that enabling/disabling Advisor mode can bust prompt cache. If no, perhaps Claude Code should keep the advisor tool stable in the tool list and simply choose not to call it unless Advisor mode is active.
Raw logs for forensics
Beta Was this translation helpful? Give feedback.
All reactions