error_during_execution - no debugging information as to why

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 6 comments · opened Aug 19, 2025 · closed Sep 2, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

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": []
  }
]

View original on GitHub ↗

6 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/6102
  2. https://github.com/anthropics/claude-code/issues/1920
  3. https://github.com/anthropics/claude-code/issues/5374

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

johnwest80 · 1 year ago

these other issues are not duplicates. none of them reference getting a result subtype of error_during_execution.

michael-webster · 1 year ago

Upvote for this.

I am seeing similar behavior using the typescript sdk with a result message and a error_during_execution subtype with no additional errors, immediately after the todo list being updated. Re submitting a prompt will sometimes work.

johnwest80 · 1 year ago

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 :)

ashwin-ant collaborator · 12 months ago

Fixed as of 1.0.98!

github-actions[bot] · 11 months ago

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.