Task tool subagents fail with 'Tool names must be unique' when MCP servers configured (v2.1.5)

Resolved 💬 3 comments Opened Jan 12, 2026 by hflier Closed Jan 16, 2026

Description

Task tool subagents consistently fail with 0 tool uses when any MCP server is configured. The agents appear to complete instantly without performing any work. This is a regression that was supposedly fixed in v2.0.31 but has resurfaced.

Environment

  • Claude Code version: 2.1.5
  • Platform: macOS (darwin)
  • MCP Server: XcodeBuildMCP (single server, ~60 tools)

Steps to Reproduce

  1. Configure any MCP server in .mcp.json:
{
  "mcpServers": {
    "XcodeBuildMCP": {
      "command": "npx",
      "args": ["-y", "xcodebuildmcp@latest"]
    }
  }
}
  1. Attempt to spawn any subagent using the Task tool (e.g., code review agents, Plan agent, Explore agent)
  1. Observe agents return immediately with:
Done (0 tool uses · 0 tokens · 0.9s)

Expected Behavior

Agents should spawn successfully and perform their assigned tasks, using tools as needed.

Actual Behavior

Agents fail silently. The underlying API error is:

Error: 400 {
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "tools: Tool names must be unique."
  }
}

Workaround

Disabling all MCP servers via /mcp before spawning agents allows them to work. Re-enabling afterward restores MCP functionality. This is cumbersome but functional.

Related Issues

  • #6529 - Original "0 tool uses" report (auto-closed)
  • #10668 - Task agent fails with "Tool names must be unique" (closed as fixed in v2.0.31)
  • #10713 - Plan subagent incomplete output
  • #14111 - /compact fails with same error (closed)

Impact

This breaks core agent functionality for anyone using MCP servers. The Task tool is central to Claude Code's agentic capabilities (code review, exploration, planning). Users must choose between MCP tools OR working subagents, but cannot have both.

Notes

  • This is NOT the same as the /compact issue (#14111) - this affects the Task tool specifically
  • The bug was reportedly fixed in v2.0.31 but has regressed
  • Only one MCP server with properly namespaced tools triggers this (no actual duplicates in config)

View original on GitHub ↗

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