[Question/Bug] Context compaction silently unmounts container tools & tool_search (Per-turn reconstruction issue) #782
Replies: 1 comment
-
|
This is a known behavior in Claude's context management — not a bug per se, but an architectural choice with sharp edges. Here is what is happening and what you can do about it. What is actually happeningClaude does not keep the full tool registry in context across compactions. Instead, it uses a per-turn tool set reconstruction policy:
This explains your exact observations:
Why this is a problemThe heuristic is reasonable for conversation-specific tools (you talked about Notion → keep Notion tools). It is catastrophic for infrastructure tools that are needed regardless of topic:
Without these, the conversation is deadlocked. You cannot search for tools to re-enable because the search tool itself was dropped. Workarounds1. Explicitly re-request tools (fastest recovery)When you notice tools are missing after compaction, ask Claude directly:
Claude can sometimes re-request tool registration, though success varies by client implementation. 2. Keep one infrastructure tool "warm"Periodically invoke a lightweight infrastructure tool (like 3. Start a new conversation before compactionThe most reliable fix: when the conversation approaches its context limit, explicitly ask Claude to summarize the state, then start a new conversation with that summary. The new conversation gets the full tool registry. 4. File a feature request with AnthropicThe root cause is architectural: container tools and Is this an MCP protocol issue?No. MCP has no concept of "context compaction" or "tool mounting/unmounting." These are entirely host-side (Claude) decisions about how to manage the LLM's context window. The MCP server faithfully reports its tools on every The protocol provides no mechanism for a server to declare a tool as "pinned" or "system-critical." If you want to advocate for this, the right venue is an Anthropic feature request, not an MCP spec change. A possible MCP-level improvement would be a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Question Category
Your Question
Context & Environment:
Across multiple long, compacted conversations using Claude Desktop and MCP, I am observing a critical issue where post-compaction turns expose a small, turn-varying tool set.
The Issue:
After context compaction occurs, basic container tools (e.g.,
bash,view,str_replace,create_file,present_files), document readers, web tools, and critically,tool_search, are completely unmounted.However, specific external MCP tools (for example, Room A = 8 Notion tools; Room B = 7 Notion + 5 custom tools including 3 chain_* tools NOT present in earlier turns) successfully survive and remain mounted.
Key Observations:
tool_search(the only in-room recovery path) is also unmounted, in-room reload-recovery becomes impossible.Questions for the Team:
tool_searchalso unmounted? Removing the search tool effectively destroys the user's only path to recover the lost container tools.Any insights regarding how tool definitions are handled during compaction would be highly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions