I am using Claude Code for a few weeks now and it's been really great. So great that after a few days of intensive usage I decided to opt in for the 100$/month plan Claude Max which include usage of Claude Code.

Last week, during the Code with Claude event, Anthropic released "Github Actions" for Claude Code. It provides a more integrated experience of Claude Code with github workflows such as using "@claude" on PR or issues to start prompting Claude to do some work for us. This integration really look like the response from Anthropic to OpenAI codex or google jules release earlier last week as well.

It's all really great and obviously I wanted to try it immediately. However I was very disappointed to learn that if I want to use this integration, I have to create a new API Key and start paying for usage on top of my Claude Max subscription. It felt even worst when I started digging into the code of the github actions and realised OIDC is supported for vertex and bedrock use but not for Claude Max subscribers...

So I went on and created a fork of Anthropic's github action which allow you to specify your Claude Max credentials. With it you can now use your Claude Max subscription with Claude github actions.

In order to use the fork your will need: * a valid Claude Max subscription. * a target github repository which you own on which you want to install the integration.

Here is how it works:

  1. First, make sure you are logged in locally in Claude Code with your Claude Max Subscription:
    • start claude code by typing claude in your terminal.
    • run /status to make sure under Account it shows something like: Login Method: Claude Max Account (5x).
    • if it doesn't: run /login and follow the instruction to login with your Claude Max subscription.
  2. Install Anthropic's Github App for your repository:
    • within claude code you can type /install-github-app it will redirect you to your browser to install the github app. When prompted for an anthropic api key just press enter.
    • Make sure to give the app permission to access your target repository.
  3. Add your Claude Max subscription credentials as secrets on your github repository:
    • In your target github repository navigate to Settings > Secrets and variables > actions.
    • Click on new repository secret and add the following secrets: CLAUDE_ACCESS_TOKEN, CLAUDE_REFRESH_TOKEN, CLAUDE_EXPIRES_AT. You will find value for those in the following file:
      • on linux: ~/.claude/.credentials.json
      • on macOS: search for claude in keychain -> click on show password.
      • on windows: not sure but let me know and I will update the guide.
  4. Finally you can now add a github workflow that leverage the forked github action. Here is an example which enables @claude on issues, comments and PR:
# .github/workflows/claude.yml
name: Claude PR Assistant

on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]
  issues:
    types: [opened, assigned]
  pull_request_review:
    types: [submitted]

jobs:
  claude-code-action:
    if: |
      (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
      (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
      (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
      (github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      issues: read
      id-token: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 1

      - name: Run Claude PR Action
        uses: grll/claude-code-action@beta
        with:
          use_oauth: true
          claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
          claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
          claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}

          timeout_minutes: "60"

You can now enjoy your Claude Max Subscription in github actions. Have a look at the fork for more examples.

A word of caution: while I couldn't find anything in the ToS that this usage would be violating, a member of Anthropic's staff said:

Noting that this is not a supported use of Claude Max.

Don't abuse it and don't use it to share a single Claude Max subscription on shared repositories. Your Claude Max subscription is and should remain for your personal usage only.