API Error 400: tool_use ids must be unique in version 2.1.19

Status Closed — duplicate
Reported on v2.1.19
Maintainer reply None cached
Activity 3 comments · opened Jan 26, 2026 · closed Jan 30, 2026

Description

Claude Code version 2.1.19 fails with API error 400 when attempting any tool use. The error message indicates duplicate tool_use IDs are being generated.

Error Message

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.1: `tool_use` ids must be unique"},"request_id":"req_..."}

Steps to Reproduce

  1. Install Claude Code 2.1.19 (current latest)
  2. Run any command that triggers tool use:

``bash
claude --print "List files in the current directory"
``

  1. Error occurs immediately when Claude tries to use tools (Bash, Read, Glob, etc.)

Environment

  • Claude Code Version: 2.1.19
  • Platform: macOS (Darwin 25.2.0)
  • Installation Method: npm global install + auto-update in ~/.local/share/claude/versions/

Debug Log

From ~/.claude/debug/latest:

[DEBUG] Stream started - received first chunk
[DEBUG] executePreToolHooks called for tool: Bash
...
[ERROR] Error in non-streaming fallback: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.1: `tool_use` ids must be unique"},"request_id":"req_..."}

Workaround

Downgrading to version 2.1.17 resolves the issue:

rm ~/.local/bin/claude
ln -s ~/.local/share/claude/versions/2.1.17 ~/.local/bin/claude

Additional Context

  • Simple prompts without tool use work fine (e.g., claude --print "Say hello")
  • Issue persists even with:
  • Fresh ~/.claude directory (completely removed and recreated)
  • All plugins disabled
  • Different working directories
  • Version 2.1.17 works correctly with identical configuration
  • The error appears to be in the "non-streaming fallback" code path based on debug logs

View original on GitHub ↗

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