How do I use Claude Code with GitHub, and @claude in pull requests?

Short answer

Claude Code GitHub Actions is a GitHub Action, anthropics/claude-code-action@v1, that runs Claude Code inside your repository's workflows. The quick setup is /install-github-app in Claude Code, which needs admin access to the repo. After that, anyone with write access can mention @claude in an issue or PR to get code analyzed, changed and pushed. Each run uses GitHub Actions minutes plus API tokens or your Claude subscription.

What it is

Claude Code GitHub Actions is a normal GitHub Action, anthropics/claude-code-action@v1, built on the Claude Agent SDK. It runs Claude Code on a GitHub-hosted runner inside your workflow. It is not the same product as Anthropic’s managed Code Review, which reviews pull requests without a workflow file, or as Claude Code in the cloud.

It runs in two modes, which it picks from your workflow:

Mode When Where the result goes
Interactive No prompt input in the workflow A comment on the issue or PR, updated while Claude works
Automation A prompt input is set, for example on every PR or on a cron schedule The workflow run log, unless the prompt tells Claude to post and it has a tool for that

Set it up

You need admin access to the repository.

  1. Install the GitHub CLI and log in with gh auth login.
  2. Run /install-github-app in Claude Code, inside the repo. It installs the Claude GitHub App and stores a secret: ANTHROPIC_API_KEY for an API key, or CLAUDE_CODE_OAUTH_TOKEN for a token from your Claude subscription.
  3. Pick the workflows. Claude Code pushes a branch with claude.yml (and optionally a review workflow) and opens GitHub with the pull request ready.
  4. Merge that pull request. From then on @claude works.
  5. Test it with a comment such as @claude fix the TypeError in the user dashboard component.

Manual setup is the same in three steps: install the Claude GitHub App, add the secret, and copy examples/claude.yml from the action’s repository into .github/workflows/. Quick setup only works for github.com repositories.

For an organization, install the app once at organization level, store the secret as an organization Actions secret, and add the workflow per repo or as a reusable workflow. To avoid a long-lived secret, the action can use workload identity federation with a Claude Console service account.

What it can do

  • Answer and act on @claude in issue comments, PR comments, PR reviews, and the title or body of a new issue: explain code, propose an approach, implement a change and push commits.
  • Turn an issue into a pull request.
  • Run a skill from .claude/skills/ or from a plugin, for example the code-review plugin on every opened PR, posting inline comments with --comment.
  • Run on a schedule, such as a daily summary of commits and open issues. In automation mode Claude gets no shell or GitHub API access until you grant tools with --allowedTools in claude_args.

Two checks run before Claude starts: on issue and PR events the person who triggered it must have write access, and bots are rejected unless listed in allowed_bots, which prevents loops.

What it costs

Every run uses two things:

  1. GitHub Actions minutes on GitHub-hosted runners, billed by GitHub.
  2. Tokens. With an API key, each run is billed per token by Anthropic, depending on prompt length, task size and codebase. With CLAUDE_CODE_OAUTH_TOKEN, runs count against your Claude subscription instead.

The docs list ways to keep both down: write specific @claude requests, use issue templates for context, keep CLAUDE.md short because Claude reads it on every run, cap turns with --max-turns in claude_args, set workflow timeouts, and use GitHub’s concurrency controls. For what Claude Code costs per developer in general, see Claude Code token cost per developer.

The misunderstanding: “the app only gets the permissions it needs”

The Claude GitHub App is shared by the Action, Code Review and auto-fix in cloud sessions, and GitHub does not let you accept part of an app’s permissions. Installing it grants read and write on contents, issues, pull requests, workflows, actions and more. If your organization only wants what the Action uses (contents, issues and pull requests), create a custom GitHub App instead; Code Review then still needs the official app. Either way, review Claude’s changes before merging and keep keys in GitHub Secrets, never in the repo.

What this means for a team

The Action reads CLAUDE.md from the repository on every run, so the team’s conventions travel with the repo, and a good CLAUDE.md makes runs shorter and cheaper. What it does not see is anything outside the checkout: the decision in last week’s thread, the customer constraint in a document. Each run starts fresh. See how Claude Code memory works for what does carry over, and is Claude Code safe for company code for the data side.

Where Bombos fits

A GitHub run knows the repo and the issue, and nothing the team decided elsewhere. Bombos is a plugin that gives Claude Code and the team’s other AI tools one shared memory: team knowledge, rules the team learned, and what is already in mail, documents and repos, each answer traceable to its source. One developer can try it on their own agents first.

Related questions

Can I use my Claude Pro or Max subscription instead of an API key?

Yes. Run claude setup-token locally and store the token as the CLAUDE_CODE_OAUTH_TOKEN secret; it works on Pro, Max, Ultra, Team and Enterprise. For a secret shared across an organization, the docs recommend an API key, because an OAuth token is tied to the subscription of the person who created it.

Why doesn't Claude respond to @claude?

Check that the GitHub App is installed, workflows are enabled, the secret is set, the comment contains @claude as a whole word, and the commenter has write access to the repository.

Why doesn't CI run on Claude's commits?

GitHub does not trigger workflows on commits made with the default GITHUB_TOKEN. Remove a github_token: secrets.GITHUB_TOKEN line so the action authenticates as the Claude GitHub App, or pass a custom app token.

Does it work with GitLab?

Not this action, and /install-github-app only works with github.com. For GitLab there is a separate Claude Code GitLab CI/CD integration.

Can we route it through Bedrock or Google Cloud?

Yes. Set use_bedrock, use_vertex or use_foundry to true in the workflow and authenticate through OIDC, so no static cloud credentials live in the repository.

Sources

  1. Claude Code docs: Claude Code GitHub Actions
  2. Claude Code docs: Code Review
  3. Claude Code docs: Data usage
The first half hour · free

What does your AI forget?

  1. 01You tell us which AI you use and where it keeps starting over.
  2. 02We show what a shared memory changes there, on your own examples.
  3. 03You keep the plan, with or without Bombos.
Piet Baudoin
Piet BaudoinYou talk to Piet, from the Bombos teamDutch team from Utrecht and Nijmegen · data in Europe
We reply the same working day.