How it works Features Pricing Docs Log in Start free

Connect Claude to your AFK runner

An AFK runner builds your stories autonomously — it picks up an AFK-eligible story, runs Claude to implement it, runs your tests, and opens a pull request for you to review. Because the runner runs on your machine, it uses your Claude credential. This page shows how to supply it. Your credential and your code never leave your machine — KnightLeap only coordinates.

You supply the Claude credential; we never see it. It lives only in your runner's environment. That's the whole point of a self-hosted runner — the one secret stays with you.

Option A — your Claude subscription (simplest)

If you have a Claude Pro or Max subscription, mint a long-lived token from the Claude Code CLI:

claude setup-token

It opens a browser, you approve, and it prints a token. Give it to your runner as CLAUDE_CODE_OAUTH_TOKEN. Zero marginal cost — it runs on your existing subscription.

Option B — a Console API key (recommended for a spend cap)

Create an API key in the Anthropic Console and give it to your runner as ANTHROPIC_API_KEY. This bills per token rather than a flat subscription, but you can set a monthly spend limit on the key and see exactly what AFK costs — the safer choice if you want a hard ceiling.

Give it to the runner

Pass whichever credential you chose as an environment variable when you start the runner, alongside the runner token from Settings → AFK runners:

docker run --rm \
  -e KNIGHTLEAP_RUNNER_TOKEN=kl_run_... \
  -e CLAUDE_CODE_OAUTH_TOKEN=...        \  # or ANTHROPIC_API_KEY=...
  ghcr.io/rickapichairuk/afk-runner

Store it the way you'd store any secret — a .env file with tight permissions, or your own secret manager. Rotate it any time; the runner picks up the new value on its next start.

If both are set, the API key wins. When ANTHROPIC_API_KEY and CLAUDE_CODE_OAUTH_TOKEN are both present, Claude Code uses the API key — you'll be billed per token even though your subscription token is right there. Unset ANTHROPIC_API_KEY if you mean to run on your Pro/Max plan.
No runner yet? Enroll one in Settings → AFK runners — it gives you a registration token and the exact docker run command to paste.