💬 hippo: This post is part of the Claude Code Official Docs Breakdown series.


1. What Is This Feature?

Claude Code GitHub Actions is an official GitHub Action that lets you summon Claude with an @claude mention inside PR or Issue comments. It can open pull requests, turn Issues into working code, fix bugs, and review code quality.

Unlike GitHub’s built-in automatic code review, this Action runs only when explicitly triggered via @claude (unless you wire it to another event)—it won’t spam every PR by default. Claude reads the CLAUDE.md file at your repository root to learn your conventions, so the code it produces follows your standards rather than arbitrary guesses.

Execution happens directly on GitHub’s runners without routing through a third-party proxy. Enterprise teams can also connect AWS Bedrock or Google Vertex AI for data residency and consolidated billing.


2. Official Docs Breakdown

2.1 Installation & Setup

The fastest way to set it up is to run the built-in slash command (Skill) from the Claude Code terminal:

1
/install-github-app

It walks you through installing the GitHub App and configuring your API key. If the automated flow fails, follow these three manual steps:

  1. Install the GitHub App at https://github.com/apps/claude
  2. Add ANTHROPIC_API_KEY under repository Settings → Secrets and variables → Actions
  3. Create a workflow file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]

permissions:
contents: write
pull-requests: write
issues: write

jobs:
claude:
if: contains(github.event.comment.body, '@claude')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

Note that permissions must explicitly declare write access. The GitHub App also requires read/write permissions on Contents, Issues, and Pull requests—otherwise Claude cannot push commits or open PRs.

2.2 Action Parameters & v1 Migration

The GA v1 release significantly streamlines configuration: prompt replaces both direct_prompt and override_prompt, claude_args consolidates CLI flags like max_turns, model, and custom_instructions, and mode has been removed in favor of automatic detection.

Beta → v1 Migration Map:

Legacy Parameter v1 Parameter Notes
mode Removed Auto-detected; no longer needed
direct_prompt prompt Renamed
override_prompt prompt + GitHub variables Consolidated into prompt
custom_instructions claude_args: --append-system-prompt Moved to claude_args
max_turns claude_args: --max-turns Moved to claude_args
model claude_args: --model Moved to claude_args
allowed_tools claude_args: --allowedTools Moved to claude_args
disallowed_tools claude_args: --disallowedTools Moved to claude_args
claude_env settings JSON configuration

Complete Action Parameters:

Parameter Description Required
anthropic_api_key Anthropic API key Yes (unless using Bedrock/Vertex)
prompt Instructions for Claude (plain text or slash command) No (optional for comment triggers)
claude_args CLI argument string forwarded to Claude Code No
github_token GitHub API token (defaults to GITHUB_TOKEN) No
trigger_phrase Trigger phrase (defaults to @claude) No
use_bedrock Route requests through AWS Bedrock No
use_vertex Route requests through Google Vertex AI No
settings JSON settings (replaces legacy claude_env) No

Common CLI flags to pass via claude_args:

1
2
3
4
5
6
claude_args: |
--max-turns 10
--model claude-sonnet-4-6
--append-system-prompt "Follow our coding standards"
--allowedTools Read,Write,Edit,Bash,Glob,Grep
--debug

prompt also accepts slash commands (Skills)—for example, prompt: "/review" runs Claude Code’s built-in code review skill. Beyond per-workflow prompts, your primary lever for customizing Claude’s behavior is CLAUDE.md in the repository root. Use prompt for task-specific instructions and CLAUDE.md for durable project standards; the two stack cleanly.

2.3 Common Workflows

Automated PR Code Review — runs whenever a pull request is opened or updated:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
name: Code Review
on:
pull_request:
types: [opened, synchronize]

jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: "Review this pull request for code quality and security"
claude_args: "--max-turns 5"

Scheduled Reports — triggers a daily or weekly summary on a cron schedule:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
name: Daily Report
on:
schedule:
- cron: "0 9 * * *"

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: "Generate a summary of yesterday's commits and open issues"
claude_args: "--model opus"

Common Comment Commands:

  • @claude implement this feature — implement a requested feature
  • @claude fix the failing test — diagnose and fix a failing test
  • @claude how should I handle error cases? — ask for design or implementation advice

Combining prompt with claude_args covers virtually any workflow you want to automate. You can find additional templates in the official examples directory.

2.4 Enterprise Deployment: Bedrock & Vertex AI

Enterprise teams can replace the Anthropic API with AWS Bedrock or Google Vertex AI using OIDC (OpenID Connect) federation—no static API keys required. Here are the key setup differences:

AWS Bedrock — configure AWS credentials first:

1
2
3
4
5
6
7
8
9
10
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::ACCOUNT_ID:role/ClaudeCodeRole
aws-region: us-east-1

- name: Run Claude Code
uses: anthropics/claude-code-action@v1
with:
use_bedrock: true

Google Vertex AI — authenticate to GCP first:

1
2
3
4
5
6
7
8
9
10
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: 'projects/NUMBER/locations/global/workloadIdentityPools/POOL/providers/PROVIDER'
service_account: 'claude-code@PROJECT_ID.iam.gserviceaccount.com'

- name: Run Claude Code
uses: anthropics/claude-code-action@v1
with:
use_vertex: true

Both setups require id-token: write under permissions to enable OIDC, and neither requires anthropic_api_key.


3. Lessons from Practice

💬 hippo: Pitfalls I ran into while using this in real repositories.

CI doesn’t run on Claude’s commits: This is the most common surprise. Events triggered by the default GITHUB_TOKEN intentionally do not trigger subsequent GitHub Actions workflows, so Claude’s pushes won’t kick off your CI checks. Fix this by authenticating with a token generated by a GitHub App instead of the default GITHUB_TOKEN.

CLAUDE.md makes or breaks output quality: Put a CLAUDE.md at the repository root defining coding conventions, review criteria, and project rules. Claude follows it closely; without it, Claude is left guessing. Use prompt for one-off workflow instructions and CLAUDE.md for persistent standards—they complement each other.

Three essential cost controls:

1
2
3
4
5
6
7
8
9
10
11
12
# 1. Cap the number of turns
claude_args: "--max-turns 5"

# 2. Set a workflow timeout
jobs:
claude:
timeout-minutes: 10

# 3. Limit concurrency to one Claude run per PR
concurrency:
group: claude-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: true

4. FAQ

Q: Why isn’t Claude responding to @claude?

A: Check these in order: the GitHub App is installed on the repository → the workflow file lives under .github/workflows/ → ANTHROPIC_API_KEY is configured in repository Secrets → you typed @claude, not /claude.

Q: Why don’t Claude’s commits trigger my CI pipeline?

A: Use a token issued by the GitHub App or a custom App instead of the default GitHub Actions bot user. Also verify that your CI workflow listens to the pull_request event.

Q: Why is API authentication failing?

A: If calling the Anthropic API directly, verify that the key is valid and the account has remaining credit. For Bedrock or Vertex AI, double-check your cloud credentials and IAM role bindings.

Q: What drives the cost?

A: Two components: GitHub Actions runner minutes + API token usage (which scales with task complexity and codebase size). Capping --max-turns and setting timeout-minutes are the two most effective levers for keeping spend predictable.


5. Summary

The core workflow is straightforward: install the App → add your API key → write a workflow file → trigger with @claude. Keep three levers in mind: CLAUDE.md for project standards, --max-turns for cost control, and Bedrock or Vertex AI when enterprise data residency matters. For more ready-to-use workflows, browse the official examples directory.


Series Navigation


Based on the official Claude Code GitHub Actions - Claude Code Docs.

Last updated: 2026-03-31