anthropics / anthropics/claude-code-action

Claude Code exits with code 1 before making API calls (worked 2 hours ago)

Đang mở
#804 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug p1 provider:1p
Ngôn ngữ chính
TypeScript
Star
8.9k
Fork
2.1k
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
10

Mô tả

# Bug Report: Claude Code Action Crashing on All Requests

## Summary
Claude Code action is failing with exit code 1 on all requests as of ~2 hours ago (around 18:30 UTC, January 8, 2026), despite working perfectly just 2 hours prior. The action crashes before making any API calls (0 cost, <1 second duration).

## Environment
- **Action Version**: `anthropics/claude-code-action@v1`
- **Time of Failures**: Started around 20:30 UTC, January 8, 2026
- **Last Known Working**: Around 18:30 UTC, January 8, 2026 (~2 hours before failures)
- **Number of Affected Repositories**: 19 repositories (all experiencing same issue)
- **GitHub Actions Runner**: `ubuntu-latest`

## What Worked Previously (2 hours ago, ~18:30 UTC)
Simple query executed successfully across all 19 repositories:
```
@claude what files are in this repository?
```
- ✅ Completed successfully
- ✅ Returned file listings
- ✅ No errors

## What's Failing Now (Started ~20:30 UTC, January 8, 2026)
**ALL requests fail**, including trivial ones:

### Failed Request Examples:
1. **Comprehensive audit** (understandably complex):
```
@claude Please conduct a comprehensive optimization audit:
[...detailed requirements...]
```

2. **Simple focused request** (should be straightforward):
```
@claude Please analyze package.json and find:
1. Unused dependencies (packages imported but never used)
2. Duplicate or redundant packages
3. Heavy packages that could be replaced with lighter alternatives
```

3. **Minimal read-only request** (absolutely trivial):
```
@claude Please read package.json and list all dependencies in the "dependencies" and "devDependencies" sections. Just list them, no analysis yet.
```

**All three fail with identical error.**

## Error Details

### Error Message:
```
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:7850:14)
at exitHandler (/home/runner/work/_actions/anthropics/claude-code-action/v1/base-action/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:7975:28)
```

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

**Critical observations:**
- `duration_ms`: 364-946ms (crashes almost immediately)
- `total_cost_usd`: 0 (never reaches Claude API)
- `is_error`: true despite `subtype: "success"`
- No permission denials

### Subsequent Errors:
After main crash, GitHub API 404 errors occur (likely expected since no branch was created):
```
HttpError: Not Found - https://docs.github.com/rest/commits/commits#compare-two-commits
status: 404,
request: {
method: "GET",
url: "https://api.github.com/repos/JG003/anabasis/compare/main...claude%2Fissue-6-20260108-2050",
...
}
```

## Workflow Configuration

### `.github/workflows/claude.yml`:
```yaml
name: Claude PR Action
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
jobs:
claude-pr:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run Claude Code
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
```

## What Has NOT Changed
- ✅ Workflow configuration (identical)
- ✅ API keys (verified working)
- ✅ Repository permissions (admin access confirmed)
- ✅ GitHub secrets (ANTHROPIC_API_KEY and GITHUB_TOKEN both set)
- ✅ Repository structure

## What May Have Changed
Since the user environment remained constant, the issue likely stems from:
- **Claude Code action update** (v1 may have auto-updated to broken version)
- **Anthropic backend issue**
- **GitHub Actions environment change**

## Reproduction Steps
1. Set up any repository with the workflow above
2. Create an issue with `@claude [any request]`
3. Observe immediate crash with exit code 1

## Expected Behavior
Claude Code should:
1. Initialize successfully
2. Read the repository context
3. Make API call to Claude
4. Update GitHub comment with response

## Actual Behavior
Claude Code:
1. Initializes
2. Crashes immediately (exit code 1)
3. Never reaches Claude API (0 cost)
4. Leaves generic "I'll analyze this and get back to you" comment

## Additional Context
- This affects **19 different repositories** with identical symptoms
- Repository type: React + TypeScript + Vite (Lovable-generated sites)
- Repository size: ~134 files (not unusually large)
- **Critical timing**: Repositories were just set up ~2 hours ago, worked perfectly for initial "what files are in this repository" queries, then immediately started failing on all subsequent requests
- The timing (working at 18:30 UTC, failing at 20:30 UTC - just 2 hours apart) strongly suggests an upstream change or incident

## Sample Job Run URLs
(From one affected repository - Anabasis)
- Failed run: https://github.com/JG003/anabasis/actions/runs/20831315372
- Issue where reported: https://github.com/JG003/anabasis/issues/6

## Requested Action
Please investigate what changed in the past 2 hours (~18:30-20:30 UTC, January 8, 2026) that would cause Claude Code to crash before making API calls. This appears to be a systemic issue affecting multiple repositories and all types of requests, suggesting a recent deployment or backend change.

---

**Reporter**: JG003
**Date**: January 8, 2026
**Severity**: Critical (complete service failure)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.