claude-code-action icon indicating copy to clipboard operation
claude-code-action copied to clipboard

[Bug] Claude Code fails with exit code 1 - no meaningful error message provided

Open cenkkiran opened this issue 1 month ago • 4 comments

Describe the bug Claude Code action fails with exit code 1. The error output shows a stack trace from the SDK's error handler but doesn't provide meaningful information about what actually caused the failure.

To Reproduce

  1. Set up workflow with anthropics/claude-code-action@v1
  2. Trigger via @claude mention in an issue or PR comment
  3. Action fails with exit code 1

Expected behavior The action should either succeed or provide a clear error message indicating what failed (e.g., invalid token, model access issue, tool configuration error).

Screenshots

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)
Error: Process completed with exit code 1.

Workflow yml file

name: Claude Code
on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]
  pull_request:
    types: [opened, synchronize, ready_for_review]
  issues:
    types: [opened, assigned]
  pull_request_review:
    types: [submitted]

jobs:
  claude:
    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 == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
      (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      issues: write
      id-token: write
      actions: read
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 1

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - name: Install dependencies
        run: npm ci --legacy-peer-deps

      - name: Run Claude Code
        id: claude
        uses: anthropics/claude-code-action@v1
        with:
          claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
          model: claude-sonnet-4-20250514
          max_turns: 20
          allowed_tools: "Read,Write,Edit,MultiEdit,Bash(npm *),Bash(npx *),Bash(git *),mcp__github__*"

API Provider [x] Anthropic First-Party API (default) [ ] AWS Bedrock [ ] GCP Vertex

Additional context

  • The error message doesn't indicate the root cause (token issue, model access, tool config, etc.)
  • Would be helpful if the action logged more details before exiting with code 1
  • Possibly related: using both allowed_tools param and --allowedTools in claude_args might cause conflicts

cenkkiran avatar Dec 30 '25 15:12 cenkkiran

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

vibe-kanban-cloud[bot] avatar Jan 06 '26 05:01 vibe-kanban-cloud[bot]

I'm actively using this project and have been eagerly waiting for this feature, merging this would benefit many users like me. Thank you for considering it!

jorben avatar Jan 09 '26 08:01 jorben