claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

/compact fails with "tools: Tool names must be unique" error when using multiple MCP servers (v2.0.70)

Open jasonKRR opened this issue 1 month ago • 8 comments

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?

When running /compact command after using MCP tools, it fails with the following error:

Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"tools: Tool names must be unique"},"request_id":"req_011CWA8bntCcJpqrx7YyiUXN"}

Environment:

  • Version: 2.0.70
  • OS: Windows 11 (MINGW64)
  • MCP servers: 6 (supabase, context7, shadcn, vercel, cloudflare-workers, chrome-devtools)

Notes:

  • /mcp list shows no duplicate servers
  • Error occurs consistently after using MCP tools (especially chrome-devtools)
  • Starting a new conversation and running /compact also fails
  • Removed duplicate MCP configs from .claude.json but issue persists
  • This was supposedly fixed in v2.0.31 but still occurs in v2.0.70

What Should Happen?

/compact should successfully compact the conversation context without errors, even when multiple MCP servers are connected and MCP tools have been used in the conversation.

Error Messages/Logs


Steps to Reproduce

  1. Connect 6 MCP servers (supabase, context7, shadcn, vercel, cloudflare-workers, chrome-devtools)
  2. Start a new conversation
  3. Use an MCP tool (e.g., chrome-devtools fill command)
  4. When "Context low" warning appears, run /compact
  5. Error occurs: "tools: Tool names must be unique"

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.0.70

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

jasonKRR avatar Dec 16 '25 09:12 jasonKRR