Claude Code GitHub Action: type @claude in a PR to review, fix bugs, answer questions
TL;DR
anthropics/claude-code-action (MIT) brings Claude Code into GitHub: it responds to @claude mentions, issue assignments, or fixed prompts in workflows. Quick setup with /install-github-app inside Claude Code (repo admin required). Works with the Anthropic API, Bedrock, Vertex AI and Foundry.
Ways to use it
| Mode | Example |
|---|---|
| Interactive | Comment “@claude explain why this test is flaky” on a PR |
| Auto review | Every new PR → review against the team checklist |
| Path-based | Deep review only when src/payments/** changes |
| Scheduled | Weekly dependency checks, docs drifting from code |
| Triage | Auto-label and categorize new issues |
Minimal workflow
name: Claude
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 }
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}Recommendations
- Keep the key in GitHub Secrets; use a dedicated CI key with a spend limit.
- Put the review checklist in CLAUDE.md for consistent results.
- For external contributors' PRs: restrict permissions, never auto-merge.
Repo: anthropics/claude-code-action · Claude Code GitHub Actions docs