Environment
- Platform (select one):
- Claude CLI version: 1.0.77 (Claude Code)
- Operating System: macOS (Darwin 24.6.0)
- Terminal: Terminal App
Bug Description
Frequent API Error 400 with message "tool_use ids were found without tool_result blocks immediately after". This prevents normal operation and requires retrying commands.
Steps to Reproduce
- Use Claude Code CLI for any task involving tool calls
- Error occurs randomly during tool execution
- Specific error:
messages.129: tool_use ids were found without tool_result blocks immediately after: toolu_01JX7gsswzmXeYhXg6F8wGRy
Expected Behavior
Tool calls should complete successfully with proper tool_use/tool_result pairing.
Actual Behavior
API returns 400 error indicating missing tool_result blocks, interrupting workflow. Issue has become frequent over the past couple of days.
Additional Context
- Node.js version: v24.2.0 (getting npm warnings about engine compatibility)
- Just updated Claude Code CLI via
npm update -g @anthropic/claude-code
- Retrying the same command usually works on second attempt
- Error seems to happen with various tool types, not specific to one tool
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.129: tool_use ids were found without tool_result blocks immediately after:
toolu_01JX7gsswzmXeYhXg6F8wGRy. Each tool_use block must have a corresponding tool_result block in the next message."}}
Environment
Bug Description
Frequent API Error 400 with message "tool_use ids were found without tool_result blocks immediately after". This prevents normal operation and requires retrying commands.
Steps to Reproduce
messages.129: tool_use ids were found without tool_result blocks immediately after: toolu_01JX7gsswzmXeYhXg6F8wGRyExpected Behavior
Tool calls should complete successfully with proper tool_use/tool_result pairing.
Actual Behavior
API returns 400 error indicating missing tool_result blocks, interrupting workflow. Issue has become frequent over the past couple of days.
Additional Context
npm update -g @anthropic/claude-codeAPI Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.129:
tool_useids were found withouttool_resultblocks immediately after:toolu_01JX7gsswzmXeYhXg6F8wGRy. Each
tool_useblock must have a correspondingtool_resultblock in the next message."}}