Claude Code GitHub Guide: The GitHub Action, @claude Mentions, and PR Review
Macroscope
Macroscope
Product

Claude Code GitHub Guide: The GitHub Action, @claude Mentions, and PR Review

A practical guide to using Claude Code with GitHub: connecting it to your repositories, setting up the Claude Code GitHub Action, using @claude mentions in pull requests and issues, the three ways Claude Code reviews PRs, and where an independent reviewer like Macroscope fits.

Claude Code GitHub workflows come in four forms: Claude Code running locally in a cloned repository, the Claude Code GitHub Action that answers @claude mentions in pull requests and issues, the /code-review command, and Anthropic's managed Code Review service for Team and Enterprise plans. Which one you want depends on whether Claude should write code, answer questions, or review pull requests.

Most teams use two or three together. This guide covers each one using only what Anthropic's own documentation states, then shows where Macroscope fits as an independent reviewer and as a way to run coding agents in the cloud.

Claude Code GitHub in 30 seconds

  • Claude Code GitHub Action: anthropics/claude-code-action@v1 runs Claude Code in your workflows. Mention @claude in a PR or issue and it responds, implements changes and pushes commits.
  • Fastest setup: run /install-github-app inside Claude Code. It installs the Claude GitHub App, stores your secret and opens a workflow pull request.
  • Claude Code PR review: /code-review locally on any plan, a review workflow in your own CI, or managed Code Review on Team and Enterprise plans.
  • An independent reviewer: Macroscope reviews every pull request as a GitHub App at $0.05 per KB of diff, and its CLI ships a plugin for Claude Code (/macroscope:codereview).

What Does "Claude Code GitHub" Mean?

"Claude Code GitHub" covers four products that share the Claude Code name and are configured in different places. Anthropic's docs say so explicitly, so separate them before you set anything up.

  1. Claude Code in your terminal. The coding agent itself, working in a cloned GitHub repository. GitHub is where the work ends up.
  2. The Claude Code GitHub Action. An open-source Action at github.com/anthropics/claude-code-action that runs Claude Code inside your workflows and answers @claude.
  3. /code-review. A review you run from a Claude Code session against your branch or a pull request.
  4. Code Review, the managed service. Automatic review of every pull request on Anthropic's infrastructure, with no workflow file.

The first writes code. The second brings Claude Code into GitHub threads and automation. The last two are Claude Code code review at different levels of automation.

How Do I Connect Claude Code to GitHub?

Run Claude Code in a cloned repository for local work, then run /install-github-app from that session to bring Claude into GitHub itself. According to Anthropic's GitHub Actions documentation, quick setup works like this:

  1. Install the GitHub CLI and run gh auth login.
  2. Open claude in the repository and run /install-github-app.
  3. Claude Code installs the Claude GitHub App and saves a repository secret: ANTHROPIC_API_KEY for an API key, or CLAUDE_CODE_OAUTH_TOKEN for a Claude subscription token.
  4. It pushes a branch with the workflow files you chose and opens a pull request. Merge it, and @claude works.

You need admin access to the repository. The docs also note that the Claude GitHub App's permission set is shared by every Claude feature that touches GitHub, and GitHub does not let you accept only part of it.

What Is the Claude Code GitHub Action?

The Claude Code GitHub Action is anthropics/claude-code-action, which runs Claude Code inside your repository's workflows so it can analyze code, implement changes and push commits. Anthropic positions it for turning issues into pull requests, fixing bugs from a comment and automating recurring tasks. It picks a mode from your workflow:

  • Interactive mode. With no prompt input, Claude waits for @claude in an issue or PR comment, a PR review, or a new issue, and replies on that thread.
  • Automation mode. With a prompt input, Claude runs on whatever event triggers the workflow, including a schedule. Results go to the workflow run log by default.

It runs on your own GitHub Actions runners with your own API key or subscription, and you control the model and tools through the claude_args input.

How Do I Set Up the Claude Code GitHub Action Manually?

Install the Claude GitHub App, add an authentication secret, and copy Anthropic's example workflow into .github/workflows/. Anthropic suggests this path when you do not run Claude Code locally or want full control of the files.

  1. Install the app from github.com/apps/claude. The Action uses read and write access to Contents, Issues and Pull requests.
  2. Add a secret. ANTHROPIC_API_KEY from the Claude Console, or CLAUDE_CODE_OAUTH_TOKEN, generated with claude setup-token and available on Pro, Max, Team and Enterprise plans.
  3. Copy examples/claude.yml, a working workflow that responds to @claude. Its core step is:
- uses: anthropics/claude-code-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

For an organization, the docs suggest installing the app once at the org level and storing the secret as an organization-level Actions secret, using an API key rather than an OAuth token, since a token is tied to one person's subscription. Teams using their own cloud account can set use_bedrock, use_vertex or use_foundry.

How Do @claude Mentions Work in Pull Requests and Issues?

Anyone with write access can mention @claude in a pull request or issue comment, and Claude replies on the same thread and updates that reply as it works. Anthropic's examples include implementing a feature from an issue description and fixing a specific TypeError. Rules worth knowing:

  • Write access is required on issue and PR events, unless you allow users with allowed_non_write_users.
  • Bots are rejected unless listed in allowed_bots, which prevents loops.
  • The mention must be exact: @claude as a whole word, not /claude or @claude-bot.
  • CI on Claude's commits: GitHub does not trigger workflows on commits made with the default GITHUB_TOKEN, so let the Action authenticate as the Claude GitHub App.

Can Claude Code Review Pull Requests?

Yes. Claude Code reviews pull requests through /code-review in your own session, a review workflow built on the Claude Code GitHub Action, or the managed Code Review service. They differ in what starts a review, where it runs and who can use it.

/code-review. Anthropic's docs say it works on any plan and reviews your branch for correctness bugs. /code-review 1234 targets a pull request, --fix applies the findings, and --comment posts them to the PR as inline comments.

A Claude Code GitHub Action review workflow. Anthropic's example runs its code-review plugin when a PR opens, updates, reopens or is marked ready. With --comment, Claude posts an inline comment per issue, or one summary when it finds none, and it skips drafts.

Managed Code Review. Anthropic's Code Review docs describe several agents reading each change alongside the surrounding code, a verification step that filters false positives, and inline comments ranked by severity plus a check run named Claude Code Review. Each repository runs reviews once per PR, after every push, or only on @claude review. Our Claude Code Review guide covers it in depth.

How Do the Claude Code PR Review Options Compare?

Only managed Code Review runs automatically without a workflow file you maintain, and it is the only option limited to Team and Enterprise plans.

/code-reviewGitHub Action review workflowCode Review (managed)
Starts onYou run itYour workflow's PR eventsPR activity per repo setting, or @claude review
Runs onYour Claude Code sessionYour GitHub Actions runnersAnthropic infrastructure
Who can use itAny planAnyone with an API key or cloud credentialsTeam and Enterprise, once an Owner turns it on
BillingPlan usage or API billingActions minutes plus API tokensToken usage through usage credits
Posts on the PRWith --commentWith --commentYes, plus a check run

Managed Code Review never approves or blocks a pull request, and its check run does not conclude as a failure. Merge decisions stay with your team.

What Does Claude Code on GitHub Cost?

The Claude Code GitHub Action costs GitHub Actions minutes plus API tokens (or subscription usage with an OAuth token), and managed Code Review is billed on token usage through usage credits. Anthropic's current docs give no flat per-review price for either.

To bound Action runs, the docs recommend specific @claude requests, a concise CLAUDE.md, --max-turns in claude_args, workflow timeouts and concurrency controls. For managed Code Review, Anthropic's costs page says cost scales with review level, change size, surrounding complexity and how many candidate issues need verification, and an organization can set a monthly spend limit. At launch in March 2026, Anthropic's announcement said reviews "generally average $15-25."

Where Does Macroscope Fit With Claude Code on GitHub?

Macroscope is an independent AI code reviewer that runs on every GitHub pull request, and its CLI includes a plugin for Claude Code so the same reviewer can check your branch before you push. Claude Code writes the change. Macroscope reviews it with a reviewer that did not write it, so the assumptions that produced a bug are not the ones checking for it.

Before you push. The Macroscope CLI installs with one command and adds optional plugins for Claude Code, Codex, Cursor and OpenCode. In Claude Code, /macroscope:codereview runs a review, validates each finding against the code and fixes the confirmed ones. /macroscope:autoloop repeats that cycle until no issues remain, for up to five passes, in an isolated git worktree. Setup details are in our AI code review in Claude Code guide.

On every pull request. Macroscope runs as a GitHub App and posts inline comments, looking past the diff into the rest of the repository to check whether a change breaks dependent code. It can also:

Cost. Code review is $0.05 per KB of diff, 10 KB minimum ($0.50 floor), no per-seat fee. CLI reviews use Agent credits at $0.01 each, with 1,000 per workspace per month. New workspaces get $100 in usage credit, with caps per review and per PR and monthly budget limits. See pricing. On Macroscope's own 118-bug benchmark, it detected 48% of bugs.

Need better visibility into your codebase?
Get started with $100 in free usage.

How Do Murmur and Claude Code Work Together on GitHub?

Murmur, from Macroscope, runs coding agents such as Claude Code in dedicated cloud environments and keeps their pull requests moving through review comments and failing checks until they are ready for human approval. The @claude workflow handles one request per job. Murmur is built for many agents in parallel:

  • Cloud sandboxes. Each agent gets its own VM with your repository and stack running, so it can test its work before opening a PR.
  • Self-driving pull requests. Agents respond to review comments, repair failing checks, rebase and resolve merge conflicts.
  • Director. Murmur's CLI is available from a local Claude Code or Codex session, so your local agent can coordinate remote ones.
  • Agent-agnostic. It runs Claude Code, Codex and other agents with your own model keys.

Pair it with Macroscope review and the loop closes: an agent opens a PR, Macroscope reviews it, and the agent addresses the comments until checks pass. See why we built Murmur.

What Are the Best Practices for Claude Code on GitHub?

Treat Claude Code on GitHub like any contributor with write access: clear standards, narrow permissions, bounded runs, and an independent review before merge.

  • Write a CLAUDE.md with code style, review criteria and preferred patterns. Managed Code Review also reads REVIEW.md from the base branch.
  • Keep keys in GitHub Secrets, never in the repository.
  • Grant only the permissions a workflow needs and review Claude's changes before merging.
  • Bound runs with --max-turns, timeouts and concurrency controls.
  • Separate writing from reviewing, and make the review a required check so a failure actually stops a merge.

Frequently Asked Questions

How do I use Claude Code with GitHub?

Run Claude Code inside a cloned GitHub repository for local work, then run /install-github-app from that session. It installs the Claude GitHub App, saves an ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN secret, and opens a pull request with the workflow files. Once merged, mentioning @claude in a pull request or issue starts Claude Code on your GitHub Actions runners. You need admin access to set it up.

What is the Claude Code GitHub Action?

It is anthropics/claude-code-action, an open-source GitHub Action that runs Claude Code in your workflows. In interactive mode it responds to @claude in issues and pull requests. In automation mode it runs a prompt you define on any GitHub event, including a schedule.

Can Claude Code review pull requests?

Yes, three ways. /code-review reviews your branch or a PR number from a Claude Code session on any plan, and --comment posts findings to the PR. A Claude Code GitHub Action workflow can run Anthropic's code-review plugin on every PR in your own CI. Managed Code Review, for Team and Enterprise organizations, reviews PRs automatically on Anthropic's infrastructure.

How do I set up the Claude Code GitHub Action without /install-github-app?

Install the Claude GitHub App from github.com/apps/claude, add an ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN secret, and copy Anthropic's examples/claude.yml into .github/workflows/. With a subscription token, change the anthropic_api_key line to claude_code_oauth_token.

Why is Claude not responding to @claude?

Anthropic's troubleshooting guide lists the usual causes: the Claude GitHub App is not installed, workflows are disabled, the secret is missing, the comment does not use @claude as a whole word, or the commenter lacks write access.

What is the difference between the Claude Code GitHub Action and Claude Code Review?

The Action runs on your own runners with your workflow file and key, and it can push commits as well as review. Code Review is a managed service on Anthropic's infrastructure for Team and Enterprise organizations that reviews PRs without a workflow file and never pushes commits. Anthropic's launch post described Code Review as optimized for depth and more expensive than the Action.

How much does Claude Code GitHub integration cost?

The Action consumes GitHub Actions minutes plus Claude API tokens, or subscription usage with an OAuth token. Managed Code Review is billed on token usage through usage credits, with an optional monthly spend limit. At its March 2026 launch, Anthropic said reviews generally averaged $15 to $25.

Does Claude Code Review approve or block pull requests?

No. Anthropic's documentation says a review never approves or blocks a pull request, and its check run does not conclude as a failure. If you want a reviewer that can auto-approve low-risk PRs or fail a check on a rule violation, Macroscope offers Approvability and Check Run Agents with conclusion: failure.

How does Macroscope work with Claude Code?

The Macroscope CLI installs an optional plugin for Claude Code. Run /macroscope:codereview and Claude Code uses the CLI to review your branch, validate each finding and fix the confirmed ones, or /macroscope:autoloop to repeat that for up to five passes. On GitHub, Macroscope reviews every pull request as a GitHub App, so one reviewer checks the work locally and on the PR.

Can Claude Code respond to review comments and failing CI on its own?

With the Action, Claude responds when someone mentions @claude, and you can automate prompts on GitHub events. Murmur goes further for teams running many agents: each agent runs Claude Code, Codex or another agent in its own cloud VM, responds to review comments, repairs failing checks and resolves merge conflicts until the PR is ready for human approval.