anthropics/claude-code-action action. Once set up, you can mention @claude in pull request or issue comments to trigger Claude to analyze context and act on the request.
Quick setup
The easiest way to add the workflow to a repository is with the built-in installer:1
Authenticate with GitHub
The installer checks that you are authenticated with the GitHub CLI (
gh). If not, it prompts you to log in.2
Choose a repository
Select the repository to set up, or use the current repository if you are already inside one.
3
Provide your Anthropic API key
Enter your
ANTHROPIC_API_KEY. The installer stores it as a GitHub Actions secret in the selected repository using gh secret set.4
Select workflows
Choose which workflows to install: the Claude PR assistant workflow, the Claude Code Review workflow, or both.
5
Open the pull request
The installer creates a new branch, commits the workflow file(s), and opens a browser tab with a pre-filled pull request for you to review and merge.
The workflows do not take effect until the pull request is merged into the default branch.
Available workflows
Claude PR assistant
Triggers when@claude is mentioned in a pull request comment, pull request review, issue comment, or issue body/title.
Workflow file: .github/workflows/claude.yml
Claude Code Review
Runs automatically on every pull request (opened, synchronized, or reopened) and posts a code review using thecode-review plugin.
Workflow file: .github/workflows/claude-code-review.yml
Required secrets
The installer sets the secret automatically. To set it manually:
Required permissions
The workflow jobs request the following GitHub Actions permissions. Grant only what your use case needs:Customizing the workflow
Custom prompt
Add a fixed prompt to theRun Claude Code step to instruct Claude regardless of what the comment says:
Restricting allowed tools
Useclaude_args to limit which tools Claude can use:
Restricting by PR author
To run the code review only for specific contributors, add anif condition to the job:
Restricting to specific file paths
To run the code review only when certain files change:Security considerations
- The
ANTHROPIC_API_KEYis stored as an encrypted GitHub Actions secret and is never exposed in logs. - All Claude runs appear in the GitHub Actions run history for audit purposes.
- Claude’s default tools are limited to reading and writing files and interacting with the repository (comments, branches, commits).
- The
allowed_tools/claude_argsoption in the workflow file controls which additional tools Claude may use.