At a glance
| What you get | Replies, code changes and pull request reviews posted inside GitHub |
|---|---|
| Typical cost | Free Actions on public repos + your Claude plan or API usage |
| Skill level | Intermediate |
| Runs on | GitHub-hosted runners |
What you get
Claude Code GitHub Actions is an official GitHub Action from Anthropic, anthropics/claude-code-action, that runs Claude Code inside your repository's workflows. It works in two modes:
- Interactive: someone with write access comments
@claudeon an issue or pull request, for example "@claude fix the TypeError in the user dashboard component". Claude replies in a comment, updates it as it works and can push commits or open a pull request. - Automation: you give the workflow a
prompt, and Claude runs on a GitHub event without a mention, such as reviewing every new pull request or writing a daily summary of commits and open issues on a schedule.
The useful output is work that lands where your team already looks: a review comment on the line with the problem, a branch with the fix, or a report in the workflow log.
What it costs
The official docs say each run uses two kinds of resources.
| Component | What the docs say |
|---|---|
| GitHub Actions minutes | Standard GitHub-hosted runners are free in public repositories. GitHub Free includes $12 of compute usage a month for private repositories, expressed as money rather than minutes. At the $0.006 a minute standard Linux 2-core rate, that is about 2,000 minutes (our calculation). |
| Claude usage | With an API key, tokens are billed per use; the Claude API price list shows Claude Sonnet 5.5 at $2 input and $10 output per million tokens. With an OAuth token from a Pro, Max, Team or Enterprise subscription, runs use your subscription instead of API billing. |
Our Claude record lists Pro at $20 a month and Max from $100. A solo developer with a public repository and a Pro plan therefore pays no extra platform fee, but heavy use counts against the subscription's usage limits.
Set it up
You need admin access to the repository. The quick path from the docs:
- Install the GitHub CLI and sign in with
gh auth login. - Open Claude Code in your repository and run
/install-github-app. - Follow the prompts. Claude Code installs the Claude GitHub App and saves your credential as a repository secret, either
ANTHROPIC_API_KEYorCLAUDE_CODE_OAUTH_TOKEN(created withclaude setup-token). - Merge the pull request it opens with the workflow files.
- Test it by commenting
@claudeon an issue.
The manual path is the same idea: install the Claude GitHub App, add the secret, and copy the example workflow into .github/workflows/. The core of that workflow is:
on:
issue_comment:
types: [created]
jobs:
claude:
if: contains(github.event.comment.body, '@claude')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}The full example in the docs also sets the job permissions the action needs, including id-token: write. Copy it from the official page rather than this shortened version.
Keep runs cheap
- Write specific requests so Claude needs fewer turns.
- Add
--max-turnsinclaude_args, for exampleclaude_args: "--max-turns 5". - Set a workflow timeout and use GitHub's concurrency controls so runs cannot pile up.
- Keep
CLAUDE.mdshort: Claude reads it on every run. - Use issue templates so the context is in the issue from the start.
A first job to try
Pick a small, boring issue you already understand, such as a typo in an error message or a missing input check. Write it up the way you would for a new teammate: which file, what is wrong, what "done" looks like. Then comment:
@claude Fix the typo in the error message in src/login.js ("pasword" -> "password").
Keep the change to that one line and open a pull request.Watch the Actions tab for the run, then read the pull request like any other: does the diff touch only what you asked? Did your tests run? Starting with a job you could do yourself in two minutes is the fastest way to learn how specific your requests need to be, and it costs very little if the run goes wrong.
Safety checks
- Never commit an API key or token. Store it as a GitHub secret.
- The Claude GitHub App asks for a broad permission set because it is shared by several Claude features. If your organisation only allows contents, issues and pull requests, the docs explain how to create a custom app with just those.
- By default only users with write access can trigger runs, and bots are rejected unless listed, which stops loops.
- Review Claude's changes before merging, the same as any other contributor's.
Sources
Checked
Checked
Checked
Checked
Related records: Claude pricing record · Github Copilot pricing record
Setup steps and facts come from the official documentation linked on each page, checked on the date shown. We have not tested every combination on every computer; cost examples are illustrative.