[BUG] tool_use ids must be unique error when making parallel tool calls (v2.1.19)

Resolved 💬 9 comments Opened Jan 25, 2026 by nanayax3 Closed Apr 10, 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?

Claude Code crashes with a 400 API error when the model attempts to make parallel tool calls. Duplicate tool_use IDs are being
generated, causing the API to reject the request.

What Should Happen?

Each tool_use block should have a unique ID. Parallel tool calls should complete successfully.

Error Messages/Logs

2026-01-24T19:00:43.696Z [ERROR] Error in non-streaming fallback: 400
  {"type":"error","error":{"type":"invalid_request_error",
  "message":"messages.1.content.2: `tool_use` ids must be unique"},
  "request_id":"req_011CXSieUBtDmYg7LTUya8yq"}

Steps to Reproduce

  1. Run Claude Code in headless mode: claude --dangerously-skip-permissions -p "prompt that triggers multiple parallel MCP tool calls"
  2. First set of tool calls succeeds
  3. On next turn when model calls additional tools in parallel, error occurs

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.19

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Non-interactive/CI environment

Additional Information

Issue is intermittent. Occurs in headless/scheduled task context. Debug log shows successful tool calls before the duplicate ID error on
subsequent turn.

View original on GitHub ↗

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