[BUG] error: 400
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
{"type":"error","error":{"type":"invalid_request_error","message":"messages.4: tool_use ids were found without tool_result blocks immediately after: toolu_01LqHj43fmheAteL2PTXoCyL. Each tool_use block must have a corresponding tool_result block in the next message."},"request_id":"req_011CTgUwMrehF5d4zVc6KQTr"}
What Should Happen?
{"type":"error","error":{"type":"invalid_request_error","message":"messages.4: tool_use ids were found without tool_result blocks immediately after: toolu_01LqHj43fmheAteL2PTXoCyL. Each tool_use block must have a corresponding tool_result block in the next message."},"request_id":"req_011CTgUwMrehF5d4zVc6KQTr"}
Error Messages/Logs
Steps to Reproduce
{"type":"error","error":{"type":"invalid_request_error","message":"messages.4: tool_use ids were found without tool_result blocks immediately after: toolu_01LqHj43fmheAteL2PTXoCyL. Each tool_use block must have a corresponding tool_result block in the next message."},"request_id":"req_011CTgUwMrehF5d4zVc6KQTr"}
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.1 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
{"type":"error","error":{"type":"invalid_request_error","message":"messages.4: tool_use ids were found without tool_result blocks immediately after: toolu_01LqHj43fmheAteL2PTXoCyL. Each tool_use block must have a corresponding tool_result block in the next message."},"request_id":"req_011CTgUwMrehF5d4zVc6KQTr"}
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗