The official GitHub Actions integration centers on a single action, anthropics/claude-code-action@v1: install the GitHub App, configure the API key secret, and it automatically decides whether to respond to an @claude mention or execute a prompt directly.
One-line answer
Answer
Run
/install-github-app in the Claude Code terminal; the interactive flow installs the GitHub App, the workflow file, and the ANTHROPIC_API_KEY secret, and you're wired in — from then on, @claude in any issue/PR comment triggers it. OfficialThis whole installation is the shortcut documented officially, provided you're a repo admin and connect to the Claude API directly.
Steps
- Check the prerequisites: OfficialInstalling the GitHub App and adding secrets requires repo admin permissions; the
/install-github-appshortcut is only available to users connecting directly to the Claude API — enterprise environments on Amazon Bedrock / Google Cloud need to configure OIDC and IAM manually per the official docs. - Quick install: run
/install-github-appin the Claude Code terminal and follow the guided flow to install the Claude GitHub App (it asks for read/write on Contents, Issues, and Pull requests), pick a workflow, and write the API key secret. OfficialSince v2.1.187 you can install just the App and choose "Skip for now", then run the command again later to finish configuring the workflow. - Manual install (fallback): install github.com/apps/claude → add the
ANTHROPIC_API_KEYsecret in the repo's Settings → copy the officialexamples/claude.ymlinto.github/workflows/. OfficialThe minimal workflow looks like this: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 }} - Verify: comment
@claude explain how this issue should be fixedon any issue or PR. OfficialNote it's@claude, not/claude; the action auto-detects its run mode from the configuration — with apromptinput it executes directly (automation mode), without one it responds to mentions (interactive mode). - Typical workflows: OfficialThree official scenarios: (1) @claude mentions (the basic workflow above); (2) automatic PR review — trigger on
pull_request: types: [opened, synchronize]with apromptthat calls the code-review plugin's skill (installed via theplugin_marketplaces+pluginsinputs); it runs on every PR without any mention; (3) scheduled jobs — aschedule: crontrigger plus aprompt, e.g. summarizing yesterday's commits and open issues at 9 a.m. every day (for choosing between schedulers see Scheduled tasks). CLI flags all go throughclaude_args, e.g.--max-turns 10,--model,--allowedTools. - Secrets and permissions: OfficialNever hardcode the API key into the workflow — always go through GitHub Secrets (
${{ secrets.ANTHROPIC_API_KEY }}); scope the action's permissions down to the minimum; have a human review Claude's output before merging. Cost adds up on two fronts: GitHub Actions minutes plus API token consumption — put a floor under it with--max-turns, workflow timeouts, and concurrency controls.
Copy-paste prompt
Have Claude Code write the review workflow for you (paste into a local session):
Add a Claude Code GitHub Actions workflow to this repo at .github/workflows/claude.yml:
- Use anthropics/claude-code-action@v1.
- Triggers: the created events of issue_comment and pull_request_review_comment, responding to @claude mentions.
- Read the API key from secrets.ANTHROPIC_API_KEY; no plaintext secrets may appear anywhere in the workflow.
- Add --max-turns 10 in claude_args to prevent runaway usage.
When you're done, explain each section, list the steps I still need to complete manually on GitHub
(installing the Claude GitHub App, adding the secret), and finally show me how to post a test comment to verify.
Sources & last verified
- OfficialClaude Code GitHub Actions (installation, workflow examples, claude_args, security and cost), fetched 2026-08-05.
- Last verified: 2026-08-05 · volatility: high (the action version, input names, and install flow evolve with releases; the beta → v1 transition already included one breaking change).