The recommended installation is via npm or Homebrew (see INSTALLATION.md). These alternatives serve specific use cases.
Best for: contributors, development, or environments without npm/brew.
# Clone to Claude Code skills directory
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
# Optionally add CLI to PATH:
ln -sf ~/.claude/skills/loki-mode/bin/loki /usr/local/bin/loki
Update: cd ~/.claude/skills/loki-mode && git pull
Limitation: Does not install the loki CLI to PATH automatically. You must symlink or add to PATH manually.
Status: Image exists on Docker Hub. Tags: latest, one per release version (for example X.Y.Z, matching the npm version).
docker pull asklokesh/loki-mode:latest
Limitation: The image ships the Claude Code CLI. Docker is useful for:
loki in isolated environments)loki docker <command> runs any loki command in the image with the current folder mounted, so .loki/ state and resume behave like the local CLI.
See DOCKER.md for Docker-specific usage instructions.
Loki no longer ships a pull request review action (removed in the release after 11.178.0). For review on pull requests use Claude Code itself: anthropics/claude-code-action@v1, /code-review --comment from a terminal, or Code Review on Team and Enterprise plans. A workflow pinned to an older tag (asklokesh/loki-mode@v5 and the like) keeps working. To turn a labelled issue into a verified pull request in GitHub Actions, see Triggers without a cloud.
Status: Working. Release assets available for each version.
# Download the latest release and extract to the skills directory
VERSION=$(npm view loki-mode version)
curl -sL https://github.com/asklokesh/loki-mode/archive/refs/tags/v${VERSION}.tar.gz | tar xz
mv loki-mode-${VERSION} ~/.claude/skills/loki-mode
Best for: Offline or air-gapped environments, pinned version deployments.
This is the authoritative statement of what Loki Mode needs to run a first task. It mirrors one shared table, autonomy/lib/setup-requirements.json. loki doctor, loki doctor --requirements, loki doctor --json (key requirements), loki setup, and the runtime “provider CLI missing” errors all read that table, so wording and fixes match.
Normal repository build dependencies (the toolchain of the project you point Loki at) are not Loki overhead and are not listed.
loki doctor --requirements # per path: ready or not ready, each item required or optional, present or missing, one-line fix
loki doctor --json # same data under "requirements", plus "first_task_ready"
A first task is ready when every required “All paths” item is present and at least one execution path is ready. first_task_ready in the JSON reports exactly that. It checks presence on this machine; it does not prove that a provider login is valid or that an API key is accepted.
loki start runs the claude binary you installed and logged in with claude auth login. loki chat (with the claude provider) and loki edit call the claude CLI directly.claude CLI): loki "<goal>" needs only Anthropic credentials (for example ANTHROPIC_API_KEY), the bundled @anthropic-ai/claude-agent-sdk platform binary, and Bun. No claude CLI and no extra setting: the engine runs every session on the bundled SDK unless LOKI_E10_INVOKER=cli. loki start ./prd.md runs the same engine for a PRD up to 100000 bytes. A provider CLI on PATH is still needed by loki demo and loki quickstart (their provider check runs before the run starts), and by anything that reaches the bash loop: loki start --engine legacy, a PRD over 100000 bytes, and the --workspace / --deploy front end. Under LOKI_SDK_MODE=full with the claude provider, --engine legacy and a PRD over 100000 bytes are refused in one line instead.opencode replaces the claude CLI for loki start --provider opencode and reaches any model, including OpenRouter (see opencode with OpenRouter). Loki never silently substitutes a different provider than the one requested.| Install method | What it provides | What you still need |
|---|---|---|
npm install -g loki-mode |
Loki, a bundled Bun binary and the Claude Agent SDK as npm optional dependencies | Node 20+, git, curl, and one execution path above (python3 and jq are optional) |
npm install -g loki-mode --omit=optional (slim) |
Loki only; no bundled Bun, no Agent SDK | Everything above, plus Bun from https://bun.sh for the Bun route. Without Bun, bin/loki falls back to the bash CLI. The API-key path is unavailable |
Homebrew (brew install loki-mode) |
Loki | Same as npm, and install Bun yourself if you want the Bun route |
| git clone | Loki sources | Same as npm; see the Git Clone section above for the clone steps |
Supported platforms are the os entries in package.json (darwin, linux).
The tables below are generated from the shared requirements source. Do not edit between the markers.
Needed by every Loki command.
| Requirement | Level | Check | Fix |
|---|---|---|---|
| Node.js 20 or newer | required | node on PATH, version 20.0 or newer |
install Node 20+ from https://nodejs.org |
| Python 3.8 or newer (deep scans, Python repos, group runs; loki “ |
optional | python3 on PATH, version 3.8 or newer |
install python3 with your package manager (brew install python3) |
| jq (loki status and the bash fallback CLI; loki “ |
optional | jq on PATH |
install jq with your package manager (brew install jq) |
| git | required | git on PATH |
install git with your package manager (brew install git) |
| curl | required | curl on PATH |
install curl with your package manager (brew install curl) |
| bash 4.0 or newer | optional | bash on PATH, version 4.0 or newer |
install a newer bash (brew install bash); macOS ships 3.2 |
| Bun 1.3 or newer (bundled by npm install) | optional | bun on PATH, version 1.3 or newer |
reinstall without –no-optional (npm bundles @oven/bun-*) or install from https://bun.sh; without it loki falls back to the slower bash CLI |
Loki drives the claude binary you installed and logged in.
| Requirement | Level | Check | Fix |
|---|---|---|---|
| claude CLI on PATH (then log in: claude auth login) | required | claude on PATH |
npm install -g @anthropic-ai/claude-code |
loki “
| Requirement | Level | Check | Fix |
|---|---|---|---|
| Anthropic credentials (API key, OAuth token, auth token or gateway URL) | required | one of ANTHROPIC_API_KEY, CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL is set |
export ANTHROPIC_API_KEY= |
| Claude Agent SDK platform binary (optional npm dependency) | required | executable @anthropic-ai/claude-agent-sdk-<platform>/claude in an installed node_modules |
reinstall without –no-optional: npm install -g loki-mode (the SDK is an optionalDependency) |
| Bun runtime (the SDK loop runs only on the Bun route) | required | bun on PATH, version 1.3 or newer |
reinstall without –no-optional (npm bundles @oven/bun-*) or install from https://bun.sh |
opencode: replaces the claude CLI and reaches any model, including OpenRouter.
| Requirement | Level | Check | Fix |
|---|---|---|---|
| opencode CLI | optional | opencode on PATH |
npm install -g opencode-ai |
| Missing | Effect |
|---|---|
| @anthropic-ai/claude-agent-sdk (or its platform binary) | The api-key-sdk path is unavailable and doctor reports it not ready. The claude-cli path and all other providers are unaffected. |
| @oven/bun-* (Bun) | bin/loki falls back to the bash CLI (slower). The api-key-sdk path is unavailable because the SDK loop runs only on Bun. |
Supported providers are Claude Code (--provider claude, the default; API-key users run it through the Anthropic Agent SDK with no CLI) and opencode (--provider opencode). opencode reaches OpenRouter directly:
npm install -g opencode-ai
export OPENROUTER_API_KEY=sk-or-... # or: opencode auth login, then choose OpenRouter
opencode models openrouter | head # lists openrouter/<vendor>/<model> ids
loki start --provider opencode --model openrouter/deepseek/deepseek-v3.2 ./prd.md
Without the key, opencode models openrouter reports Provider not found: openrouter. LOKI_OPENCODE_MODEL=openrouter/<vendor>/<model> sets the model without the flag. Loki passes OPENROUTER_API_KEY through unchanged and runs opencode run --auto -m <model> <prompt>.
The Claude path can reach OpenRouter too, through a model route: loki start --model openrouter/<id> ./prd.md with --provider claude (or LOKI_MODEL_ROUTE=openrouter/<id>) points the claude CLI at OpenRouter with OPENROUTER_API_KEY.
scripts/smoke-install.sh packs the repository, installs the tarball into a temporary prefix, and runs loki --version, loki doctor --json and loki route "add a health endpoint" --json. It then repeats with Bun and the optional Agent SDK hidden. It is run by hand, is not part of CI, and writes a reproducible log. A run on one machine is evidence for that machine and OS only; it is not an OS matrix.
loki doctor --json runs a minimal bash evaluator (loki_requirements_json in autonomy/provider-offer.sh) over the same table. It checks presence only and does not compare versions, so the Node minimum is enforced only by the Bun doctor.first_task_ready does not verify that claude auth login was done or that an API key is valid.npm install -g --omit=optional still installed @oven/bun-* and the Claude Agent SDK packages. The smoke test removes them after install so the second case models a machine without them. This was not checked on other npm versions or from the registry.