[BUG]
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?
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.52.content.0: unexpected tool_use_id found in tool_result blocks: toolu_01TpBqJnBCv5MC5LbVDUx8v1. Each tool_result block must have a corresponding tool_use block in the previous message."},"request_id":"req_011CW3hzCNFwRpiALfbnrCJ5"}
What Should Happen?
the prompt should run
Error Messages/Logs
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.52.content.0: unexpected tool_use_id found in tool_result blocks: toolu_01TpBqJnBCv5MC5LbVDUx8v1. Each tool_result block must have a corresponding tool_use block in the previous message."},"request_id":"req_011CW3hzCNFwRpiALfbnrCJ5"}
Steps to Reproduce
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.52.content.0: unexpected tool_use_id found in tool_result blocks: toolu_01TpBqJnBCv5MC5LbVDUx8v1. Each tool_result block must have a corresponding tool_use block in the previous message."},"request_id":"req_011CW3hzCNFwRpiALfbnrCJ5"}
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
4.5
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
my first bug report
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗