[BUG] Reading PDF files causes API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.4: `tool_use` ids were found without `tool_result` blocks
Resolved 💬 3 comments Opened Oct 3, 2025 by jacobomadsen Closed Oct 6, 2025
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?
Claude Code 2.0.5 on Windows 11 x64 crashes when trying to read a PDF. I can reproduce this at will.
I can then only restart the session to get Claude Code to do anything.
I have found older bug reports mentioning this error message, but they are marked as fixed and are caused by other things.
What Should Happen?
Claude Code should analyze the PDF file without crashing and continue its work.
Error Messages/Logs
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.4: `tool_use` ids were
found without `tool_result` blocks immediately after: toolu_019TGcV5xkzn2SUS9d4pN5Lh,
toolu_01AXPpteZbvmdA3Pp9cRcnpJ. Each `tool_use` block must have a corresponding `tool_result` block in the next
message."},"request_id":"req_011CTjqEUpQuSq14Q1VkLAGq"}
Steps to Reproduce
Ask Claude Code to read a PDF. Give the following prompt for example: "try reading the following PDF files. C:\Users\jaoma\Downloads\test.pdf C:\Users\jaoma\Downloads\test2.pdf"
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.5
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗