[Bug] Anthropic API Error: Tool Use Concurrency Conflict in PostToolUse Hook

Status Fixed / completed
Maintainer reply None cached
Activity 7 comments · opened Oct 10, 2025 · closed Oct 16, 2025

Bug Description
The Error:

API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.

This error occurs when I use the PostToolUse hook and pass content to the {hookSpecificOutput: {hookEventName: "PostToolUse", additionalContext: .}} field in the JSON output. The issue arises when the agent executes tool calls in parallel that trigger the hook—in this case, file creation or updates.

Key Details:

  • The bug was introduced in version 2.0.9
  • This issue had been fixed in version 2.0.0 and worked correctly through version 2.0.8

Environment Info

  • Platform: darwin
  • Terminal: cursor
  • Version: 2.0.13
  • Feedback ID: 2fb95a41-a7a7-45d5-b67e-3a3e90afb13f

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_011ERLs8xgGUG2Q7xb6sarcs, toolu_011HpajW86gAM7zohXQhFDsK, toolu_01EzfSYPfUbPC32skLoisfD4, toolu_01MsVPXgyWFVcagjct9Xmtm8, toolu_01UYGfaVT6VztjHAfBHZAmbC. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"},\"request_id\":\"req_011CTyv1cNcSC4x3Xp2Z66MB\"}\n    at generate (/$bunfs/root/claude:382:21386)\n    at makeRequest (/$bunfs/root/claude:527:5345)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-10-10T17:30:19.932Z"}]

View original on GitHub ↗

7 Comments

github-actions[bot] · 10 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/9103
  2. https://github.com/anthropics/claude-code/issues/9288
  3. https://github.com/anthropics/claude-code/issues/8867

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

sjcotto · 10 months ago

any fix for this?

romeromarcelo · 10 months ago
any fix for this?

Rolling back to version 2.0.8 worked fine for my case. I'm running a native installation, so I simply executed claude install 2.0.8 and was ready to go. The downside is missing the new features like /plugins that were released in version 2.0.12.

iRonin · 10 months ago
romeromarcelo · 10 months ago

Today's update of Claude Code to version 2.0.17 appears to have resolved the tool use concurrency conflict by reorganizing the results of the PostToolUse hooks as a system reminder instead of Assistant messages. Parallel tool calls with PostToolUse hooks are now working well for my use case in the current version. 🙂

github-actions[bot] · 10 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.