/compact fails with 'tools: Tool names must be unique' error

Resolved 💬 5 comments Opened Dec 16, 2025 by smeed652 Closed Feb 14, 2026

Description

The /compact command fails with an API error about duplicate tool names, even when no MCP servers are configured.

Error Message

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_011CWB6Yjq6FMiJPtUmiWFjx"}

Steps to Reproduce

  1. Have a conversation with some history
  2. Run /compact
  3. Error occurs

Debugging Attempted

  • Disabled local .mcp.json (moved to .mcp.json.bak) - error persists
  • Checked ~/.claude/mcp.json - contains empty {"mcpServers": {}}
  • No other MCP configs found
  • Error still occurs with no MCP servers connected

Environment

  • OS: macOS (Darwin 24.6.0)
  • Claude Code version: Latest (as of 2025-12-16)
  • Multiple Claude CLI instances were running earlier in the session (stopped before attempting fix)

Expected Behavior

/compact should successfully compact the conversation history.

Actual Behavior

API returns 400 error claiming tool names are not unique, even though no custom tools are configured.

Additional Context

This may be an internal issue where Claude Code is registering some tools twice during the compaction process, rather than a user configuration issue.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗