[BUG] API Error: 400 - tool_use ids must be unique when making sequential tool calls
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?
What's Wrong?
When making sequential (non-parallel) tool calls during a conversation, the API returns:
The extension appears to be generating duplicate tool_use IDs, causing the API to reject requests.
This occurs after extended conversations with multiple tool calls. The error is also sometimes displayed as "API Error: 400 due to tool use concurrency issues".
Environment:
- VS Code Extension (Claude Code)
- Windows 11
- Model: Opus 4.5
- Claude Code version: Latest (just updated via npm update -g @anthropic-ai/claude-code)
Steps to Reproduce:
- Start a conversation in VS Code extension
- Make multiple tool calls throughout the conversation (file reads, bash commands, etc.)
- After a single prompt that involves running multiple tool uses the error shows itself.
Workaround:
Running /clear is SUPPOSE to start a fresh conversation temporarily resolves the issue until it reoccurs,
BUT EVEN THIS WORKAROUND DOESN'T WORK!
What Should Happen?
Each tool call should generate a unique ID automatically. Sequential tool calls should execute without ID conflicts regardless of conversation length.
The /clear command should fully reset the conversation state, but currently it does not resolve the issue - the error persists even after clearing.
Error Messages/Logs
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.15.content.1: tool_use ids must be unique"},"request_id":"req_011CXSeQMVwcE7aXrAmrs6bY"}
and
error: 400 due to tool use concurrency issues.
Steps to Reproduce
- Start a conversation in VS Code Claude Code extension
- Make multiple tool calls throughout the conversation (file reads, bash commands, glob searches, etc.)
- After approximately 1-2 tool calls, request another tool call
- Error occurs: "tool_use ids must be unique" or "API Error: 400 due to tool use concurrency issues"
- Run
/clearto attempt reset - Make another tool call
- Error persists even after clearing
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
~2.1.17 or earlier (approximately 2 versions before 2.1.19)
Claude Code Version
2.1.19 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
- Issue occurs immediately when Claude attempts 2 or more sequential tool calls in a single response
- Does not require extended conversation - can happen on first or second message
- Issue occurs with both Sonnet and Opus models
- Windows 11, VS Code latest version
- Just updated Claude Code via
npm update -g @anthropic-ai/claude-code- issue persists - Completely uninstalled and reinstalled Claude Code, including deletion of ALL cache folders/files - issue persists
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗