Claude Code + GitHub Integration

Wire Claude Code into GitHub so it can open branches, push commits, and respond to @claude on your issues and pull requests.

By David Iya - Updated 2026-08-04

You already run Claude Code in the desktop app to build features, but the handoff to GitHub is still manual. You copy diffs, write your own commit messages, and open pull requests by hand. The GitHub integration closes that loop: Claude commits its own work and can pick up tasks straight from an issue or a pull request comment.

Before you start

  • The Claude Code desktop app installed and signed in (the terminal CLI is optional).
  • A GitHub account with admin access to the repository you want to connect.
  • An Anthropic API key you can store as a GitHub Actions secret (only needed for the @claude bot, not for local commits).

What it unlocks

It commits its own work

Running locally, Claude Code stages changes, writes a clear commit message, and can open the pull request with the gh CLI - so the trail in GitHub matches what actually changed.

@claude works inside pull requests

With the GitHub App installed, you tag @claude in an issue or a PR review comment and it implements the change on a branch and pushes it back, without you leaving GitHub.

Review-driven fixes

Point Claude at a failing check or a reviewer comment and it reads the diff, the CI log, and the surrounding code before proposing a fix - not just the single line that broke.

How to connect GitHub

1

Open your repo in Claude Code

Launch the desktop app and open the project folder that is already a git repository. Local commits and PRs work from here with no extra install.

2

Install the GitHub App for @claude

From inside Claude Code, run the install command below. It walks you through authorizing the Claude GitHub App on the repositories you choose and adds the workflow file.

/install-github-app
3

Add your Anthropic API key as a repo secret

In GitHub, go to Settings then Secrets and variables then Actions, and add ANTHROPIC_API_KEY. The workflow reads this so the @claude bot can run.

4

Tag @claude to test it

Open an issue, describe a small change, and comment '@claude please implement this'. The action runs, pushes a branch, and links a pull request back in the thread.

From idea to merged PR

  1. Describe the change locally

    In the Claude Code desktop app, tell it what you want built and let it edit the files across the project.

  2. Let it commit and open the PR

    Ask it to commit the change with a descriptive message and open a pull request with the gh CLI.

  3. Iterate from review comments

    When a reviewer leaves a comment, tag @claude on it so the fix lands on the same branch.

What people build with it

Turn an issue into a pull request

Drop the acceptance criteria in a GitHub issue, tag @claude, and get a branch plus a draft PR to review instead of a blank editor.

Clean, honest commit history

Let Claude write the commit messages for the work it did locally so your history reads like a changelog, not 'wip' twelve times.

Unblock a red CI check

Paste the failing job into Claude Code and have it trace the error through the code before touching anything.

Commands & configuration

Install the GitHub App + Actions workflow

/install-github-app

Run this inside Claude Code, not in a plain terminal.

Let Claude open the PR after committing

gh pr create --fill

Requires the GitHub CLI to be installed and authenticated.

Prompts to steal

Commit the work with a real message

Stage the changes you just made, write a commit message that explains what changed and why in imperative mood, then open a pull request with gh and summarize the diff in the PR body.

Fix a failing check

Here is the failing CI log. Trace the error to its root cause in the code, explain what is actually breaking, propose the smallest correct fix, then apply it and push to the current branch.

Recommended MCP servers

  • GitHub MCP server

    Adds read/write access to issues, pull requests, and file contents as tools, useful when you want Claude to reason across many repos, not just the one open locally.

Skills worth having

  • Commit and PR discipline

    The habit of one logical change per commit with a message that explains why - the thing that makes an AI-driven history readable months later.

Troubleshooting

Keep it safe

  • Store the Anthropic key as a GitHub Actions secret, never in a committed file. Anyone with the key can spend on your account.
  • Scope the GitHub App to only the repositories that need it rather than granting access to the whole account.
  • Review the bot's pull requests before merging. Treat its output like any other contributor's, not as automatically trusted.

GitHub + Claude Code: FAQ

Do I need the terminal to use Claude Code with GitHub?

No. The Claude Code desktop app handles local commits and, with the gh CLI installed, pull requests. The terminal is optional.

Does the @claude bot cost money?

The GitHub Action runs against your Anthropic API key, so usage bills to your Anthropic account. Local work in the desktop app uses your existing Claude plan.

Can Claude Code work across multiple repositories at once?

Locally it works in the repo you have open. To reason across several repos, add the GitHub MCP server so it can read issues and files from others as tools.

More integrations

Learn to drive Claude Code, not just install it

The GitHub setup is the easy part. Knowing how to make Claude ship real, reviewable work is the skill we teach every day.

Related: what is Claude Code, glossary, and use cases.