[BUG] Task Tool Fails with "Tool names must be unique" Error {Task Agents}
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?
Task Tool Fails with Tool Names Must Be Unique Error
Bug Description
The Task tool consistently fails with a 400 Bad Request error containing the message "tools: Tool names must be unique" for all subagent types including Explore, Plan, and general-purpose. This makes parallel and sequential agent execution completely impossible.
Environment
- Claude Code Version: Latest as of November 1, 2025
- Model: claude-sonnet-4-5-20250929
- Platform: Windows
- Working Directory: Valid git repository
Reproduction Steps
All of the following Task invocations fail with identical error:
Attempt 1: Multiple Parallel Agents (4 agents)
Launching 4 agents in parallel - ALL FAIL
- Task with subagent_type="Explore", description="Agent 1", model="sonnet"
- Task with subagent_type="Explore", description="Agent 2", model="sonnet"
- Task with subagent_type="general-purpose", description="Agent 3", model="sonnet"
- Task with subagent_type="Plan", description="Agent 4", model="haiku"
Attempt 2: Single Sequential Agent
Just ONE agent - ALSO FAILS
- Task with subagent_type="Explore", description="Single agent", model="sonnet"
Attempt 3: Different Subagent Types
Tried all combinations - ALL FAIL
- Task with subagent_type="general-purpose" - FAILED
- Task with subagent_type="Plan" - FAILED
- Task with subagent_type="Explore" - FAILED
Expected Behavior
Task tool should spawn subagents that can:
- Execute complex multi-step analysis tasks
- Run in parallel for performance
- Run sequentially for coordinated workflows
Actual Behavior
Every single Task invocation fails immediately with error type "invalid_request_error" and message "tools: Tool names must be unique."
HTTP Status: 400 Bad Request
Impact
- Severity: CRITICAL
- Workaround Required: Must use direct tool calls like Read, Grep, Glob instead of Task agents
- User Experience: Significantly degraded - manual analysis required instead of automated agent workflows
- Performance: Cannot leverage parallel agent execution for complex tasks
Additional Context
- All other tools work perfectly:
- Read, Write, Grep, Glob, Bash, TodoWrite all work fine
- Only Task is completely non-functional
- Error occurs immediately:
- Not a timeout or execution error
- Fails before agent even spawns
- Suggests internal tool registration or cleanup issue
- 100 percent reproducible:
- Every Task invocation fails
- No successful executions observed
- Consistent across all subagent types and models
- Request IDs vary but error is identical across multiple attempts
Root Cause Hypothesis
The error message "Tool names must be unique" suggests:
- Internal tool name collision when spawning Task agents
- Incomplete cleanup of tool registrations between agent invocations
- Session-level state issue where tool names are not properly scoped per agent
Suggested Investigation
- Check tool registration mechanism in Task agent spawning logic
- Verify tool name scoping per agent instance
- Ensure proper cleanup of tool registrations after agent termination
- Test with fresh session with no prior tool invocations
Workaround Currently Using
Instead of Task agents, using direct tool composition:
Instead of using Task with subagent_type="Explore" and prompt="Analyze files", using Glob then Read then Grep then manual analysis.
This works but loses the benefit of autonomous multi-step agent workflows.
Would appreciate fix as this blocks a major Claude Code feature.
What Should Happen?
Multi Task Agents should be activated
Error Messages/Logs
Steps to Reproduce
Task Tool Fails with Tool Names Must Be Unique Error
Bug Description
The Task tool consistently fails with a 400 Bad Request error containing the message "tools: Tool names must be unique" for all subagent types including Explore, Plan, and general-purpose. This makes parallel and sequential agent execution completely impossible.
Environment
- Claude Code Version: Latest as of November 1, 2025
- Model: claude-sonnet-4-5-20250929
- Platform: Windows
- Working Directory: Valid git repository
Reproduction Steps
All of the following Task invocations fail with identical error:
Attempt 1: Multiple Parallel Agents (4 agents)
Launching 4 agents in parallel - ALL FAIL
- Task with subagent_type="Explore", description="Agent 1", model="sonnet"
- Task with subagent_type="Explore", description="Agent 2", model="sonnet"
- Task with subagent_type="general-purpose", description="Agent 3", model="sonnet"
- Task with subagent_type="Plan", description="Agent 4", model="haiku"
Attempt 2: Single Sequential Agent
Just ONE agent - ALSO FAILS
- Task with subagent_type="Explore", description="Single agent", model="sonnet"
Attempt 3: Different Subagent Types
Tried all combinations - ALL FAIL
- Task with subagent_type="general-purpose" - FAILED
- Task with subagent_type="Plan" - FAILED
- Task with subagent_type="Explore" - FAILED
Expected Behavior
Task tool should spawn subagents that can:
- Execute complex multi-step analysis tasks
- Run in parallel for performance
- Run sequentially for coordinated workflows
Actual Behavior
Every single Task invocation fails immediately with error type "invalid_request_error" and message "tools: Tool names must be unique."
HTTP Status: 400 Bad Request
Impact
- Severity: CRITICAL
- Workaround Required: Must use direct tool calls like Read, Grep, Glob instead of Task agents
- User Experience: Significantly degraded - manual analysis required instead of automated agent workflows
- Performance: Cannot leverage parallel agent execution for complex tasks
Additional Context
- All other tools work perfectly:
- Read, Write, Grep, Glob, Bash, TodoWrite all work fine
- Only Task is completely non-functional
- Error occurs immediately:
- Not a timeout or execution error
- Fails before agent even spawns
- Suggests internal tool registration or cleanup issue
- 100 percent reproducible:
- Every Task invocation fails
- No successful executions observed
- Consistent across all subagent types and models
- Request IDs vary but error is identical across multiple attempts
Root Cause Hypothesis
The error message "Tool names must be unique" suggests:
- Internal tool name collision when spawning Task agents
- Incomplete cleanup of tool registrations between agent invocations
- Session-level state issue where tool names are not properly scoped per agent
Suggested Investigation
- Check tool registration mechanism in Task agent spawning logic
- Verify tool name scoping per agent instance
- Ensure proper cleanup of tool registrations after agent termination
- Test with fresh session with no prior tool invocations
Workaround Currently Using
Instead of Task agents, using direct tool composition:
Instead of using Task with subagent_type="Explore" and prompt="Analyze files", using Glob then Read then Grep then manual analysis.
This works but loses the benefit of autonomous multi-step agent workflows.
Would appreciate fix as this blocks a major Claude Code feature.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.30
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PyCharm terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗