[BUG] API Error 400: "tool_use ids must be unique" - duplicate IDs generated by system

Resolved 💬 3 comments Opened Feb 25, 2026 by tweakyourgeek Closed Feb 28, 2026

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?

During longer conversations with many tool calls, the API returns a 400 error with message "tool_use ids must be unique." This is not caused by anything on the user side - the system is generating duplicate internal IDs. The error is intermittent and unpredictable.

Full error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.43.content.2: tool_use ids must be unique"},"request_id":"req_011CYUkSrMWTScM6idJf1jDk"}

What Should Happen?

The API should generate unique tool_use IDs for every tool call. No duplicate IDs should be created, and the conversation should continue without errors.

Error Messages/Logs

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.43.content.2: tool_use ids must be unique"},"request_id":"req_011CYUkSrMWTScM6idJf1jDk"}

Steps to Reproduce

  1. Start a Claude Code session
  2. Have an extended conversation with many tool calls (file reads, edits, searches, etc.)
  3. At some point during the session, the error appears
  4. The error references a specific message index (messages.43.content.2) suggesting it happens deeper into conversations
  5. Not consistently reproducible - appears intermittently during heavy tool-use sessions

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude.ai

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

PRODUCT SUGGESTION: Claude Code already has all the information needed to auto-fill this entire bug report form - the error message, model, version, OS, what the user was doing when it broke. When an error like this occurs, Claude Code should offer a simple "Want to report this bug?" prompt. The user clicks Yes, and it's submitted automatically. The current process asks users to manually copy-paste information that the system already knows. Most users will just close the window and never report the bug, which means you're missing real-world error data.

ALSO: This bug occurred while using Claude Code on the web (claude.ai), but "Claude.ai web app" is not an option under Platform. The form assumes everyone is using the CLI terminal version. Web users hit bugs too and there's no clear path for us to report them. The Platform dropdown, Terminal/Shell field, and "claude --version" requirement all assume CLI usage.

Also, this form is ridiculous! My offer still stands to have you review my sessions and mine for non-programmer usage, frustrations, etc. I've reported issues, sent emails, etc. and the response has been lackluster and condescending at best.

View original on GitHub ↗

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