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.
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.
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.
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.
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.
docker run command to paste.