# loki-mode [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/asklokesh/loki-mode  
**GitHub Stars:** 1119  
**npm Downloads (last month):** 88294  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/loki-mode

## Description
Autonomous spec-to-product coding-agent CLI with an MCP server exposing 34 tools over stdio.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "loki-mode": {
    "command": "npx",
    "args": ["-y","loki-mode"]
  }
}
```

## Documentation

## What loki-mode does

loki-mode combines a coding-agent workflow with an MCP server that exposes 34 tools over stdio. Its primary workflow accepts a task description, a PRD file, or an issue reference such as `owner/repo#123`. The agent derives a delivery contract, writes checks from the requested behavior, implements the change, verifies the result, and records the outcome.

A successful run can open a pull request containing the requested change, test information, and details about what was not proven. Runs can also stop without opening a pull request when they fail, hit a budget, encounter a specification conflict, or become stalled. `--no-pr` supports building and verifying locally without creating a pull request.

## How it works

The CLI runs against a model provider, with Claude Code as the default provider. The bundled Agent SDK can use `ANTHROPIC_API_KEY`, and the workflow also recognizes `OPENAI_API_KEY` for spend-cap behavior. Other coding CLIs can be selected with `--provider`.

After implementation, loki-mode seals a receipt at `.loki/runs/<run-id>/receipt.json`. The receipt is signed with a local Ed25519 key created on first use. `loki verify` re-hashes the receipt, checks its signature against the event log, and verifies that the checkout still matches the sealed code. A public key can be exported for verification on another machine.

For multi-repository work, a workspace can combine child receipts into a signed composite receipt. The composite verification result cannot exceed the weakest child result.

## Setup and configuration

Install the package globally with npm:

```bash
npm install -g loki-mode
```

The package installs the Bun runtime as an optional dependency. Bun, Homebrew, and Docker installation paths are also available. Run `loki setup` for the first-run wizard, or use `loki doctor --fix`.

A basic task looks like this:

```bash
cd your-repo
loki start "add rate limiting to /api/login"
```

Use `loki edit` for a single targeted change, `loki quick` for a small task with verification, and `loki chat` for an interactive Plan and Build workflow. Set `--max-cost` to limit a run, `--provider` to choose a coding CLI, or `budgets.per_run` in `loki.yaml` to configure a budget.

## Tools and capabilities

- Exposes 34 MCP tools over stdio.
- Converts tasks, PRDs, and supported issue references into coding work.
- Runs implementation and verification steps.
- Opens ready or draft pull requests based on the result.
- Creates signed, locally verifiable run receipts.
- Supports receipt-gated multi-repository workspaces.
- Offers optional deployment through explicit policy and execution controls.

## Limitations and notes

A receipt records only the checks that ran; its signature establishes who produced it, not that the code is free of defects. Verification can report an unchecked result if the checkout no longer matches the sealed code. Declared behavior changes normally require a fail-to-pass Wall test, although `LOKI_MUTATION_STRICT=0` can opt out.

Deployment requires `loki deploy --execute` or `loki start --deploy`, a verified HEAD-anchored receipt, and permission from `.loki/policies.json`. The `propose`, `execute`, and `operate` autonomy settings control whether runs may open pull requests or deploy. The default spend cap is $100 when an Anthropic or OpenAI API key is set; subscription-based logins have no dollar cap by default.

The `npx loki-mode start` and `npx loki-mode tour` demonstrations can produce receipts without a provider or key. The initial package download still requires network access.

_Full upstream README: https://allmcps.com/mcp/loki-mode/readme_

