[BUG] MCP server tools unavailable after /clear in VS Code extension
Status Fixed / completed
Reported on v2.1.132
Maintainer reply ✓ Yes — localden
Workaround ✓ Mentioned in thread ↓
Activity 6 comments · opened May 7, 2026 · closed May 8, 2026
💡 Likely answer: A maintainer (localden, collaborator)
responded on this thread — see the highlighted reply below.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
After running /clear in the VS Code extension, MCP server tools (plugins, custom servers) stop being discoverable. Sub-agents spawned after /clear report "0 tool uses" and cannot invoke any MCP tools. ToolSearch calls for MCP tool names return nothing. The session must be fully restarted (new session, not /clear) to restore MCP tool availability.
What Should Happen?
/clear should reset conversation context without dropping the MCP tool registry. MCP tools should remain available and callable after clearing the conversation.
Error Messages/Logs
No explicit error — tools silently become undiscoverable. Sub-agents report completing with "0 tool uses" and the main agent notes "The sudocode MCP tools aren't surfacing through ToolSearch."
Steps to Reproduce
- Open Claude Code in the VS Code extension with one or more MCP servers configured (e.g. a plugin server)
- Confirm MCP tools work — invoke any MCP tool successfully
- Run
/clear - Attempt to use the same MCP tools (directly or via sub-agents)
- Observe: tools are not found, sub-agents complete with 0 tool uses, ToolSearch returns no matches for MCP tool names
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.132
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
6 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
These linked issues are unrelated to the bug found in the VS Code extension described above. This is a new issue.
this is the deferred-tool registry getting wiped alongside the conversation state. /clear in the VS Code extension tears down the in-memory tool index that ToolSearch reads from, but the MCP server connections themselves stay alive, which is why nothing errors loudly. sub-agents inherit the empty registry and report 0 tool uses. the giveaway is that direct invocation by exact tool name also fails, not just fuzzy ToolSearch lookup. workaround until it's fixed: /resume into a fresh session instead of /clear, or toggle the MCP server in settings to force a re-registration. full restart works because it rebuilds the registry from the connection handshake.
Thank you for the report - we just implemented a fix that should ship in the next version of Claude Code.
Thank you for your report. We've shipped a fix —
/clearno longer wipes the MCP tool registry in headless mode (VS Code extension, JetBrains, Agent SDK,claude -p). MCP tools remain available after clearing the conversation. It'll be in the next Claude Code release. If you still see issues after updating, please reopen this issue.This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.