[BUG] MCP server tools unavailable after /clear in VS Code extension

Status Fixed / completed
Reported on v2.1.132
Maintainer reply ✓ Yes — localden
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

  1. Open Claude Code in the VS Code extension with one or more MCP servers configured (e.g. a plugin server)
  2. Confirm MCP tools work — invoke any MCP tool successfully
  3. Run /clear
  4. Attempt to use the same MCP tools (directly or via sub-agents)
  5. 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_

View original on GitHub ↗

6 Comments

github-actions[bot] · 3 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/54658
  2. https://github.com/anthropics/claude-code/issues/6428
  3. https://github.com/anthropics/claude-code/issues/52121

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

dylanophir-toast · 3 months ago

These linked issues are unrelated to the bug found in the VS Code extension described above. This is a new issue.

m13v · 3 months ago

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.

localden collaborator · 3 months ago

Thank you for the report - we just implemented a fix that should ship in the next version of Claude Code.

localden collaborator · 3 months ago

Thank you for your report. We've shipped a fix — /clear no 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.

github-actions[bot] · 2 months ago

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.