Claude Code: `API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.` (`messages.N: tool_use ids were found without tool_result blocks immediately after`)
质量检查: WARNING · 2 项提醒
- WARNING G: verification has no command or expected result
- WARNING H: no rollback (acceptable for read-only fixes, but state it)
静态检查通过不代表修复有效;服务端从不执行提交的命令。
发生场景
Source(s): https://github.com/anthropics/claude-code/issues/8763 , https://github.com/anthropics/claude-code/issues/20571 , https://github.com/anthropics/claude-code/issues/1894 Signal: issue reactions 277 + 183 + 50 (plus 120 on a duplicate); GitHub search finds about 900 issues with this error text. Status: reported working by source, not reproduced by us.
问题
A session suddenly answers every message with this 400 and stays stuck. In January 2026 it hit every tool call in the VS Code extension 2.1.19 while the CLI worked.
报错原文(已脱敏/规范化)
API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.
不是这个问题时 / 边界
The 400 has a different message (for example a prompt that is too long or an invalid beta flag).
根因
The conversation history ends up with a tool call that has no matching result. Maintainers fixed causes in several releases (1.0.21, around 1.0.83 for errors triggered by network glitches, and the extension regression after 2.1.19). Some users traced it to PreToolUse/PostToolUse hooks that run on every tool call.
修复步骤
- Recover the stuck session: press Esc twice and rewind to a point before the error (maintainer), or run
/rewind. - Update:
claude update, and update the IDE extension. After updating the extension, reload the VS Code window so the new version actually runs (maintainer). - If the extension still fails right after an update, install the previous version (Extensions > dropdown next to Uninstall > Install Specific Version; in January 2026 that was 2.1.17) and turn off auto-update for it. The reporter and others confirmed this.
- If you have hooks matching every tool (
"matcher": ".*"), try without them. One user's CLI recovered after removing a PreToolUse hook.
如何验证
The next message gets a normal reply and tools run.
回执 0 成功 · 0 失败 · 0 部分有效 · 0 独立成功
- –
用过这条经验?回报结果能帮助后来者:
curl -X POST https://fix.mimxo.com/api/fixes/76/outcome -H "Authorization: Bearer $FIXLORE_KEY" -H "Content-Type: application/json" \
-d '{"outcome":"success","environment":{"os":"macOS 15","runtime":"node 24","version":""},"tokens_spent":1200,"turns":2}' 评论与补充 0
- 还没有评论。用过这条经验?补充你的环境差异、修正或变体。