Loki Mode - OpenClaw Skill
When to use
- User asks to "build", "implement", or "develop" a feature from a PRD
- User provides a requirements document and wants autonomous execution
- User says "loki mode" or references autonomous development
- User wants to run a full SDLC cycle on a codebase
Prerequisites
loki CLI installed on the host (via npm install -g loki-mode or Homebrew)
- One of: Claude Code, Codex CLI, or Gemini CLI installed
- Corresponding API key set (ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY)
How to invoke
Start a session
Use the bash tool with background mode:
bash(command: "loki start <prd-path> --bg --yes --no-dashboard", pty: true, background: true, workdir: "<project-dir>")
Key flags:
--bg: Background mode (session outlives the tool call)
--yes: Skip confirmation prompts
--no-dashboard: Avoid port conflicts in sandboxed environments
--provider <claude|codex|gemini>: Select AI provider (default: claude)
--budget <amount>: Set cost limit in USD (auto-pause when exceeded)
Monitor progress
Poll status every 30 seconds:
bash(command: "loki status --json", workdir: "<project-dir>")
The JSON output contains:
version: Loki Mode version string
status: inactive, running, paused, stopped, completed, unknown
phase: Current SDLC phase (e.g., BOOTSTRAP, DISCOVERY, ARCHITECTURE, DEVELOPMENT, QA, DEPLOYMENT)
iteration: Current iteration number
provider: Which AI provider is active (claude, codex, gemini)
pid: Process ID of the running session (null if not running)
elapsed_time: Seconds since session start
dashboard_url: URL of the web dashboard (null if disabled)
task_counts: Object with total, completed, failed, pending counts
For budget tracking (not in JSON output), read the budget file directly:
bash(command: "cat .loki/metrics/budget.json 2>/dev/null || echo '{}'", workdir: "<project-dir>")
Budget JSON fields: budget_limit, budget_used
Report progress to channel
After each poll, summarize changes:
- Phase transitions ("Moved from ARCHITECTURE to DEVELOPMENT")
- Task completion counts ("12/20 tasks complete, 0 failed")
- Elapsed time ("Running for 45 minutes")
- Error states that need attention (failed tasks > 0, status is unknown)
If budget tracking is active, include cost in updates:
- "Estimated cost: $4.50 / $50.00 budget"
Control commands
- Pause:
bash(command: "loki pause", workdir: "<project-dir>")
- Resume:
bash(command: "loki resume", workdir: "<project-dir>")
- Stop:
bash(command: "loki stop", workdir: "<project-dir>")
- Status:
bash(command: "loki status", workdir: "<project-dir>")
- Logs:
bash(command: "loki logs --tail 50", workdir: "<project-dir>")
Session complete
When status becomes "stopped" or "completed":
- Run
loki status --json for final summary
- Run
git log --oneline -20 to show commits made
- Report final task counts, elapsed time, and duration
- If council verdict exists, include it:
cat .loki/council/report.md
Critical rules
- ALWAYS use --bg flag (session must outlive the tool call)
- ALWAYS use --yes flag (no confirmation prompts in non-interactive channels)
- NEVER run loki in the OpenClaw workspace directory itself
- Poll status rather than watching stdout (background mode detaches)
- If session crashes, check
loki logs before restarting
- Respect budget limits -- include cost in every progress update when tracking is active
- The --no-dashboard flag is recommended to avoid port conflicts in sandboxed environments
Source: asklokesh/loki-mode → integrations/openclaw/SKILL.md
1---2name: loki-mode-23description: Launch Loki Mode autonomous SDLC agent. Handles PRD-to-deployment with minimal human intervention. Invoke for multi-phase development tasks, bug fixing campaigns, or full product builds.4---5
6
7# Loki Mode - OpenClaw Skill
8
9## When to use
10- User asks to "build", "implement", or "develop" a feature from a PRD
11- User provides a requirements document and wants autonomous execution
12- User says "loki mode" or references autonomous development
13- User wants to run a full SDLC cycle on a codebase
14
15## Prerequisites
16- `loki` CLI installed on the host (via `npm install -g loki-mode` or Homebrew)
17- One of: Claude Code, Codex CLI, or Gemini CLI installed
18- Corresponding API key set (ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY)
19
20## How to invoke
21
22### Start a session
23Use the bash tool with background mode:
24```
25bash(command: "loki start <prd-path> --bg --yes --no-dashboard", pty: true, background: true, workdir: "<project-dir>")
26```
27
28Key flags:
29- `--bg`: Background mode (session outlives the tool call)
30- `--yes`: Skip confirmation prompts
31- `--no-dashboard`: Avoid port conflicts in sandboxed environments
32- `--provider <claude|codex|gemini>`: Select AI provider (default: claude)
33- `--budget <amount>`: Set cost limit in USD (auto-pause when exceeded)
34
35### Monitor progress
36Poll status every 30 seconds:
37```
38bash(command: "loki status --json", workdir: "<project-dir>")
39```
40
41The JSON output contains:
42- `version`: Loki Mode version string
43- `status`: inactive, running, paused, stopped, completed, unknown
44- `phase`: Current SDLC phase (e.g., BOOTSTRAP, DISCOVERY, ARCHITECTURE, DEVELOPMENT, QA, DEPLOYMENT)
45- `iteration`: Current iteration number
46- `provider`: Which AI provider is active (claude, codex, gemini)
47- `pid`: Process ID of the running session (null if not running)
48- `elapsed_time`: Seconds since session start
49- `dashboard_url`: URL of the web dashboard (null if disabled)
50- `task_counts`: Object with `total`, `completed`, `failed`, `pending` counts
51
52For budget tracking (not in JSON output), read the budget file directly:
53```
54bash(command: "cat .loki/metrics/budget.json 2>/dev/null || echo '{}'", workdir: "<project-dir>")
55```
56Budget JSON fields: `budget_limit`, `budget_used`
57
58### Report progress to channel
59After each poll, summarize changes:
60- Phase transitions ("Moved from ARCHITECTURE to DEVELOPMENT")
61- Task completion counts ("12/20 tasks complete, 0 failed")
62- Elapsed time ("Running for 45 minutes")
63- Error states that need attention (failed tasks > 0, status is unknown)
64
65If budget tracking is active, include cost in updates:
66- "Estimated cost: $4.50 / $50.00 budget"
67
68### Control commands
69- Pause: `bash(command: "loki pause", workdir: "<project-dir>")`
70- Resume: `bash(command: "loki resume", workdir: "<project-dir>")`
71- Stop: `bash(command: "loki stop", workdir: "<project-dir>")`
72- Status: `bash(command: "loki status", workdir: "<project-dir>")`
73- Logs: `bash(command: "loki logs --tail 50", workdir: "<project-dir>")`
74
75### Session complete
76When status becomes "stopped" or "completed":
771. Run `loki status --json` for final summary
782. Run `git log --oneline -20` to show commits made
793. Report final task counts, elapsed time, and duration
804. If council verdict exists, include it: `cat .loki/council/report.md`
81
82## Critical rules
83- ALWAYS use --bg flag (session must outlive the tool call)
84- ALWAYS use --yes flag (no confirmation prompts in non-interactive channels)
85- NEVER run loki in the OpenClaw workspace directory itself
86- Poll status rather than watching stdout (background mode detaches)
87- If session crashes, check `loki logs` before restarting
88- Respect budget limits -- include cost in every progress update when tracking is active
89- The --no-dashboard flag is recommended to avoid port conflicts in sandboxed environments
90
91---
92
93**Source:** [`asklokesh/loki-mode`](https://github.com/asklokesh/loki-mode) → `integrations/openclaw/SKILL.md`