[BUG] VS Code Extension: "tool_use ids must be unique" API 400 error during multi-step operations

Status Closed — not planned
Reported on v2.1.19
Maintainer reply None cached
Activity 11 comments · opened Jan 24, 2026 · 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?

Description

The VS Code extension returns API 400 errors with the message tool_use ids must be unique when Claude executes a series of tool calls or concurrent operations. This is a new issue - I have hundreds of hours of usage without ever seeing this before.

This does NOT occur in:

  • Native terminal CLI (claude command)
  • Claude Desktop app

The issue is isolated to the VS Code extension only.

Key Observations

  • Terminal CLI: Works perfectly, no issues
  • Claude Desktop: Works perfectly, no issues
  • VS Code Extension: Consistent errors - duplicate tool_use IDs being sent
  • First occurrence ever after hundreds of hours of use - likely a recent regression
  • Error appears at message index 17, suggesting it happens after several successful tool calls in a conversation

What Should Happen?

Expected Behavior

Tool calls should have unique IDs and complete without API errors.

Actual Behavior

The extension appears to be generating duplicate tool_use IDs, causing the API to reject the request. Reinstalling the extension temporarily resolves the issue, but it recurs.

Error Messages/Logs

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

Steps to Reproduce

  1. Open Claude Code in VS Code extension
  2. Ask Claude to perform a task requiring multiple tool calls (e.g., "explore this codebase")
  3. API 400 errors occur consistently with "tool_use ids must be unique" message
  4. Also happens when asking Claude to run tools concurrently/in parallel

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

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

11 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/20601
  2. https://github.com/anthropics/claude-code/issues/20571
  3. https://github.com/anthropics/claude-code/issues/20598

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

tim-fin · 7 months ago

This appears to be a widespread issue today. Related reports with the same tool_use ids must be unique error:

  • #20601 - API Error 400: tool_use ids must be unique - persists after full reinstall
  • #20579 - MCP tools fail with "tool_use ids must be unique" when run via launchd
  • #20508 - API Error 400 when using -p flag with tool-requiring prompts
  • #20583 - stream-json mode: duplicate tool_use IDs error on multi-turn

All opened today (Jan 24, 2026), suggesting a recent regression in v2.1.19 or server-side change.

tim-fin · 7 months ago
Found 3 possible duplicate issues: 1. [[BUG] API Error 400: tool_use ids must be unique - persists after full reinstall #20601](https://github.com/anthropics/claude-code/issues/20601) 2. [[Bug] VS Code extension: Tool use concurrency error after Jan 23-24 update #20571](https://github.com/anthropics/claude-code/issues/20571) 3. [[BUG] API Error: 400 due to tool use concurrency issues. #20598](https://github.com/anthropics/claude-code/issues/20598) This issue will be automatically closed as a duplicate in 3 days. If your issue is a duplicate, please close it and 👍 the existing issue instead To prevent auto-closure, add a comment or 👎 this comment 🤖 Generated with Claude Code

it seems like it might be but I have no way of knowing if the issue is, in fact, the same

Bensmirus · 7 months ago

So it’s a bug from Anthropic ? And not specific user setup

tim-fin · 7 months ago

seems like it?

catnipgames-chris · 7 months ago

This might have happened before rarely but this is 100% and completely breaking. I've had to abandon using this completely because of this. Can't believe they released this. Back to crappy terminal version...

tim-fin · 7 months ago

agreed, frustrating for sure, making it work with terminal open in VSC but not great

Lerner98 · 7 months ago

also happens to me, tried everything a human could possibly do including full deletion of all cached folders and files that claude can make.
nothing fixes it on a user side (this includes reinstalling it of course)

tim-fin · 7 months ago

rolled back to 2.1.17 and it seems to relieve it until it's fixed.

github-actions[bot] · 6 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.