Skip to content

Claude Code exits with code 5 after successful PR review #846

@tetienne

Description

@tetienne

Describe the bug

Claude Code Action successfully completes a PR review (posts comments to the PR) but then exits with code 5, causing the GitHub Actions workflow to fail. The review is fully functional - comments are posted - but the non-zero exit code breaks CI pipelines.

To Reproduce

  1. Set up a workflow using anthropics/claude-code-action@v1 with AWS Bedrock
  2. Trigger a PR review via @claude mention
  3. Claude successfully analyzes the PR and posts review comments
  4. Action exits with code 5 despite successful execution

Expected behavior

When Claude successfully completes a review and posts comments, the action should exit with code 0.

Screenshots

GitHub Actions log showing the error:

2026-01-20T15:33:16.4373874Z Successfully formatted Claude Code report
...
2026-01-20T15:33:16.7597431Z ##[error]Process completed with exit code 5.

The review was successfully posted (multiple inline comments about SQL injection and N+1 queries were added to the PR).

Workflow yml file

name: Claude PR Review

on:
  issue_comment:
    types: [created]

jobs:
  claude-review:
    if: github.event.issue.pull_request && contains(github.event.comment.body, '@claude')
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
      issues: write
    steps:
      - uses: actions/checkout@v4

      - uses: anthropics/claude-code-action@v1
        with:
          use_bedrock: 'true'
          prompt: |
            Review this PR for code quality issues.
          claude_args: |
            --model eu.anthropic.claude-sonnet-4-5-20250929-v1:0
            --allowedTools "mcp__github__get_pull_request,mcp__github__get_pull_request_diff,mcp__github__get_pull_request_files,mcp__github__get_pull_request_status,mcp__github__pull_request_read,mcp__github__create_pending_pull_request_review,mcp__github__submit_pending_pull_request_review,mcp__github__pull_request_review_write,mcp__github__add_comment_to_pending_review,mcp__github__add_issue_comment,Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh api:*),Grep,Read"

API Provider

  • Anthropic First-Party API (default)
  • AWS Bedrock
  • GCP Vertex

Additional context

  • Model used: eu.anthropic.claude-sonnet-4-5-20250929-v1:0
  • Bun version: 1.2.11

The action clearly succeeded in its task (review comments were posted), but something in the cleanup or finalization phase returns exit code 5. This makes it impossible to use the action in CI pipelines without continue-on-error: true, which defeats the purpose of detecting actual failures.

Exit code 5 doesn't appear to be documented. Is this a known exit code? What does it signify?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdev-experiencep2Non-showstopper bug or popular feature requestprovider:bedrockAWS Bedrock API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions