Claude Code GitHub Actions | A Minimal Setup Guide for @claude Triggers
For developers who want to use Claude Code GitHub Actions in real projects, this guide covers how to integrate Anthropic's official Action that automates code reviews, implementations, and fixes via @claude mentions. From the 5-minute setup using /install-github-app to 4 workflows spanning PR reviews, scheduled runs, Issue implementation, and design discussions — plus the key points of the v1 migration — everything is explained with practical examples.
Claude Code GitHub Actions is Anthropic's official Action where Claude responds to @claude mentions with PR reviews, implementations, and fixes. Running /install-github-app in the Claude Code CLI automatically sets up the GitHub App, API key, and sample Workflow files, completing the setup in 5 minutes.
In v1, specifying mode: tag / mode: agent is no longer required — the Action automatically determines the mode — so a minimal 10-line Workflow using the single prompt interface covers all 4 use cases: automatic PR reviews, scheduled runs, Issue implementation, and design discussions.
The claude_args parameter accepts Claude Code CLI options directly, allowing you to inject coding standards via --append-system-prompt. Note that the default model is Sonnet — to use Opus 4.7, you must explicitly specify claude_args: --model claude-opus-4-7.
目次 (11)
- What Is Claude Code GitHub Actions — Anthropic's Official Action That Runs on @claude
- Quickest Setup — 5 Minutes with /install-github-app
- Minimal Workflow — Enable @claude Auto-Response in 10 Lines
- 4 Standard Workflows — PR Review / Scheduled Run / Issue Implementation / Design Discussion
- Model Selection — Sonnet by Default, Opus 4.7 Requires Explicit Specification
- beta → v1 Breaking Changes Checklist
- Cost Management — Double Billing for GitHub Actions Minutes + Claude API Tokens
- 5 Things to Check When @claude Doesn't Respond
- Switching to AWS Bedrock / Google Vertex AI
- Related Articles
- Sources (Primary Information)
What Is Claude Code GitHub Actions — Anthropic's Official Action That Runs on @claude
This is Anthropic's official Action (anthropics/claude-code-action@v1) for calling Claude Code from GitHub Actions workflows. Simply mention @claude in a PR or Issue comment, and Claude will analyze the code, implement changes, apply fixes, or create PRs.
Claude respects the coding standards defined in CLAUDE.md, making it easy to set up context-aware automation aligned with your repository. Since it runs on GitHub-hosted runners, your source code never leaves the repository.
Quickest Setup — 5 Minutes with /install-github-app
Here are the key points for this section.
# Run a single command in Claude Code CLI (requires repository admin permissions)
/install-github-app
This command guides you interactively through installing the GitHub App, registering ANTHROPIC_API_KEY, and placing sample Workflow files. Once complete, write @claude in an Issue or PR comment to confirm it's working.
If /install-github-app fails or you need to customize the setup, you can configure it manually in 3 steps:
- Install the Claude GitHub App: Go to https://github.com/apps/claude and install it on the target repository
- Register
ANTHROPIC_API_KEYas a repository secret: Settings → Secrets and variables → Actions - Place the Workflow file: Copy
examples/claude.ymlfromanthropics/claude-code-actioninto.github/workflows/
Minimal Workflow — Enable @claude Auto-Response in 10 Lines
The minimal configuration shown in the official documentation is as follows:
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
claude:
runs-on: ubuntu-latest
steps:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
This enables automatic responses to @claude mentions in comments. In v1, specifying mode: tag / mode: agent is no longer needed — the Action automatically determines the mode.
For fine-grained behavior control, you can pass Claude Code CLI options directly via the claude_args parameter.
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: "Review this PR for security issues"
claude_args: |
--append-system-prompt "Follow our coding standards"
--max-turns 10
--model claude-sonnet-4-6
4 Standard Workflows — PR Review / Scheduled Run / Issue Implementation / Design Discussion
Here are the key points for this section.
| Workflow | Trigger | Example Prompt |
|---|---|---|
| ① Automatic PR Review | pull_request: [opened, synchronize] |
"Review this pull request for code quality, correctness, and security." |
| ② Scheduled Run | schedule: cron "0 9 * * *" |
"Generate a summary of yesterday's commits and open issues" |
| ③ Issue → Code Implementation | issue_comment with @claude implement ... |
The comment body serves as the instruction |
| ④ Design Discussion | issue_comment with @claude how should I ... |
The comment body serves as the instruction |
① and ② are automation-mode workflows that specify prompt explicitly in the Workflow YAML, while ③ and ④ are interactive-mode workflows that respond to @claude mentions — in v1, the mode is determined automatically. The following 3 comment examples are most representative:
@claude implement this feature based on the issue description
@claude how should I implement user authentication for this endpoint?
@claude fix the TypeError in the user dashboard component
Model Selection — Sonnet by Default, Opus 4.7 Requires Explicit Specification
The default model in v1 is Sonnet. To use Opus 4.7, you must specify it explicitly by passing claude_args: --model claude-opus-4-7.
If accuracy on coding tasks is the priority, Opus 4.7 is the starting point; if cost optimization matters more, Sonnet is the baseline. Since token consumption depends on task complexity and repository size, setting a conversation turn limit with --max-turns N is standard practice.
beta → v1 Breaking Changes Checklist
If you are using the beta version, you will need to rewrite your Workflow files to upgrade to v1.
| beta input | v1 input |
|---|---|
mode |
Removed (auto-detected) |
direct_prompt |
prompt |
override_prompt |
prompt (combined with GitHub variables) |
custom_instructions |
claude_args: --append-system-prompt |
max_turns |
claude_args: --max-turns |
model |
claude_args: --model |
allowed_tools |
claude_args: --allowedTools |
disallowed_tools |
claude_args: --disallowedTools |
claude_env |
settings JSON format |
The two key takeaways are: all CLI options are consolidated under claude_args, and everything is unified under the single prompt interface.
Cost Management — Double Billing for GitHub Actions Minutes + Claude API Tokens
Here are the key points for this section.
- GitHub Actions billing: Consumes hosted runner execution time (billed by the minute)
- Claude API billing: Pay-per-use based on token count (input + output)
- Runaway prevention:
claude_args: --max-turns Nis essential (default 10; use 10–15 for complex tasks, 3–5 for reviews) - Job level: Add
timeout-minutes:alongside - Parallel limits: Use GitHub Actions
concurrencycontrols
A common pitfall is token costs ballooning when --max-turns is not set for simple reviews.
5 Things to Check When @claude Doesn't Respond
The majority of cases where the bot doesn't respond come down to one of the following. Check in order from the top.
- Is the GitHub App correctly installed on the target repository?
- Are Actions enabled for the repository?
- Is
ANTHROPIC_API_KEYregistered as a secret? - Does the comment contain
@claude(not/claude)? - If CI doesn't run on Claude's commits, are you using the GitHub App or a custom App? (CI triggers do not fire with the Actions user by design)
Switching to AWS Bedrock / Google Vertex AI
For enterprise use cases where you want data residency and billing routes aligned with your own Cloud account, you can switch by specifying use_bedrock: "true" or use_vertex: "true". The recommended setup for the former uses OIDC to assume an IAM Role, while the latter uses Workload Identity Federation to assume a service account.
As a prerequisite, Claude model access must be enabled in Bedrock / Vertex AI. Refer to the official documentation for detailed setup instructions.
Related Articles
- Claude Code Schedule — 4 Approaches and Pitfalls — When to use
/schedule, Routines, Desktop Schedule, or external cron - Claude Code Beginner's Guide — 9 Features That Work Even for Non-Engineers — Overview of Claude Code
- Building Claude Skills — A Minimal Setup with SKILL.md — Automation combined with Skills
- Claude Code on Mac — brew + Apple Silicon + Notification Setup — Local environment setup
Sources (Primary Information)
The primary sources referenced directly in writing this article are listed below. Always check the links for the latest and most accurate information.