[Bug] Anthropic API Error: Tool Use Concurrency Conflict in PostToolUse Hook
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
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"}]
7 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
https://github.com/anthropics/claude-code/issues/8763#issuecomment-3391509893
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.8and was ready to go. The downside is missing the new features like/pluginsthat were released in version 2.0.12.Here is temp workaround
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
PostToolUsehooks as a system reminder instead of Assistant messages. Parallel tool calls withPostToolUsehooks are now working well for my use case in the current version. 🙂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.