Skip to content

davila7/claude-code-templates / cli-tool/components/skills/ai-research/loki-mode

loki-mode

Flagged

Multi-agent autonomous startup system for Claude Code. Triggers on "Loki Mode". Orchestrates 100+ specialized agents across engineering, QA, DevOps, security, data/ML, business operations, marketing, HR, and customer success. Takes PRD to fully deployed, revenue-generating product with zero human intervention. Features Task tool for subagent dispatch, parallel code review with 3 specialized reviewers, severity-based issue triage, distributed task queue with dead letter handling, automatic deployment to cloud providers, A/B testing, customer feedback loops, incident response, circuit breakers, and self-healing. Handles rate limits via distributed state checkpoints and auto-resume with exponential backoff. Requires --dangerously-skip-permissions flag.

FileKindSize
.github/workflows/claude-code-review.ymlconfig1.9 KB
.github/workflows/claude.ymlconfig1.8 KB
.github/workflows/release.ymlconfig4.8 KB
.gitignoreother10 B
ACKNOWLEDGEMENTS.mdmarkdown11.8 KB
CHANGELOG.mdmarkdown83.9 KB
CLAUDE.mdmarkdown4.3 KB
CONTEXT-EXPORT.mdmarkdown6.5 KB
INSTALLATION.mdmarkdown9.1 KB
LICENSEother1.1 KB
README.mdmarkdown18.2 KB
SKILL.mdskill md27.9 KB
VERSIONother7 B
autonomy/.loki/dashboard/index.htmlother15.2 KB
autonomy/CONSTITUTION.mdmarkdown10.2 KB
autonomy/README.mdmarkdown7.5 KB
autonomy/run.shexecutablescript74.4 KB
benchmarks/datasets/humaneval.jsonlother209.4 KB
benchmarks/datasets/swebench-lite.jsonconfig321 B
benchmarks/prepare-submission.shexecutablescript6.6 KB
benchmarks/results/2026-01-05-00-23-56/SUMMARY.mdmarkdown1.2 KB
benchmarks/results/2026-01-05-00-23-56/humaneval-results.jsonconfig365 B
benchmarks/results/2026-01-05-00-23-56/swebench-results.jsonconfig383 B
benchmarks/results/2026-01-05-00-49-17/SUMMARY.mdmarkdown1.2 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-results.jsonconfig33.6 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/0.pyscript528 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/1.pyscript936 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/10.pyscript758 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/100.pyscript598 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/101.pyscript537 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/102.pyscript436 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/103.pyscript519 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/104.pyscript602 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/105.pyscript1.1 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/106.pyscript749 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/107.pyscript938 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/108.pyscript720 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/109.pyscript1.6 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/11.pyscript443 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/110.pyscript882 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/111.pyscript859 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/112.pyscript732 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/113.pyscript853 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/114.pyscript447 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/115.pyscript1.2 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/116.pyscript521 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/117.pyscript995 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/118.pyscript835 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/119.pyscript1002 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/12.pyscript564 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/120.pyscript706 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/121.pyscript339 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/122.pyscript494 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/123.pyscript1.1 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/124.pyscript1.6 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/125.pyscript757 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/126.pyscript943 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/127.pyscript1.5 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/128.pyscript653 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/129.pyscript2.2 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/13.pyscript264 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/130.pyscript940 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/131.pyscript417 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/132.pyscript1.0 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/133.pyscript524 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/134.pyscript779 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/135.pyscript481 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/136.pyscript667 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/137.pyscript751 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/138.pyscript295 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/139.pyscript455 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/14.pyscript263 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/140.pyscript989 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/141.pyscript1.4 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/142.pyscript822 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/143.pyscript1.0 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/144.pyscript780 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/145.pyscript702 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/146.pyscript700 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/147.pyscript734 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/148.pyscript1.1 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/149.pyscript880 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/15.pyscript266 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/150.pyscript371 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/151.pyscript647 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/152.pyscript845 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/153.pyscript1.4 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/154.pyscript567 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/155.pyscript427 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/156.pyscript750 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/157.pyscript463 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/158.pyscript524 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/159.pyscript1.1 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/16.pyscript295 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/160.pyscript968 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/161.pyscript637 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/162.pyscript337 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/163.pyscript425 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/17.pyscript736 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/18.pyscript548 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/19.pyscript714 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/2.pyscript360 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/20.pyscript835 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/21.pyscript493 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/22.pyscript349 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/23.pyscript153 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/24.pyscript260 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/25.pyscript689 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/26.pyscript406 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/27.pyscript205 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/28.pyscript240 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/29.pyscript367 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/3.pyscript590 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/30.pyscript262 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/31.pyscript525 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/32.pyscript1.5 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/33.pyscript710 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/34.pyscript172 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/35.pyscript200 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/36.pyscript357 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/37.pyscript481 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/38.pyscript567 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/39.pyscript762 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/4.pyscript530 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/40.pyscript684 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/41.pyscript661 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/42.pyscript239 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/43.pyscript582 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/44.pyscript441 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/45.pyscript158 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/46.pyscript620 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/47.pyscript342 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/48.pyscript271 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/49.pyscript245 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/5.pyscript466 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/50.pyscript412 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/51.pyscript469 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/52.pyscript255 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/53.pyscript129 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/54.pyscript458 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/55.pyscript302 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/56.pyscript559 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/57.pyscript458 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/58.pyscript268 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/59.pyscript477 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/6.pyscript832 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/60.pyscript259 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/61.pyscript559 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/62.pyscript333 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/63.pyscript624 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/64.pyscript560 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/65.pyscript433 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/66.pyscript410 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/67.pyscript876 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/68.pyscript1.5 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/69.pyscript709 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/7.pyscript379 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/70.pyscript693 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/71.pyscript589 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/72.pyscript837 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/73.pyscript612 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/74.pyscript779 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/75.pyscript846 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/76.pyscript571 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/77.pyscript467 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/78.pyscript1.1 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/79.pyscript600 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/8.pyscript527 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/80.pyscript563 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/81.pyscript1.9 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/82.pyscript580 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/83.pyscript855 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/84.pyscript556 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/85.pyscript288 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/86.pyscript660 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/87.pyscript1.1 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/88.pyscript784 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/89.pyscript847 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/9.pyscript506 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/90.pyscript531 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/91.pyscript601 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/92.pyscript586 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/93.pyscript974 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/94.pyscript1.1 KB
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/95.pyscript1003 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/96.pyscript804 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/97.pyscript421 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/98.pyscript396 B
benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/99.pyscript886 B
benchmarks/results/2026-01-05-01-24-17/SUMMARY.mdmarkdown1.3 KB
benchmarks/results/2026-01-05-01-24-17/swebench-patches/astropy__astropy-12907.patchother1.0 KB
benchmarks/results/2026-01-05-01-24-17/swebench-patches/astropy__astropy-14182.patchother2.3 KB
benchmarks/results/2026-01-05-01-24-17/swebench-patches/astropy__astropy-14365.patchother1.3 KB
benchmarks/results/2026-01-05-01-24-17/swebench-patches/astropy__astropy-14995.patchother1.1 KB
benchmarks/results/2026-01-05-01-24-17/swebench-patches/astropy__astropy-6938.patchother997 B
benchmarks/results/2026-01-05-01-24-17/swebench-patches/astropy__astropy-7746.patchother1.6 KB
benchmarks/results/2026-01-05-01-24-17/swebench-patches/django__django-10914.patchother3.3 KB
benchmarks/results/2026-01-05-01-24-17/swebench-patches/django__django-10924.patchother1.9 KB
benchmarks/results/2026-01-05-01-24-17/swebench-patches/django__django-11001.patchother4.3 KB
benchmarks/results/2026-01-05-01-24-17/swebench-patches/django__django-11019.patchother20.2 KB
# Loki Mode

**The First Truly Autonomous Multi-Agent Startup System**

[![Claude Code](https://img.shields.io/badge/Claude-Code-orange)](https://claude.ai)
[![Agent Types](https://img.shields.io/badge/Agent%20Types-37-blue)]()
[![Loki Mode](https://img.shields.io/badge/Loki%20Mode-98.78%25%20Pass%401-blueviolet)](benchmarks/results/)
[![HumanEval](https://img.shields.io/badge/HumanEval-98.17%25%20Pass%401-brightgreen)](benchmarks/results/)
[![SWE-bench](https://img.shields.io/badge/SWE--bench-99.67%25%20Patch%20Gen-brightgreen)](benchmarks/results/)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)

> **PRD → Deployed Product in Zero Human Intervention**
>
> Loki Mode transforms a Product Requirements Document into a fully built, tested, deployed, and revenue-generating product while you sleep. No manual steps. No intervention. Just results.

---

## Demo

[![asciicast](https://asciinema.org/a/EqNo5IVTaPJfCjLmnYgZ9TC3E.svg)](https://asciinema.org/a/EqNo5IVTaPJfCjLmnYgZ9TC3E)

*Click to watch Loki Mode build a complete Todo App from PRD - zero human intervention*

---

## Benchmark Results

### Three-Way Comparison (HumanEval)

| System | Pass@1 | Details |
|--------|--------|---------|
| **Loki Mode (Multi-Agent)** | **98.78%** | 162/164 problems, RARV cycle recovered 2 |
| Direct Claude | 98.17% | 161/164 problems (baseline) |
| MetaGPT | 85.9-87.7% | Published benchmark |

**Loki Mode beats MetaGPT by +11-13%** thanks to the RARV (Reason-Act-Reflect-Verify) cycle.

### Full Results

| Benchmark | Score | Details |
|-----------|-------|---------|
| **Loki Mode HumanEval** | **98.78% Pass@1** | 162/164 (multi-agent with RARV) |
| **Direct Claude HumanEval** | **98.17% Pass@1** | 161/164 (single agent baseline) |
| **Direct Claude SWE-bench** | **99.67% patch gen** | 299/300 problems |
| **Loki Mode SWE-bench** | **99.67% patch gen** | 299/300 problems |
| Model | Claude Opus 4.5 | |

**Key Finding:** Multi-agent RARV matches single-agent performance on both benchmarks after timeout optimization. The 4-agent pipeline (Architect->Engineer->QA->Reviewer) achieves the same 99.67% patch generation as direct Claude.

See [benchmarks/results/](benchmarks/results/) for full methodology and solutions.

---

## What is Loki Mode?

Loki Mode is a Claude Code skill that orchestrates **37 specialized AI agent types** across **6 swarms** to autonomously build, test, deploy, and scale complete startups. It dynamically spawns only the agents you need—**5-10 for simple projects, 100+ for complex startups**—working in parallel with continuous self-verification.

```
PRD → Research → Architecture → Development → Testing → Deployment → Marketing → Revenue
```

**Just say "Loki Mode" and point to a PRD. Walk away. Come back to a deployed product.**

---

## Why Loki Mode?

### **Better Than Anything Out There**

| What Others Do | What Loki Mode Does |
|----------------|---------------------|
| **Single agent** writes code linearly | **100+ agents** work in parallel across engineering, ops, business, data, product, and growth |
| **Manual deployment** required | **Autonomous deployment** to AWS, GCP, Azure, Vercel, Railway with blue-green and canary strategies |
| **No testing** or basic unit tests | **14 automated quality gates**: security scans, load tests, accessibility audits, code reviews |
| **Code only** - you handle the rest | **Full business operations**: marketing, sales, legal, HR, finance, investor relations |
| **Stops on errors** | **Self-healing**: circuit breakers, dead letter queues, exponential backoff, automatic recovery |
| **No visibility** into progress | **Real-time dashboard** with agent monitoring, task queues, and live status updates |
| **"Done" when code is written** | **Never "done"**: continuous optimization, A/B testing, customer feedback loops, perpetual improvement |

### **Core Advantages**

1. **Truly Autonomous**: RARV (Reason-Act-Reflect-Verify) cycle with self-verification achieves 2-3x quality improvement
2. **Massively Parallel**: 100+ agents working simultaneously, not sequential single-agent bottlenecks
3. **Production-Ready**: Not just code—handles deployment, monitoring, incident response, and business operations
4. **Self-Improving**: Learns from mistakes, updates continuity logs, prevents repeated errors
5. **Zero Babysitting**: Auto-resumes on rate limits, recovers from failures, runs until completion
6. **Efficiency Optimized**: ToolOrchestra-inspired metrics track cost per task, reward signals drive continuous improvement

---

## Dashboard & Real-Time Monitoring

Monitor your autonomous startup being built in real-time through the Loki Mode dashboard:

### **Agent Monitoring**

<img width="1200" alt="Loki Mode Dashboard - Active Agents" src="docs/screenshots/dashboard-agents.png" />

**Track all active agents in real-time:**
- **Agent ID** and **Type** (frontend, backend, QA, DevOps, etc.)
- **Model Badge** (Sonnet, Haiku, Opus) with color coding
- **Current Work** being performed
- **Runtime** and **Tasks Completed**
- **Status** (active, completed)

### **Task Queue Visualization**

<img width="1200" alt="Loki Mode Dashboard - Task Queue" src="docs/screenshots/dashboard-tasks.png" />

**Four-column kanban view:**
- **Pending**: Queued tasks waiting for agents
- **In Progress**: Currently being worked on
- **Completed**: Successfully finished (shows last 10)
- **Failed**: Tasks requiring attention

### **Live Status Monitor**

```bash
# Watch status updates in terminal
watch -n 2 cat .loki/STATUS.txt
```

```
╔════════════════════════════════════════════════════════════════╗
║                    LOKI MODE STATUS                            ║
╚════════════════════════════════════════════════════════════════╝

Phase: DEVELOPMENT

Active Agents: 47
  ├─ Engineering: 18
  ├─ Operations: 12
  ├─ QA: 8
  └─ Business: 9

Tasks:
  ├─ Pending:     10
  ├─ In Progress: 47
  ├─ Completed:   203
  └─ Failed:      0

Last Updated: 2026-01-04 20:45:32
```

**Access the dashboard:**
```bash
# Automatically opens when running autonomously
./autonomy/run.sh ./docs/requirements.md

# Or open manually
open .loki/dashboard/index.html
```

Auto-refreshes every 3 seconds. Works with any modern browser.

---

## Autonomous Capabilities

### **RARV Cycle: Reason-Act-Reflect-Verify**

Loki Mode doesn't just write code—it **thinks, acts, learns, and verifies**:

```
1. REASON
   └─ Read .loki/CONTINUITY.md including "Mistakes & Learnings"
   └─ Check .loki/state/ and .loki/queue/
   └─ Identify next task or improvement

2. ACT
   └─ Execute task, write code
   └─ Commit changes atomically (git checkpoint)

3. REFLECT
   └─ Update .loki/CONTINUITY.md with progress
   └─ Update state files
   └─ Identify NEXT improvement

4. VERIFY
   └─ Run automated tests (unit, integration, E2E)
   └─ Check compilation/build
   └─ Verify against spec

   IF VERIFICATION FAILS:
   ├─ Capture error details (stack trace, logs)
   ├─ Analyze root cause
   ├─ UPDATE "Mistakes & Learnings" in CONTINUITY.md
   ├─ Rollback to last good git checkpoint if needed
   └─ Apply learning and RETRY from REASON
```

**Result:** 2-3x quality improvement through continuous self-verification.

### **Perpetual Improvement Mode**

There is **NEVER** a "finished" state. After completing the PRD, Loki Mode:
- Runs performance optimizations
- Adds missing test coverage
- Improves documentation
- Refactors code smells
- Updates dependencies
- Enhances user experience
- Implements A/B test learnings

**It keeps going until you stop it.**

### **Auto-Resume & Self-Healing**

**Rate limits?** Exponential backoff and automatic resume.
**Errors?** Circuit breakers, dead letter queues, retry logic.
**Interruptions?** State checkpoints every 5 seconds—just restart.

```bash
# Start autonomous mode
./autonomy/run.sh ./docs/requirements.md

# Hit rate limit? Script automatically:
# ├─ Saves state checkpoint
# ├─ Waits with exponential backoff (60s → 120s → 240s...)
# ├─ Resumes from exact point
# └─ Continues until completion or max retries (default: 50)
```

---

## Quick Start

### **1. Install**

```bash
# Clone to your Claude Code skills directory
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
```

See [INSTALLATION.md](INSTALLATION.md) for other installation methods (Web, API Console, minimal curl install).

### **2. Create a PRD**

```markdown
# Product: AI-Powered Todo App

## Overview
Build a todo app with AI-powered task suggestions and deadline predictions.

## Features
- User authentication (email/password)
- Create, read, update, delete todos
- AI suggests next tasks based on patterns
- Smart deadline predictions
- Mobile-responsive design

## Tech Stack
- Next.js 14 with TypeScript
- PostgreSQL database
- OpenAI API for suggestions
- Deploy to Vercel
```

Save as `my-prd.md`.

### **3. Run Loki Mode**

```bash
# Autonomous mode (recommended)
./autonomy/run.sh ./my-prd.md

# Or manual mode
claude --dangerously-skip-permissions
> Loki Mode with PRD at ./my-prd.md
```

### **4. Monitor Progress**

Open the dashboard in your browser (auto-opens) or check status:

```bash
watch -n 2 cat .loki/STATUS.txt
```

### **5. Walk Away**

Seriously. Go get coffee. It'll be deployed when you get back.

**That's it.** No configuration. No manual steps. No intervention.

---

## Agent Swarms (37 Types)

Loki Mode has **37 predefined agent types** organized into **6 specialized swarms**. The orchestrator spawns only what you need—simple projects use 5-10 agents, complex startups spawn 100+.

<img width="5309" height="979" alt="Agent Swarms Visualization" src="https://github.com/user-attachments/assets/7d18635d-a606-401f-8d9f-430e6e4ee689" />

### **Engineering (8 types)**
`eng-frontend` `eng-backend` `eng-database` `eng-mobile` `eng-api` `eng-qa` `eng-perf` `eng-infra`

### **Operations (8 types)**
`ops-devops` `ops-sre` `ops-security` `ops-monitor` `ops-incident` `ops-release` `ops-cost` `ops-compliance`

### **Business (8 types)**
`biz-marketing` `biz-sales` `biz-finance` `biz-legal` `biz-support` `biz-hr` `biz-investor` `biz-partnerships`

### **Data (3 types)**
`data-ml` `data-eng` `data-analytics`

### **Product (3 types)**
`prod-pm` `prod-design` `prod-techwriter`

### **Growth (4 types)**
`growth-hacker` `growth-community` `growth-success` `growth-lifecycle`

### **Review (3 types)**
`review-code` `review-business` `review-security`

See [references/agents.md](references/agents.md) for complete agent type definitions.

---

## How It Works

### **Phase Execution**

| Phase | Description |
|-------|-------------|
| **0. Bootstrap** | Create `.loki/` directory structure, initialize state |
| **1. Discovery** | Parse PRD, competitive research via web search |
| **2. Architecture** | Tech stack selection with self-reflection |
| **3. Infrastructure** | Provision cloud, CI/CD, monitoring |
| **4. Development** | Implement with TDD, parallel code review |
| **5. QA** | 14 quality gates, security audit, load testing |
| **6. Deployment** | Blue-green deploy, auto-rollback on errors |
| **7. Business** | Marketing, sales, legal, support setup |
| **8. Growth** | Continuous optimization, A/B testing, feedback loops |

### **Parallel Code Review**

Every code change goes through **3 specialized reviewers simultaneously**:

```
IMPLEMENT → REVIEW (parallel) → AGGREGATE → FIX → RE-REVIEW → COMPLETE
                │
                ├─ code-reviewer (Opus) - Code quality, patterns, best practices
                ├─ business-logic-reviewer (Opus) - Requirements, edge cases, UX
                └─ security-reviewer (Opus) - Vulnerabilities, OWASP Top 10
```

**Severity-based issue handling:**
- **Critical/High/Medium**: Block. Fix immediately. Re-review.
- **Low**: Add `// TODO(review): ...` comment, continue.
- **Cosmetic**: Add `// FIXME(nitpick): ...` comment, continue.

### **Directory Structure**

```
.loki/
├── state/          # Orchestrator and agent states
├── queue/          # Task queue (pending, in-progress, completed, dead-letter)
├── memory/         # Episodic, semantic, and procedural memory
├── metrics/        # Efficiency tracking and reward signals
├── messages/       # Inter-agent communication
├── logs/           # Audit logs
├── config/         # Configuration files
├── prompts/        # Agent role prompts
├── artifacts/      # Releases, reports, backups
├── dashboard/      # Real-time monitoring dashboard
└── scripts/        # Helper scripts
```

---

## Example PRDs

Test Loki Mode with these pre-built PRDs in the `examples/` directory:

| PRD | Complexity | Est. Time | Description |
|-----|------------|-----------|-------------|
| `simple-todo-app.md` | Low | ~10 min | Basic todo app - tests core functionality |
| `api-only.md` | Low | ~10 min | REST API only - tests backend agents |
| `static-landing-page.md` | Low | ~5 min | HTML/CSS only - tests frontend/marketing |
| `full-stack-demo.md` | Medium | ~30-60 min | Complete bookmark manager - full test |

```bash
# Example: Run with simple todo app
./autonomy/run.sh examples/simple-todo-app.md
```

---

## Configuration

### **Autonomy Settings**

Customize the autonomous runner with environment variables:

```bash
LOKI_MAX_RETRIES=100 \
LOKI_BASE_WAIT=120 \
LOKI_MAX_WAIT=7200 \
./autonomy/run.sh ./docs/requirements.md
```

| Variable | Default | Description |
|----------|---------|-------------|
| `LOKI_MAX_RETRIES` | 50 | Maximum retry attempts before giving up |
| `LOKI_BASE_WAIT` | 60 | Base wait time in seconds |
| `LOKI_MAX_WAIT` | 3600 | Maximum wait time (1 hour) |
| `LOKI_SKIP_PREREQS` | false | Skip prerequisite checks |

### **Circuit Breakers**

```yaml
# .loki/config/circuit-breakers.yaml
defaults:
  failureThreshold: 5
  cooldownSeconds: 300
```

### **External Alerting**

```yaml
# .loki/config/alerting.yaml
channels:
  slack:
    webhook_url: "${SLACK_WEBHOOK_URL}"
    severity: [critical, high]
  pagerduty:
    integration_key: "${PAGERDUTY_KEY}"
    severity: [critical]
```

---

## Requirements

- **Claude Code** with `--dangerously-skip-permissions` flag
- **Internet access** for competitive research and deployment
- **Cloud provider credentials** (for deployment phase)
- **Python 3** (for test suite)

**Optional but recommended:**
- Git (for version control and checkpoints)
- Node.js/npm (for dashboard and web projects)
- Docker (for containerized deployments)

---

## Integrations

### **Vibe Kanban (Visual Dashboard)**

Integrate with [Vibe Kanban](https://github.com/BloopAI/vibe-kanban) for a visual kanban board:

```bash
# Install Vibe Kanban
npx vibe-kanban

# Export Loki tasks to Vibe Kanban
./scripts/export-to-vibe-kanban.sh
```

**Benefits:**
- Visual progress tracking of all active agents
- Manual intervention/prioritization when needed
- Code review with visual diffs
- Multi-project dashboard

See [integrations/vibe-kanban.md](integrations/vibe-kanban.md) for full setup guide.

---

## Testing

Run the comprehensive test suite:

```bash
# Run all tests
./tests/run-all-tests.sh

# Or run individual test suites
./tests/test-bootstrap.sh        # Directory structure, state init
./tests/test-task-queue.sh       # Queue operations, priorities
./tests/test-circuit-breaker.sh  # Failure handling, recovery
./tests/test-agent-timeout.sh    # Timeout, stuck process handling
./tests/test-state-recovery.sh   # Checkpoints, recovery
```

---

## Contributing

Contributions welcome! Please:
1. Read [SKILL.md](SKILL.md) to understand the architecture
2. Check [references/agents.md](references/agents.md) for agent definitions
3. Open an issue for bugs or feature requests
4. Submit PRs with clear descriptions and tests

---

## License

MIT License - see [LICENSE](LICENSE) for details.

---

## Acknowledgments

Loki Mode incorporates research and patterns from leading AI labs and practitioners:

### Research Foundation

| Source | Key Contribution |
|--------|------------------|
| [Anthropic: Building Effective Agents](https://www.anthropic.com/research/building-effective-agents) | Evaluator-optimizer pattern, parallelization |
| [Anthropic: Constitutional AI](https://www.anthropic.com/research/constitutional-ai-harmlessness-from-ai-feedback) | Self-critique against principles |
| [DeepMind: Scalable Oversight via Debate](https://deepmind.google/research/publications/34920/) | Debate-based verification |
| [DeepMind: SIMA 2](https://deepmind.google/blog/sima-2-an-agent-that-plays-reasons-and-learns-with-you-in-virtual-3d-worlds/) | Self-improvement loop |
| [OpenAI: Agents SDK](https://openai.github.io/openai-agents-python/) | Guardrails, tripwires, tracing |
| [NVIDIA ToolOrchestra](https://github.com/NVlabs/ToolOrchestra) | Efficiency metrics, reward signals |
| [CONSENSAGENT (ACL 2025)](https://aclanthology.org/2025.findings-acl.1141/) | Anti-sycophancy, blind review |
| [GoalAct](https://arxiv.org/abs/2504.16563) | Hierarchical planning |

### Practitioner Insights

- **Boris Cherny** (Claude Code creator) - Self-verification loop, extended thinking
- **Simon Willison** - Sub-agents for context isolation, skills system
- **Hacker News Community** - [Production patterns](https://news.ycombinator.com/item?id=44623207) from real deployments

### Inspirations

- [LerianStudio/ring](https://github.com/LerianStudio/ring) - Subagent-driven-development pattern
- [Awesome Agentic Patterns](https://github.com/nibzard/awesome-agentic-patterns) - 105+ production patterns

**[Full Acknowledgements](ACKNOWLEDGEMENTS.md)** - Complete list of 50+ research papers, articles, and resources

Built for the [Claude Code](https://claude.ai) ecosystem, powered by Anthropic's Claude models (Sonnet, Haiku, Opus).

---

**Ready to build a startup while you sleep?**

```bash
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
./autonomy/run.sh your-prd.md
```

---

**Keywords:** claude-code, claude-skills, ai-agents, autonomous-development, multi-agent-system, sdlc-automation, startup-automation, devops, mlops, deployment-automation, self-healing, perpetual-improvement
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall