anthropics / anthropics/claude-code-action

Claude Code CLI crashes on startup in CI (exit code 1, ajv schema validation)

Open
#947 8 comments 12 reactions 0 assignees View on GitHub
area:installation bug p1 provider:1p
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

## Description

The Claude Code CLI crashes during startup in GitHub Actions with exit code 1, before making any API calls ($0 cost, 183ms duration). This appears to be a schema validation error in `ajv`.

## Environment

- **Action**: `anthropics/claude-code-action@v1`
- **Agent SDK**: `@anthropic-ai/claude-agent-sdk@0.2.42`
- **Claude Code**: v2.1.31 (bundled), also reproduced with latest via native installer
- **Runner**: `ubuntu-latest`
- **Auth**: OAuth token (`claude_code_oauth_token`)

## Timeline

- **Working**: Feb 14, 2026 -- PR review completed successfully on `push2` branch (20 turns, $0.65 cost)
- **Broken**: Feb 15, 2026 -- same workflow, same config, crashes on startup

Both runs used identical SDK options, identical Claude Code version (2.1.31), identical workflow file.

## Reproduction

Minimal workflow that reproduces the issue:

```yaml
name: PR Review
on:
pull_request:
types: [opened, synchronize]

jobs:
claude-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: "Review this PR"
claude_args: '--allowed-tools "Bash(gh pr diff:*),Bash(gh pr view:*)"'
```

## Error output

The SDK result shows immediate failure:

```json
{
"type": "result",
"subtype": "success",
"is_error": true,
"duration_ms": 183,
"num_turns": 1,
"total_cost_usd": 0,
"permission_denials": []
}
```

Followed by a minified JS stack trace from `ajv` schema validation (`dependencies` keyword handler):

```
SDK execution error: 14 | depsCount: ${X},
15 | deps: ${Y}}`};var Tj={keyword:"dependencies",type:"object",schemaType:"object",...
...
error: Claude Code process exited with code 1
at Y (.../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:19:7919)
at emit (node:events:98:22)
at #handleOnExit (node:child_process:520:14)
```

## What we tried

1. Re-running the job multiple times -- same failure
2. Installing latest Claude Code via native installer (`curl -fsSL https://claude.ai/install.sh | bash`) with `path_to_claude_code_executable` -- same crash
3. Installing via npm (`npm install -g @anthropic-ai/claude-code@latest`) -- SDK rejects non-native binary

## Successful run for comparison

- Run ID: 22025297491 (Feb 14, `push2` branch) -- succeeded
- Run ID: 22029616604 (Feb 15, `email` branch) -- failed
- Both used SDK 0.2.42, Claude Code 2.1.31, identical workflow, identical SDK options

## Failing runs

- https://github.com/Brief-Solutions/brief/actions/runs/22029616604/job/63652731603
- https://github.com/Brief-Solutions/brief/actions/runs/22029979002/job/63653391172

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.