claude-code-action crashes on initialization with exit code 1 (intermittent)

Resolved 💬 3 comments Opened Feb 22, 2026 by Ana-s-apps Closed Feb 25, 2026

Description

The anthropics/claude-code-action@v1 intermittently crashes during Claude Code process initialization, before making any API call. The process exits with code 1 within ~250-360ms with $0 cost.

Environment

  • Action: anthropics/claude-code-action@v1
  • SDK: @anthropic-ai/claude-agent-sdk@0.2.49
  • Runner: ubuntu-latest (Ubuntu 24.04)
  • Model: claude-sonnet-4-6
  • Trigger: pull_request (opened, synchronize)

Reproduction

This is intermittent. Same workflow config succeeds on some runs and fails on others:

  • Failed: Run 22240508417 (Feb 20, 2026) - 362ms, $0
  • Succeeded: Run 22241639645 (Feb 20, 2026) - same config
  • Failed: Run 22266450628 (Feb 21, 2026) - 247ms, $0

Workflow config

- name: Run Claude Code Review
  uses: anthropics/claude-code-action@v1
  with:
    claude_code_oauth_token: $\{{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
    prompt: |
      Review this pull request...
    claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'

Error output

The SDK logs show successful initialization followed by immediate crash:

{
  "type": "system",
  "subtype": "init",
  "message": "Claude Code initialized",
  "model": "claude-sonnet-4-6"
}
{
  "type": "result",
  "subtype": "success",
  "is_error": true,
  "duration_ms": 247,
  "num_turns": 1,
  "total_cost_usd": 0,
  "permission_denials": []
}

The error dump is minified JS from the SDK (sdk.mjs), showing what appears to be a JSON schema validation crash (AJV dependencies keyword validation):

SDK execution error: 14 |     depsCount: ...
error: Claude Code process exited with code 1
      at Y (.../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:19:8125)
      at emit (node:events:98:22)
      at #handleOnExit (node:child_process:520:14)

Key observations

  • OAuth token exchange succeeds (OIDC token obtained, app token obtained)
  • Permissions are fine (admin access confirmed)
  • Git auth configured successfully
  • Claude Code installs successfully
  • Crash happens AFTER "Claude Code initialized" but BEFORE any API call
  • Zero cost confirms no API request was attempted
  • The crash is intermittent - same config works on retry

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗