Autonomous spec-to-product coding-agent CLI with an MCP server exposing 34 tools over stdio.
$git clone https://github.com/asklokesh/loki-modeInstalls into the current project.
Install loki-mode by running `git clone https://github.com/asklokesh/loki-mode`, then use it for the current task and follow its documentation at https://github.com/asklokesh/loki-mode.
| 1 | <div align="center"> |
| 2 | |
| 3 | # Loki Mode |
| 4 | |
| 5 | ### The spec-driven autonomous builder with verified completion. |
| 6 | |
| 7 | _The free, source-available autonomous coding agent by [Autonomi](https://www.autonomi.dev/). Same Loki CLI, SDK, and MCP for everyone; the commercial editions for teams and enterprises are sold under the **Autonomi** brand (Autonomi Cloud, Autonomi Enterprise)._ |
| 8 | |
| 9 | **Hand it a spec. It does not accept "done" on an empty diff or failing tests.** |
| 10 | |
| 11 | [](https://www.npmjs.com/package/loki-mode) |
| 12 | [](https://www.npmjs.com/package/loki-mode) |
| 13 | [](https://hub.docker.com/r/asklokesh/loki-mode) |
| 14 | [](LICENSE) |
| 15 | |
| 16 | [Website](https://www.autonomi.dev/) | [Documentation](wiki/Home.md) | [Installation](docs/INSTALLATION.md) | [Changelog](CHANGELOG.md) | [Purple Lab -- deprecated v7.44.0](#purple-lab) |
| 17 | |
| 18 | **Current release: v7.121.5** |
| 19 | |
| 20 | </div> |
| 21 | |
| 22 | --- |
| 23 | |
| 24 | > **How it works:** Drop a spec -- a PRD, GitHub issue, OpenAPI/JSON/YAML, or one-line brief. Loki Mode classifies complexity (`run.sh:detect_complexity()`), assembles an agent team from 41 specialized agent roles across 8 domains - prompt-defined specifications the orchestrator adopts per phase, with parallel review (blind council) and optional worktree streams on Claude Code, sequential on other providers - and runs autonomous RARV cycles (Reason - Act - Reflect - Verify, see `run.sh:run_autonomous()`) with 8 quality gates (see `skills/quality-gates.md`). Code is not "done" until it passes automated verification. Output is a Git repo with source, tests, configs, and audit logs. |
| 25 | |
| 26 | --- |
| 27 | |
| 28 | ## Why Loki Mode? |
| 29 | |
| 30 | - **Spec-driven, autonomous, with a built-in trust layer** -- Hand Loki a spec, walk away, come back to working code with tests. The full RARV-C closure loop (Reason - Act - Reflect - Verify - Close) runs until the work is actually done, not just attempted. The verified-completion evidence gate (`skills/quality-gates.md`) refuses any "done" claim on an empty git diff against the run-start commit, and blocks completion when tests run red, so "complete" means proven, not promised. |
| 31 | - **A checklist verifier that is honest, not brittle** -- Each completion checklist item is checked deterministically before the completion council will accept "done". The verifier speaks extended regex (`grep -E`) so real LLM-emitted patterns match instead of erroring, and it is runner-agnostic: it runs the project's own declared test command rather than assuming a fixed runner. Crucially, a check that cannot be established is reported as inconclusive (pending), never as a false pass and never as a false failure. `rc == 0` alone is not a pass; a test check goes green only on a real "N passed" signal from the runner (v7.121.x). |
| 32 | - **Production quality built in** -- 8 quality gates (`skills/quality-gates.md`), blind 3-reviewer code review (`run.sh:run_code_review()`), anti-sycophancy checks |
| 33 | - **Standalone verification: `loki verify`** -- Run Loki's deterministic gates (build, tests, static analysis, secret scan, dependency audit) against any branch or PR diff, including code written by other agents or humans. CI-ready exit codes (0 VERIFIED, 1 CONCERNS, 2 BLOCKED), machine-readable evidence at `.loki/verify/evidence.json`. Inconclusive evidence is never reported as VERIFIED (v7.27.0). |
| 34 | - **Living spec and pre-build interrogation** -- `loki spec` locks a spec and detects drift deterministically (`spec.lock`, `drift-report.json`, and a `SPEC_DRIFT` finding in `loki verify` with CI exit codes), so you can tell when the build diverges from what was agreed. `loki grill` runs a Devil's-Advocate i |