> Crysk 0.9.0 docs. Index of every page: https://crysk.dev/llms.txt

# Claude Code review on your plan

Run a Claude Code review on every pull request in GitHub Actions with your Claude Pro or Max plan. Create the token with claude setup-token.

At the end, Crysk runs a Claude Code review on every pull request in GitHub Actions, on the Claude Pro or Max plan you already pay for, with no per-token invoice. You create a long-lived token with `claude setup-token`, store it as a repository secret, and the open-source Crysk Action uses it. If you have not added the workflow yet, start with the [quickstart](https://crysk.dev/docs/quickstart-github-actions.md).

## Before you start

- **The Crysk workflow** in `.github/workflows/crysk.yml`, created by `npx -y crysk setup --ci`.
- **Claude Code with a Pro or Max plan**, to create the token: check with `claude --version`.
- **The GitHub CLI, logged in**, with admin or write access to the repository: check with `gh auth status`.

## 1. Create a token with `claude setup-token`

```bash
claude setup-token
```

It prints a long-lived token (about a year). Use this command: the session token that `/login` leaves on your machine expires in hours and Crysk rejects it once it does.

## 2. Store it as a secret

Paste the token when `gh` asks for the value:

```bash
gh secret set CRYSK_CLAUDE_OAUTH_TOKEN
```

The workflow Crysk scaffolds already passes this secret to the action. If you wrote the workflow yourself, add `CRYSK_CLAUDE_OAUTH_TOKEN=${{ secrets.CRYSK_CLAUDE_OAUTH_TOKEN }}` as a line of the `crysk-secrets` input: a secret the workflow does not pass never reaches Crysk.

## 3. Check it

Open a pull request from a branch of the same repository. The `crysk` check should finish with `review posted` or `review complete`.

## Use an API key instead

Create a key in the Claude Console and store it:

```bash
gh secret set CRYSK_CLAUDE_API_KEY
```

Reviews on a key are billed per token to your Anthropic account.

## When both are set

A run uses one Claude credential, chosen once when it starts. By default the subscription goes first and the key is never used. To bill the API key first, set the order in the `CRYSK_CREDENTIALS` repository variable:

```bash
gh variable set CRYSK_CREDENTIALS --body '{"claude": ["api_key", "subscription"]}'
```

A credential that is not in the list is never used, and one that is listed but not set is skipped.

## What a review bills against

| Credential | Bills against | Crysk GitHub App dollar limits |
|---|---|---|
| `CRYSK_CLAUDE_OAUTH_TOKEN` | The quota of your Claude plan | Never skip the run |
| `CRYSK_CLAUDE_API_KEY` | Your Anthropic account, per token | Can skip the run |

## If it fails

| Error | What to do |
|---|---|
| `CRYSK-CRED-MISSING` | No credential reached the action. Set one of the secrets above and check the workflow passes it in `crysk-secrets`. |
| `CRYSK-CRED-REJECTED` | The token or key is expired, revoked, or a `/login` session token. Run `claude setup-token` again and set the secret anew. |

Both are described in the [error codes](https://crysk.dev/docs/reference/error-codes.md). After fixing the secret, comment `/crysk review` on the pull request.
