Environment
- Platform (select one):
- Claude CLI version: Claude Code v1.0.17
- Operating System: macOS 15.5 (24F74)
- Terminal: standard macOS terminal
Bug Description
Latest version of claude code is giving a lot of API errors during normal development specifically around analysing log files or analysing existing code base or running python code.
Steps to Reproduce
- Give claude a tasks that includes reading log files (containing images) big log files 20MB ish
- As part of analysing logs and comming up with tha plan of action claude will give API errors
Expected Behavior
The API errors I am getting are obviously issues with resiliancy of the API / tools used by Claude, Claude should be able to automatically recover from failures, better still in some of these failure they should not be happening at all as it looks like some aspect of claude tooling has failed.
Actual Behavior
Error message given in claude code:
⏺ Search(pattern: "_perform_physical_card_detection", path:
"app/services/image_analysis/analyse_captured_image.py")
⎿ Found 1 file (ctrl+r to expand)
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.51: tool_use ids
were found without tool_result blocks immediately after: toolu_018gFuML9Ktbwk6HZrTeK7K1. Each tool_use
block must have a corresponding tool_result block in the next message."}}
⎿ Found 1 file (ctrl+r to expand)
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.51: tool_use ids
were found without tool_result blocks immediately after: toolu_018gFuML9Ktbwk6HZrTeK7K1. Each tool_use
block must have a corresponding tool_result block in the next message."}}
please contiunue
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.51: tool_use ids
were found without tool_result blocks immediately after: toolu_018gFuML9Ktbwk6HZrTeK7K1. Each tool_use
block must have a corresponding tool_result block in the next message."}}
These errors appear to not be recoverable and I will need to restart the session.
Additional Context
The errors are more likely with long log files, large code case including images linked to from the log files. In this specific case
Environment
Bug Description
Latest version of claude code is giving a lot of API errors during normal development specifically around analysing log files or analysing existing code base or running python code.
Steps to Reproduce
Expected Behavior
The API errors I am getting are obviously issues with resiliancy of the API / tools used by Claude, Claude should be able to automatically recover from failures, better still in some of these failure they should not be happening at all as it looks like some aspect of claude tooling has failed.
Actual Behavior
Error message given in claude code:
⏺ Search(pattern: "_perform_physical_card_detection", path:
"app/services/image_analysis/analyse_captured_image.py")
⎿ Found 1 file (ctrl+r to expand)
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.51:
tool_useidswere found without
tool_resultblocks immediately after: toolu_018gFuML9Ktbwk6HZrTeK7K1. Eachtool_useblock must have a corresponding
tool_resultblock in the next message."}}⎿ Found 1 file (ctrl+r to expand)
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.51:
tool_useidswere found without
tool_resultblocks immediately after: toolu_018gFuML9Ktbwk6HZrTeK7K1. Eachtool_useblock must have a corresponding
tool_resultblock in the next message."}}These errors appear to not be recoverable and I will need to restart the session.
Additional Context
The errors are more likely with long log files, large code case including images linked to from the log files. In this specific case