Official Docs Breakdown: Claude Code GitHub Actions
💬 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:
- Install the GitHub App at https://github.com/apps/claude
- Add
ANTHROPIC_API_KEYunder repository Settings → Secrets and variables → Actions - Create a workflow file:
1 | name: Claude Code |
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 | claude_args: | |
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 | name: Code Review |
Scheduled Reports — triggers a daily or weekly summary on a cron schedule:
1 | name: Daily Report |
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 | - name: Configure AWS credentials |
Google Vertex AI — authenticate to GCP first:
1 | - name: Authenticate to Google Cloud |
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 | # 1. Cap the number of turns |
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
- Index: Claude Code Complete Guide · Series Index
- Previous: Official Docs Breakdown: Remote Control
- Next: Official Docs Breakdown: Claude Code GitLab CI/CD
Based on the official Claude Code GitHub Actions - Claude Code Docs.
Last updated: 2026-03-31




