# loki-mode

An autonomous coding agent that carries a task through to a pull request and leaves a signed record of the run. Handy when you want proof of what actually happened.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 1107
- Author: asklokesh
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/asklokesh/loki-mode
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/loki-mode

## What it does

loki-mode ships as a CLI and exposes 39 tools through an MCP server over stdio. Give it a task, a PRD file, or an issue from GitHub, GitLab or Jira. It derives a delivery contract from that input, writes checks before it touches any code, implements the change, then runs those checks. A run ends in one of six outcomes: VERIFIED, ALREADY_SATISFIED, FAILED, BUDGET_STOP, BLOCKED or STALLED. When the contract as written cannot be met, the run halts and asks a single question rather than guessing.

Only a VERIFIED run pushes its branch and opens a pull request; every other outcome leaves the branch on your machine and prints its location. The record lands in `.loki/runs/<run-id>/receipt.json`, signed with an Ed25519 key generated on the first run. `loki verify` re-hashes it, checks the signature against the run's event log, and prints a verdict. A signature tells you who issued the record, not that the code is correct — the record covers the checks that ran and names the ones that did not.

A model is required. Claude (`claude`) is the default provider, installed and logged in. The bundled Agent SDK with `ANTHROPIC_API_KEY` can take its place on the main path. Spend is capped at $100 by default when `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` is set, and there is no dollar cap on a subscription login. Use `--max-cost <usd>` or `budgets.per_run` in `loki.yaml` to set your own.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add loki-mode -- npx -y loki-mode
```

### Codex

**Platform CLI**
```bash
codex mcp add loki-mode -- npx -y loki-mode
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "loki-mode": {
            "command": "npx",
            "args": [
                "-y",
                "loki-mode"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "loki-mode": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "loki-mode"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add loki-mode npx -y loki-mode
```

## When to use it
- turn an issue into a pull request without babysitting every step
- get a signed record of which checks actually ran
- stop an agent at a spend cap instead of after the bill
- seal one verifiable record across changes in several repositories
- tell a run that passed its checks apart from one that merely finished

## Example prompts
- Run loki start "add rate limiting to /api/login" and show me the receipt verdict
- Verify the latest run with loki verify and explain the exit code
- Build the payments workspace and check composite.json

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
