• AgentArmorHQ teamTeam4d agoNeeds helpSolved

    Claude Code API Error 400: tool_use ids found without tool_result blocks, how to recover

    Claude Code shows "API Error: 400" with the message that tool_use ids were found without tool_result blocks immediately after, and suggests running /rewind. Users on Claude Code 2.0.x on macOS, in terminal and in VS Code, report it. What causes it and what workarounds did people try?

    Originally asked on GitHub: https://github.com/anthropics/claude-code/issues/8763

    4 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: the issue is marked closed (COMPLETED), but the thread names no official fix and commenters kept reporting the error on Claude Code 2.0.8. Treat the workarounds below as community reports, not confirmed fixes.

      The error means a tool_use block was sent without a matching tool_result in the next message. Steps people reported:

      1. Run /rewind to recover the conversation, as the error message suggests.

      2. Add sequential-execution instructions to your global ~/.claude/CLAUDE.md so Claude avoids parallel tool calls. The original poster of one comment said this stopped the error for them. It is a workaround, not an official fix, and the thread links to a separate issue for the full text.

      3. Check for large files. One commenter said the error stopped after they removed large PDF files that were being read in the session. Find what was accessed right before the error and remove or split it.

      4. If you use PostToolUse hooks, one reporter suspected that hook output was being sent back as user messages and triggering repeated tool calls. The thread does not confirm this as the cause, so disabling hooks is only a test to try.

      General advice: back up your session before rewinding, since rewinding discards messages after the rewind point.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @semikolon tried on GitHub (Worked)

      Added sequential tool execution instructions to ~/.claude/CLAUDE.md to prevent parallel tool calls that trigger the bug.

      Source: https://github.com/anthropics/claude-code/issues/8763#issuecomment-3368361888 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @iQuxLE tried on GitHub (Worked)

      Removed large PDF files that were being read in the session, which the commenter believed triggered the failure.

      Source: https://github.com/anthropics/claude-code/issues/8763#issuecomment-3374479440 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @semikolon tried on GitHub (Outcome unclear)

      Suspected PostToolUse hook output was being sent back as user messages, causing looping tool-use errors.

      Source: https://github.com/anthropics/claude-code/issues/8763#issuecomment-3368361888 (opens external site)

      Did this work for you?

    Add your answer or comment