Claude Code does not have to run on your computer. The Claude Code GitHub Action runs it inside your repository's GitHub workflows, so you can mention @claude in an issue and get a branch with the fix, or have every new pull request reviewed, with your laptop closed. Most setup guides start by creating an API key, but you don't need one. A Claude Pro, Max, Team, or Enterprise subscription is enough, and a single command does the setup.
What the Claude Code GitHub Action does
GitHub Actions is GitHub's automation service. It runs workflows, small configuration files stored in the repository's .github/workflows/ folder, on GitHub's own servers whenever something happens: a new issue, a comment, a pull request.
The Claude Code GitHub Action is a ready-made workflow step from Anthropic. It runs Claude Code headless, the same way claude -p runs it from a script: there is no conversation and nobody at the keyboard to approve anything. Claude still reads your repository's CLAUDE.md on every run, so it follows the same project rules it follows on your computer.
The Action works in two modes, and the workflow file decides which one:
- Interactive mode waits for someone to mention
@claudein an issue or pull request, then answers there. - Automation mode has a prompt written into the workflow and runs on an event, such as every new pull request, without anyone mentioning Claude.
Both modes use the same GitHub App and the same token, so one setup covers both.
What you need
The setup runs from Claude Code on your own computer, so three things need to be in place first:
- A repository on github.com where you have admin access.
- The GitHub CLI, signed in with
gh auth login. Claude Code checks for it during setup. - Claude Code on your computer, signed in with a Pro, Max, Team, or Enterprise plan.
You don't need an API key or a Claude Console account.
Set it up with one command
Open a terminal in the project folder, start claude, and run /install-github-app. Then follow the prompts:
- Install the Claude GitHub App in your browser. Select only the repositories you want Claude to work on.
- Choose the workflows. One responds to
@claudementions, the other reviews pull requests. You can take both. - When asked how to authenticate, create a long-lived token with your Claude subscription. Claude Code saves it in the repository as an encrypted secret named
CLAUDE_CODE_OAUTH_TOKEN. - Claude Code pushes a branch with the workflow files and opens GitHub with a pull request ready. Create the pull request and merge it.

That is the whole setup. To confirm the secret is there, open the repository's Settings, then Secrets and variables > Actions. GitHub shows the secret's name, but never its value again.
One thing to check before you start: if Claude Code already has an API key, the setup reuses that key and doesn't offer the subscription token. Run /status to see which credential your session uses.
Ask Claude from an issue or pull request
Write a comment that mentions @claude, followed by what you want:
@claude implement this issue@claude why does the test in this pull request fail?@claude add input validation to the order form and update the tests
Claude replies with a comment and keeps updating it while it works. You can also watch the run in the repository's Actions tab. When the request needs code changes, Claude commits them to a new branch. By default, it doesn't open the pull request on its own: its comment includes a link that creates one, so a person still decides what gets proposed. From there, you review it like any other pull request.
Claude only responds to @claude as a complete word, so /claude or @claude-bot won't start a run.

Automatic pull request reviews
The review workflow has its prompt built in, so it doesn't wait for a mention. It runs when a pull request is opened, updated, reopened, or marked ready for review. Claude posts each problem it finds as an inline comment on the line concerned, or one summary comment when it finds nothing.
It skips draft and closed pull requests, pull requests it already commented on, and pull requests it judges don't need a review, such as trivial or automated ones.
Both workflows follow your CLAUDE.md, which makes it the place to describe your coding standards and what a review should look for. Keep it short, because Claude reads it on every run.
Don't confuse this workflow with Code Review, Anthropic's managed review service for Team and Enterprise plans. Code Review needs no workflow file, while the review workflow runs in your own GitHub Actions and works on any paid plan.
Manual setup with a subscription token
If the setup command doesn't fit your situation, for example because you don't run Claude Code locally, you can do the same steps by hand:
- Install the Claude GitHub App on the repository.
- Run
claude setup-tokenon your computer. It opens the same browser sign-in as a normal login and prints a token that is valid for one year. The token isn't saved anywhere, so copy it right away. - Add the token as a repository secret named
CLAUDE_CODE_OAUTH_TOKEN. - Copy the example
claude.ymlfrom the claude-code-action repository into.github/workflows/, and replace itsanthropic_api_keyline with this one:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
The example workflows in the documentation all use API key authentication, and this same one-line change switches any of them to your subscription.
Two limits come with the subscription token. It is tied to the subscription of the person who created it, so for a secret shared across an organization's repositories, the documentation recommends an API key instead. And because it lasts one year, note the date, or the workflows will stop authenticating when it expires.
What a run costs
Every run uses two things:
- GitHub Actions minutes for the server that runs the workflow. Standard GitHub-hosted runners are free in public repositories, and private repositories use the monthly minutes included in your GitHub plan.
- Claude usage. With the subscription token, runs use your Claude subscription instead of API billing.
Specific requests and a short CLAUDE.md keep both low, because Claude needs fewer turns to finish. For a hard cap, add --max-turns to the workflow's claude_args input.
Who can trigger it
On issues and pull requests, only people with write access to the repository can start a run. Someone who comments @claude on your public repository can't make Claude work on your subscription. Bots are blocked unless you allow them by name, which keeps two automations from triggering each other in a loop. On public repositories, GitHub also withholds secrets from pull requests opened from forks, so the review workflow only runs on branches inside the repository.
Write access decides who can start Claude, not what Claude reads. An issue from an outside contributor can hide instructions in its Markdown, for example in an HTML comment that the page doesn't display, and the Action's security documentation recommends checking such content before you ask Claude to work on it. Review Claude's changes before merging, as you would anyone else's.
Conclusion
The Claude Code GitHub Action brings Claude Code into your repository: @claude in an issue or pull request for work on request, and a review workflow for every new pull request. You don't need an API key to run it. Run /install-github-app, choose the subscription token, merge the pull request it prepares, and describe your standards in CLAUDE.md so both workflows follow them.
Relevant Training
The Claude Code GitHub Action is covered in Claude Code Agents and Automation, part of Cybrec's Claude AI training program, together with headless runs, hooks, subagents, and routines.


0 Comments