
Add @claude to GitHub PRs in 3 Minutes with claude-code-action@v1
Chris Harper
2 min read
Jun 23, 2026 · 18:17 UTC
TL;DR: anthropics/claude-code-action@v1 puts Claude Code into GitHub Actions in 3 steps — one slash command, one secret, one YAML file — then @claude fix this in any PR comment triggers a full agent run.
The official Claude Code GitHub Action runs the full Claude Code runtime inside GitHub Actions — the same agentic engine you use in your terminal, with access to your repo, your CLAUDE.md, and all of Claude's tools.
Setup: 3 steps
Step 1. From your Claude Code session in the terminal:
/install-github-app
This installs the GitHub App to your repo (it needs write access to Contents, Issues, and Pull requests) and guides you through adding ANTHROPIC_API_KEY to your repo secrets.
Step 2. Copy the workflow into .github/workflows/claude.yml:
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 }}
Step 3. Test it: in any PR, comment @claude explain what this PR does.
Three patterns worth setting up
On-demand. The basic pattern above. Comment @claude implement the feature described in this issue, @claude fix the TypeError in UserDashboard.tsx, or @claude add test coverage for this function — Claude reads the diff, writes code, commits. It follows your CLAUDE.md rules and test requirements.
Automatic code review. Trigger on pull_request events using Anthropic's code-review plugin:
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 }}
plugin_marketplaces: "https://github.com/anthropics/claude-code.git"
plugins: "code-review@claude-code-plugins"
prompt: "/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
Scheduled automation. Run Claude on a cron for daily digests, stale issue triage, or dependency drift checks:
on:
schedule:
- cron: "0 9 * * *"
Cost control
Each run consumes GitHub Actions minutes plus API tokens. Set explicit limits:
claude_args: "--max-turns 10 --model claude-sonnet-4-6"
Add timeout-minutes: 10 at the job level. Agentic GitHub Actions runs draw from the separate agentic credit pool (not your subscription limit) on usage-based plans.
Sources: Claude Code GitHub Actions docs, anthropics/claude-code-action repository, GitHub Code Review docs