[Bug] Anthropic API Error: Missing Tool Result Block
Bug Description
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.175: tool_use ids
were found without tool_result blocks immediately after: toolu_015g5zBhDygcYYzT5aZSbDfA. Each tool_use block
must have a corresponding tool_result block in the next message."},"request_id":"req_011CTbfG97rqTEntBzgaFmng"}
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 1.0.128
- Feedback ID: a094b15c-87a7-4ae4-9c50-6a85aaba8e15
Errors
[{"error":"Error: EISDIR: illegal operation on a directory, read\n at Module.readFileSync (node:fs:433:20)\n at Object.readFileSync (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:719:16544)\n at lBB (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3607:659)\n at Object.call (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1712:952)\n at call.next (<anonymous>)\n at BO (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1163:30556)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1790:1328\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-28T12:33:59.661Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n at Module.readFileSync (node:fs:433:20)\n at Object.readFileSync (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:719:16544)\n at lBB (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3607:659)\n at Object.call (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1712:952)\n at call.next (<anonymous>)\n at BO (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1163:30556)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1790:1328\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-28T12:33:59.693Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n at Module.readFileSync (node:fs:433:20)\n at Object.readFileSync (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:719:16544)\n at lBB (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3607:659)\n at Object.call (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1712:952)\n at call.next (<anonymous>)\n at BO (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1163:30556)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1790:1328\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-28T12:33:59.710Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at AK (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:1183)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:911\n at Array.map (<anonymous>)\n at WJ (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:902)\n at bJB (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2912:9380)\n at KC (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:34:19415)\n at Mp (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:36:42814)\n at V9 (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:36:38355)\n at jh (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:36:38283)\n at LC (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:36:38137)","timestamp":"2025-09-28T12:47:21.936Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at AK (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:1183)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:2175\n at Array.map (<anonymous>)\n at AK (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:2146)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:2062\n at Array.map (<anonymous>)\n at AK (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:2051)\n at file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:911\n at Array.map (<anonymous>)\n at WJ (file:///Users/greg/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1774:902)","timestamp":"2025-09-28T12:50:04.780Z"},{"error":"Error: Language not supported while highligh
Note: Error logs were truncated.
This is not a DUPLICATE it's 400 new error they happen all day for months you need to fix it rather than adding more gimicks
Bug Description
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.2: tool_use ids were found without tool_result blocks immediately after: toolu_01BQmW64bLmgxPbSia3FybMn. Each tool_use block must have a corresponding tool_result block in the next message."},"request_id":"req_011CTd5DZVXQ2TJBnzH3noVC"}
Environment Info Platform: win32 Terminal: cursor Version: 2.0.0 Feedback ID: aac94612-d0ba-4ef1-8e0f-e4f162199be1
This is the bug while upgrading to v2
Bug Description
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.2: tool_use ids were found without tool_result blocks immediately after: toolu_01T9S2QnCtay9uMW6yFsfmwH. Each tool_use block must have a corresponding tool_result block in the next message."},"request_id":"req_011CTeCfXT3HCf32h2DsdDp2"}
Environment Info Platform: Ubuntu 24.04.2 LTS Terminal: ubuntu default terminal + pycharm Version: 2.0.1 Organization ID: e770deb4-a7e7-41d2-af79-330063fdce8d
This is a disaster and an emergency. It's preventing me from doing real work. Occuring in pretty much every session I'm running. I have hooks active - I wonder if that's the culprit. Please somebody from the Claude Code team - reach out if you want help debugging this.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.