HomeClaude Code › GitHub
OverviewInstallCLI referencePricing & limitsAgent SDKSkills & pluginsGitHubWeb, desktop & IDEModelsErrorsOpen source?TutorialFor studentsQA automation中文指南
Last updated: September 22, 2026

Claude Code in GitHub: the App, the Action and @claude

Claude Code can live inside your repository's workflow: reviewing pull requests, implementing issues when mentioned, and running as a step in CI. Three pieces make that work.

TLDR

  • /install-github-app from a terminal session sets up the GitHub App and the workflow for you.
  • The workflow uses anthropics/claude-code-action and needs one secret: the API key.
  • Point ANTHROPIC_BASE_URL at the gateway in the workflow env and CI runs bill here instead.

1. Install the GitHub App

claude
/install-github-app

The command walks through installing the app on the repository, storing the API key as a repository secret and opening a pull request that adds the workflow file. You can also do all three by hand.

2. The workflow

name: Claude
on:
  issue_comment: { types: [created] }
  pull_request_review_comment: { types: [created] }
  issues: { types: [opened, assigned] }

jobs:
  claude:
    if: contains(github.event.comment.body, '@claude') || github.event_name == 'issues'
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      issues: write
      id-token: write
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 1 }
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
        env:
          ANTHROPIC_BASE_URL: https://aiprimetech.io

With the env line, every run in CI goes through the gateway: your repository secret is a gateway key, and the usage lands on your gateway balance or unlimited plan. Remove the env line to bill an Anthropic account instead.

3. Using it

Costs in CI

Each trigger is a full agent run: checkout, read the relevant files, plan, edit, test, push. Expect tens of thousands of tokens per run on a real repository. Teams that wire @claude into every PR are precisely the users for whom a flat-rate plan beats per-token billing — see the pricing guide.

Permissions and safety

Frequently asked questions

Is the Claude Code GitHub Action free?

The Action is open source and free; the runs cost tokens on whichever key the workflow uses.

Can the GitHub Action use a non-Anthropic endpoint?

Yes. Set ANTHROPIC_BASE_URL in the step's env and provide the matching key as the secret.

Does @claude work in private repositories?

Yes, once the GitHub App is installed on the repository and the workflow file is present.

Run Claude Code on the gateway

Same models, two environment variables, credits at 7.69× face value — or a flat-rate unlimited plan.

Get an API key See unlimited plans

AI Prime Tech is an independent API gateway and is not affiliated with, endorsed by, or sponsored by Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic. Claude Code features described here follow Anthropic’s public documentation at the time of writing and change frequently; prices and model lists on this page are read from this gateway’s live settings.

More Claude Code guides

Claude Code: the complete guideHow to install Claude CodeClaude Code CLI documentation: commands and flagsClaude Code pricing and limits, explainedThe Claude Code SDK, now the Claude Agent SDKClaude Code skills and pluginsDoes Claude Code have a web interface? Web, desktop and IDE explainedWhich model Claude Code uses, and how to change itClaude Code errors and how to fix themIs Claude Code open source?Claude Code tutorial: your first real sessionClaude Code for studentsHow to use Claude Code for QA automationClaude Code 怎么用:从安装到日常使用