Anthropic’s claude-code-action lets Claude Code review pull requests and change code through GitHub Actions. It can also respond to repository issues there. GitHub Actions starts automated jobs when events occur, such as when someone opens a pull request. The Claude job runs on the workflow’s configured runner and sends requests to your chosen AI provider.
The action supports Anthropic’s API, Amazon Bedrock, Google Vertex AI, and Microsoft Foundry. Use it for repeatable repository tasks, and limit its credentials and permissions to what those tasks need. Before the repository can use the action, an administrator must install the GitHub app and add the required secrets.
What the Claude Code action does
A GitHub Actions workflow defines when a job runs and what it does. The official Claude Code action adds Claude Code to the job, where it can work with repository code and respond to pull requests or issues.
For example, a workflow can ask Claude to review a pull request or make a requested change. Claude Code can read files, edit code, run tests, and iterate on a task. The workflow still determines what starts the job and what GitHub permissions the job receives.
Claude Code can also help draft workflow files. A Claude Code bootcamp example shows how to prompt Claude to create GitHub Actions workflows. Generated YAML should be reviewed before merging: check its event triggers, permissions, secrets, and commands as carefully as the code it will run.
Set up the action around a specific task
Start with one narrow job, such as reviewing pull requests or helping with a clearly defined issue. A focused prompt helps you judge Claude’s results and check whether the workflow has only the access it needs.
Then follow the setup instructions in the action’s official repository. To set it up, install the GitHub app and store provider credentials as secrets. Choose an authentication method for your provider, and make sure the workflow receives only the credentials the task needs.
The workflow runs on the GitHub Actions runner you configure. That runner executes the action, while API requests go to the selected provider. These settings determine where the job runs and what it can access.
Limit permissions and protect credentials
Give a review-only job read access whenever possible. If Claude needs to create or update pull requests, grant the specific write permissions those actions require and limit repository access to that scope. Keep provider credentials in GitHub’s secret storage, and avoid printing secret values in logs.
Treat pull request descriptions and issue text as untrusted input. Code changes are untrusted too. If a workflow gives Claude write access to the repository, do not let it act automatically on every external contribution. Use human approval or restrict which events can start write-enabled jobs, especially when a pull request comes from outside the repository.
Separate review and implementation when they need different permissions. A read-only review job can provide feedback without the permissions needed to change files or open a pull request. You can then inspect Claude’s work before it changes the repository.
Account for failures and CI load
Review and test Claude’s output as you would other changes. If the action opens a pull request, run the same build and test checks used for other changes. Agent-authored pull requests use the same CI pipeline and can add to a busy queue, as an overview of GitHub coding agents notes. Limit automated pull request creation to work that justifies the additional checks.
Make failures visible. A failed run should leave a status or log for a maintainer to inspect. A missing comment or code change does not prove the task succeeded. Test workflow changes with a small, low-risk task before adding more triggers or permissions.