# Loki Mode

> Turns a GitHub issue, spec or one-line task into a pull request with a signed evidence receipt

- Category: AI Coding / AI SDLC Automation
- Language: Shell, Python, TypeScript
- Licence: BUSL-1.1 (Business Source License 1.1; changes to Apache-2.0 on 2030-03-19)
- Repository: https://github.com/asklokesh/loki-mode
- Website: https://www.autonomi.dev
- Canonical page: https://ai-tldr.dev/tools/loki-mode/

## In short

Loki Mode is a source-available autonomous coding tool from Autonomi that its README calls an autonomous software factory. It sits in the AI SDLC Automation category of the AI Coding tools and is open-source, written in Shell, Python, TypeScript and licensed BUSL-1.1 (Business Source License 1.1; changes to Apache-2.0 on 2030-03-19).

## Overview

Loki Mode is a source-available autonomous coding tool from Autonomi that its README calls an autonomous software factory. You hand it a GitHub, GitLab, Jira or Linear issue, a PRD, an OpenAPI document or a one-line task; it derives a delivery contract (the acceptance criteria), builds against it, and ends with a signed Evidence Receipt stating what was proven and what was not. If the contract cannot be derived, it stops and asks one question instead of guessing.

The work is done by a coding CLI that Loki drives, and the CLI is swappable. Claude Code is the provider it is built for and tests end to end; Cline, Codex CLI, Aider and opencode are wired in as experimental providers, and an `ANTHROPIC_API_KEY` alone also works because the Claude Agent SDK ships inside Loki. Everything runs on your machine with your own keys, and `loki doctor` checks the setup and names any blocker.

Each run of the Loki 10 engine (the default for `loki "<task>"` and `loki owner/repo#N` per its README on 2026-10-04) moves through a fixed state machine: intake, plan, a sealed set of acceptance tests written from the task alone, implement, verify with up to two fix rounds, commit, seal and pull request. The receipt separates deterministic facts (the diff hash, test and build commands with their exit codes) from AI assessments, is signed with a local Ed25519 key, and can be re-checked by anyone with `loki verify`. The code is licensed under the Business Source License 1.1, which allows individual, non-commercial, internal-business, academic and evaluation use, with a commercial licence offered for other uses and a change to Apache-2.0 on 2030-03-19.

## What it does

- Issue, spec or one-line task in; a pull request with a reviewer-friendly body out
- Acceptance tests written from the task alone and sealed before implementation, then verified with up to two fix rounds
- Signed Evidence Receipts that `loki verify` re-hashes and checks against the run's event log
- Swappable coding providers: Claude Code (full support), Cline, Codex CLI, Aider and opencode
- Intake from GitHub, GitLab, Jira and Linear, plus `loki backlog` to work many labelled issues in parallel worktrees
- Per-run cost cap, a local control-plane UI, two-way Slack and a bundled MCP server and Claude Code plugin

## Getting started

Install the CLI, let `loki doctor` check your setup, then point it at a task or an issue. You can preview a real receipt first without installing anything.

1. Preview a receipt without installing

   The tour prints a real Evidence Receipt from a past build. It needs no key, no spend and no network.

```bash
npx loki-mode tour
```

2. Install the CLI

   Bun is the recommended install; npm, Homebrew (`brew tap asklokesh/tap && brew install loki-mode`) and a Docker image (`docker pull asklokesh/loki-mode:latest`) also work.

```bash
bun install -g loki-mode
# or
npm install -g loki-mode
```

3. Give it a model and check the setup

   An Anthropic API key is enough, or install and log in to a supported coding CLI such as Claude Code. `loki doctor` reports what is missing with an install command for each gap.

```bash
export ANTHROPIC_API_KEY=sk-...
loki doctor
```

4. Run a task or an issue

   `loki quick` runs one small task without a pull request, `--no-pr` builds and verifies any task without opening one, and an issue reference goes all the way to a pull request.

```bash
loki quick "fix the login bug"
loki "fix the login redirect loop" --no-pr
loki owner/repo#123
```

5. Check the result

   `loki status [run-id]` reports on a run, and `loki verify` re-hashes the receipt and checks its signature and event log. Exit code 0 means VERIFIED.

```bash
loki status
loki verify
```

## When to use it

- Turning a well-specified GitHub, Jira or Linear issue into a draft or verified pull request with a 60-second review body
- Working a labelled issue backlog overnight with `loki backlog` from a scheduled GitHub Actions workflow
- Keeping an auditable, re-checkable record of what an AI coding run actually tested before its work is merged
- Wrapping Claude Code or another coding CLI in a contract-and-verify loop with a hard cost cap
