[BUG]
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?
Title: API Error 400: "tool_use ids must be unique" when making parallel tool calls
What's happening:
When Claude Code makes multiple tool calls in parallel (in a single response), the API returns error 400 with message: "tool_use ids must be unique". This happens consistently when 2+ tools are called simultaneously.
Actual behavior:
Claude Code generates duplicate tool_use IDs, causing the API to reject the request.
Environment:
Platform: macOS (Darwin 24.5.0)
Claude Code: VS Code Extension
Model: claude-opus-4-5-20251101
Workaround:
Sequential tool calls work fine. Only parallel calls trigger this bug.
What Should Happen?
When Claude Code needs to execute multiple tool calls in a single response (parallel execution), each tool call should be assigned a unique tool_use ID. The API should successfully process all parallel tool calls and return their results.
For example, when asking Claude to "search for .tsx and .css files", it should:
Generate unique IDs for each tool call (e.g., toolu_01ABC... and toolu_01XYZ...)
Execute both Glob searches in parallel
Return combined results without errors
Currently, Claude Code generates duplicate IDs causing: API Error: 400 - "tool_use ids must be unique"
Error Messages/Logs
Steps to Reproduce
Steps to reproduce:
Start a Claude Code session
Ask Claude to perform a task that triggers multiple parallel tool calls (e.g., "search for all .tsx and .css files")
Error appears: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.XX.content.X: tool_use ids must be unique"}}
Expected behavior:
Parallel tool calls should work without error - each tool_use should have a unique ID generated.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.19 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗