error_during_execution - no debugging information as to why
So I have a job that runs, and periodically fails with a mysterious "error_during_execution" result subtype.
echo "$FULL_PROMPT" | npx @anthropic-ai/claude-code -p --verbose --output-format json --allowedTools "Bash(echo:*)" "Bash(find:*)" > "$TEMP_FILE"
the prompt is mostly the same between runs. and more importantly, the output shows that all todos completed successfully. i didn't include all of the output below, but every step worked. it's only at the very end, after all todos are complete, that it bombs with an error_during_execution subtype for the result. there's no other information to help troubleshoot what could be happening.
this is not consistent. i can run it again with the same input, and it works fine. and it's only about one out of every 10 runs that this error occurs.
i can't find a single instance of "error_during_execution" when i search for that string on google. i'm reporting this because i'd really just like to know what i can do to debug this myself. maybe i'm missing something will tell me why this sporadically fails?
...
{
"type": "assistant",
"message": {
"id": "masked",
"type": "message",
"role": "assistant",
"model": "claude-3-7-sonnet-20250219",
"content": [
{
"type": "tool_use",
"id": "masked",
"name": "TodoWrite",
"input": {
"todos": [
{
"content": "Read PR details",
"status": "completed",
"id": "1"
},
{ "content": "Read PR diff", "status": "completed", "id": "2" },
{
"content": "Read PR changes",
"status": "completed",
"id": "3"
},
{
"content": "Read individual file diffs",
"status": "completed",
"id": "4"
},
{
"content": "Generate summary of changes",
"status": "completed",
"id": "5"
},
{
"content": "Identify issues from enumerated list",
"status": "completed",
"id": "6"
},
{
"content": "Identify behavior without test coverage",
"status": "completed",
"id": "7"
},
{
"content": "Perform code review",
"status": "completed",
"id": "8"
},
{
"content": "Perform security review",
"status": "completed",
"id": "9"
},
{
"content": "Compile final report",
"status": "completed",
"id": "10"
}
]
}
}
],
"stop_reason": null,
"stop_sequence": null,
"usage": {
"input_tokens": 3,
"cache_creation_input_tokens": 438,
"cache_read_input_tokens": 30510,
"output_tokens": 733
}
},
"parent_tool_use_id": null,
"session_id": "masked"
},
{
"type": "user",
"message": {
"role": "user",
"content": [
{
"tool_use_id": "masked",
"type": "tool_result",
"content": "Todos have been modified successfully. Ensure that you continue to use the todo list to track your progress. Please proceed with the current tasks if applicable"
}
]
},
"parent_tool_use_id": null,
"session_id": "masked"
},
{
"type": "result",
"subtype": "error_during_execution",
"duration_ms": 145507,
"duration_api_ms": 147997,
"is_error": false,
"num_turns": 0,
"session_id": "masked",
"total_cost_usd": 0.28978655000000003,
"usage": {
"input_tokens": 72,
"cache_creation_input_tokens": 13775,
"cache_read_input_tokens": 499919,
"output_tokens": 5771,
"server_tool_use": { "web_search_requests": 0 },
"service_tier": "standard"
},
"permission_denials": []
}
]
6 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
these other issues are not duplicates. none of them reference getting a result subtype of error_during_execution.
Upvote for this.
I am seeing similar behavior using the typescript sdk with a
resultmessage and aerror_during_executionsubtype with no additional errors, immediately after the todo list being updated. Re submitting a prompt will sometimes work.i have a script that retries my claude prompt up to five times. eventually, it always works with enough retries. but that's costly and time-consuming.
it would just be nice, if nothing else, to know what's behind the issue. and even nicer to have it fixed, of course :)
Fixed as of 1.0.98!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.