Claude Code GitHub Actions

Claude Code GitHub Actions let you mention `@claude` in an issue or pull request comment, and Claude does the work inside your repo. It can read the code, answer a question, fix a bug or build a feature from the issue. The action is called `claude-code-action`, and it runs on your own GitHub runner. This guide covers setup, the workflow file, who can start a run, what it costs and how to fix a silent bot.

How Do I Set It Up The Quick Way?

Open `claude` in the repo you want to connect, then run `/install-github-app` and follow the prompts. You need admin access to the repo. The command works only with repos on github.com. Install the GitHub CLI first and sign in with `gh auth login`, since Claude checks for it.

Next, the command installs the Claude GitHub App. It saves your key in the repo as a secret called `ANTHROPIC_API_KEY`, or your subscription token as `CLAUDE_CODE_OAUTH_TOKEN`. Claude then pushes a branch with the workflow files and opens a pull request for you to create. Merge it, and `@claude` works in that repo.

How Do I Set It Up By Hand?

Use the manual path when you don't run Claude locally, when the command fails or when you want full control of the files. It takes three steps.

First, you install the Claude GitHub App on your repo. The action needs it to read and write files, issues and pull requests.

Next, you add a secret to the repo. Use `ANTHROPIC_API_KEY` for an API key, or use `CLAUDE_CODE_OAUTH_TOKEN` for a Claude subscription. You make the token by running `claude setup-token` on your own machine. In the workflow, the key goes to the `anthropic_api_key` input and the token goes to `claude_code_oauth_token`.

Last, you copy examples/claude.yml into the `.github/workflows/` folder of your repo. The file is a real workflow, so it runs as soon as you commit it. To test it, tag `@claude` in an issue or pull request comment.

What Does The Workflow File Look Like?

This is the example from the docs. Claude answers when someone mentions `@claude` in an issue or a review comment.

name: Claude Code
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
      id-token: write
      actions: read
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 1
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

A few lines matter more than the rest. You need `id-token: write` for the default app sign-in, and `actions: read` lets Claude see CI results on pull requests. The `if` check keeps a runner from starting on comments that don't mention `@claude`. If you use a subscription, swap the last line for this one.

claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

How Do I Ask Claude For Help?

Write a comment that starts with `@claude` and says what you want. Here are three requests from the docs.

@claude implement this feature based on the issue description
@claude how should I implement user authentication for this endpoint?
@claude fix the TypeError in the user dashboard component

Claude replies in a comment on the same issue or pull request. It keeps that comment updated as it works.

Can It Run Without A Mention?

It can, because the action picks its mode from your workflow. With no `prompt` input, it waits for someone to type `@claude`. When you add a `prompt` input, Claude runs on any GitHub event you choose, such as a cron schedule. The results show up in the workflow run log. The `prompt` can also call a skill by its slash command.

Who Can Start A Run?

On issue and pull request events, the person who comments must have write access to the repo. The action also turns away bots, which keeps them from setting Claude off in a loop. To let a bot in, list it in `allowed_bots`.

What Will Claude Not Do?

Claude creates and pushes commits, but it does not merge, rebase or force push. It also can't change your workflow files, because the app has no write access to them. By default, Claude does not open the pull request itself. It pushes to a branch and gives you a link to a filled-in pull request page, so a person makes the final call. Its GitHub token lasts only a short time and works only in that one repo. To make commits and open pull requests from your own terminal, see how Claude Code works with git.

How Much Does Each Run Cost?

Each run uses two things. It uses GitHub Actions minutes, since it runs on GitHub-hosted runners. It also uses API tokens, based on the size of the prompt, the reply, the task and your codebase. If you sign in with an OAuth token, runs use your Claude subscription instead of API billing.

You can cut both costs. Write clear requests so Claude needs fewer turns, and keep your `CLAUDE.md` short, since Claude reads it on every run. Our guide to CLAUDE.md and auto memory explains what belongs in that file. You can also cap the turns in `claude_args`, as in this line from the docs.

claude_args: "--max-turns 5 --model claude-sonnet-5 --mcp-config /path/to/config.json"

Time limits on each job help too, and so do limits on how many runs go at once.

Why Is Claude Not Responding?

Work down this list when a mention gets no reply.

Which Plugins Help With CI Workflows?

These two plugins help when you build or run workflows with Claude:

FAQ

Can I Change The Word That Calls Claude?

You can. Set the `trigger_phrase` input to the phrase you want, since `@claude` is only the default.

Why Doesn't CI Run On Claude's Commits?

GitHub doesn't start workflows on commits made with the default `GITHUB_TOKEN`. If you pass that token to the action, remove it so the action signs in as the Claude GitHub App.

Can I Use Amazon Bedrock?

You can. Set `use_bedrock: "true"` in the action step. The cloud providers sign in through OIDC, so you store no static cloud keys in your repo.

How Do I Move Off The Beta?

Change `@beta` to `@v1` in the `uses` line, then remove the `mode` input. Replace `direct_prompt` with `prompt`, and move options like the model into `claude_args`.

Is This The Same As Code Review?

It is not. Code Review is its own product, and it checks every pull request with no workflow file to write. To run a review from Claude Code yourself, compare six review plugins side by side.

Ad Sponsor this spot. Reach developers who pick skills