Claude Code GitHub Actions: Set Up @claude in Your Repo
By Shubhranshu, creator of claudeagents · Last reviewed
The fastest way to set up Claude Code GitHub Actions is to run /install-github-app inside Claude Code. It installs the Claude GitHub App, adds your API key or subscription token as a repository secret, and opens a pull request with the workflow file. After you merge it, comment @claude on any issue or pull request and Claude reads the code, answers, or opens a fix.
Claude Code GitHub Actions runs Claude on GitHub's runners using anthropics/claude-code-action@v1. It can implement issues, answer questions about the code, fix review comments and review every pull request automatically.
Setup steps and inputs are from the Claude Code docs, checked on 4 December 2026.
What Claude Code GitHub Actions can do
- Turn an issue into a PR: "@claude implement this" on an issue and Claude writes the code on a branch.
- Answer questions: "@claude how does auth work here?" in a PR or issue.
- Fix review feedback: "@claude fix the comments above" on a pull request.
- Review every PR automatically with a
prompton thepull_requestevent. - Scheduled jobs, such as a daily summary of commits and open issues.
Quick setup with /install-github-app
- Install the GitHub CLI and run
gh auth login. You need admin access to the repository. - Open Claude Code in the repo and run
/install-github-app. - Follow the prompts: install the Claude GitHub App, pick the workflows, and choose an API key or your Claude subscription. Claude saves it as a repository secret.
- Merge the pull request it opens.
- Test it: comment
@claude what does this repo do?on an issue.
This only works with repositories on github.com. For GitHub Enterprise Server or if the command fails, use the manual setup below.
Manual setup
- Install the Claude GitHub App on the repository with read and write access to Contents, Issues and Pull requests.
- Add a repository secret (Settings → Secrets and variables → Actions):
ANTHROPIC_API_KEYfrom the Claude Console, orCLAUDE_CODE_OAUTH_TOKEN, made by runningclaude setup-tokenlocally. - Create
.github/workflows/claude.ymlwith the workflow below and commit it.
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
claude:
if: contains(github.event.comment.body, '@claude')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}Using a subscription token? Replace the anthropic_api_key line with claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}. Runs then count towards your plan's usage limits.
Automatic PR review workflow
Adding a prompt switches the action from waiting for @claude to running on every matching event. This one reviews each pull request when it's opened or updated:
name: Claude PR review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
Review this pull request for bugs, security issues and missing tests.
Post your findings as one PR comment. Be specific and brief.
claude_args: "--max-turns 8 --model claude-sonnet-5-5"With a prompt, results go to the Actions log unless the prompt tells Claude to comment, which is why this one asks for a PR comment. Put your review standards in CLAUDE.md so every review follows them; our CLAUDE.md generator helps.
Key settings for claude-code-action
| Input | What it does |
|---|---|
| prompt | Instructions to run automatically. Without it, the action waits for @claude mentions. |
| claude_args | Claude Code CLI flags, e.g. --max-turns 5, --model, --allowedTools, --mcp-config |
| anthropic_api_key / claude_code_oauth_token | How the action authenticates |
| trigger_phrase | Change @claude to another word |
| allowed_bots / allowed_non_write_users | Let bots or users without write access trigger it |
| settings | Claude Code settings JSON for the run |
| use_bedrock / use_vertex / use_foundry | Run through your cloud provider using OIDC instead of a static key |
Upgrading from the beta? Change @beta to @v1, remove mode, and rename direct_prompt to prompt.
Security and cost
- Only trusted people can trigger it. Users need write access by default, and bots are rejected unless listed in
allowed_bots. Be careful widening this on public repos. - Never put keys in the YAML. Always use
${{ secrets.NAME }}. - Give the workflow only the permissions it needs, e.g.
contents: readfor a review-only job. - Cap every run with
--max-turnsinclaude_argsandtimeout-minuteson the job. - Costs come from two places: GitHub Actions runner minutes and Claude usage (API tokens, or your plan with an OAuth token). Estimate API spend with our cost calculator.
Bring your agents to CI
The action reads your repo's .claude/ folder, so the agents and slash commands you use locally can run in CI too. claudeagents gives you 85 tested agents and 53 commands, including code review and test-writing workflows, to use in both places.
Frequently asked questions
How do I set up Claude Code GitHub Actions?
Run /install-github-app inside Claude Code and follow the prompts, then merge the pull request it opens. Or install the Claude GitHub App, add ANTHROPIC_API_KEY as a repository secret and add a workflow using anthropics/claude-code-action@v1.
Can I use my Claude Pro or Max subscription in GitHub Actions?
Yes. Run claude setup-token locally, save the token as the CLAUDE_CODE_OAUTH_TOKEN secret, and pass it as claude_code_oauth_token. Runs then use your plan's usage limits.
Why doesn't @claude respond to my comment?
Check that the workflow file is on the default branch, the Claude GitHub App is installed on the repo, the secret name matches the workflow, and the commenter has write access. The Actions tab shows whether the run started and any errors.
Can Claude review every pull request automatically?
Yes. Trigger the workflow on pull_request events and give it a prompt that asks for a review and a PR comment, as in the example above.
How much does Claude Code GitHub Actions cost?
The action is free. You pay for GitHub Actions minutes and for Claude usage, either API tokens or your subscription's limits. Use --max-turns and timeout-minutes to cap each run.
Does it work with AWS Bedrock or Google Vertex AI?
Yes. Set use_bedrock, use_vertex or use_foundry to "true" and configure OIDC authentication with your cloud provider.
Sources
Skip the setup: get the Coding kit
30 ready-made coding agents, 19 slash commands and 22 skills for Claude Code. $15 one-time, lifetime updates.
All 3 kits (Coding, SEO and Marketing): 85 agents for $39 instead of $45. See what's in the Coding kit
Use code for 25% off all 3 kits: pay $29.25 instead of $39
Valid until Dec 19 · enter it at checkout