claude-code-action
claude-code-action copied to clipboard
Claude Code Action crashes with exit code 1 on PR reviews
Claude Code Action Crash Report
Issue Summary
The anthropics/claude-code-action@v1 is consistently crashing with exit code 1 approximately 2 seconds after starting, preventing PR security reviews from completing.
Environment
-
Action Version:
anthropics/claude-code-action@v1(SHA: 7145c3e0510bcdbdd29f67cc4a8c1958f1acfa2f) -
Runner:
ubuntu-latest(Ubuntu 24.04.3 LTS) -
Event:
pull_request(opened, synchronize, reopened) - Repository: AXD-enterprise/axd-hub (private)
- Date: December 30, 2025
Configuration
- name: Claude Code Security Review
uses: anthropics/claude-code-action@v1
with:
prompt: |
Review this PR for security issues and code quality...
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
claude_args: |
--system-prompt "..."
--max-turns 10
--model claude-sonnet-4-5
--mcp-config .claude/mcp-config.json
Observed Behavior
- ✅ Authentication succeeds (OIDC token exchange works)
- ✅ Claude Code SDK initializes
- ✅ Settings file created at
/home/runner/.claude/settings.json - ✅ Prompt file created at
/home/runner/work/_temp/claude-prompts/claude-prompt.txt - ❌ Claude Code process exits with code 1 after ~2 seconds
- ❌ No PR comments posted
- ❌ No detailed error message in logs
Error Output
SDK execution error: 13243 | throw error;
13244 | }
13245 | }
13246 | getProcessExitError(code, signal) {
13247 | if (code !== 0 && code !== null) {
13248 | return new Error(`Claude Code process exited with code ${code}`);
^
error: Claude Code process exited with code 1
at getProcessExitError (/home/runner/work/_actions/anthropics/claude-code-action/v1/base-action/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:13248:14)
at exitHandler (/home/runner/work/_actions/anthropics/claude-code-action/v1/base-action/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:13373:28)
at emit (node:events:92:22)
at #handleOnExit (node:child_process:511:14)
SDK Options Used
{
"systemPrompt": {
"type": "preset",
"preset": "claude_code"
},
"pathToClaudeCodeExecutable": "",
"extraArgs": {
"system-prompt": "...",
"max-turns": "10",
"model": "claude-sonnet-4-5",
"mcp-config": ".claude/mcp-config.json"
},
"settingSources": ["user", "project", "local"]
}
Troubleshooting Steps Taken
- ✅ Verified
ANTHROPIC_API_KEYsecret exists and is valid - ✅ Corrected model name from invalid
claude-sonnet-4-5-20250929to validclaude-sonnet-4-5 - ✅ Ensured workflow file matches between PR and main branch
- ✅ Verified MCP config file exists at
.claude/mcp-config.json - ✅ Enabled
show_full_output: true(still no additional error details) - ✅ Confirmed authentication works (OIDC token exchange successful)
Expected Behavior
Claude Code should:
- Analyze the PR changes
- Post review comments on specific lines
- Complete with exit code 0 (or appropriate non-zero if issues found but commented)
Actual Behavior
Claude Code crashes immediately without:
- Posting any comments
- Providing detailed error messages
- Indicating what caused the failure
Impact
- Unable to use automated Claude security reviews
- PRs blocked by failed required check
- Manual security review required as workaround
Workaround Applied
Merged PR manually after verifying security issues were addressed through other means.
Related Workflow Runs
- Run ID: 20601268576 (initial failure)
- Run ID: 20602080944 (after model name fix)
- Run ID: 20602966122 (after auth fix)
- Run ID: 20603048271 (with full output enabled)
- Run ID: 20603165965 (after workflow file sync)
All runs show identical crash pattern.
Request
Please investigate why the Claude Code process is exiting with code 1 immediately after initialization without providing actionable error messages.
Additional Context
- Using
@anthropic-ai/[email protected] - The action worked correctly in generating PR comments on other repositories
- This appears to be a recent regression or environment-specific issue
Review Complete
Your review story is ready!
Comment !reviewfast on this PR to re-generate the story.