$ show asklokesh/loki-mode
Loki Mode is an autonomous AI coding agent platform that transforms tasks, issues, or PRDs into verified pull requests with signed receipts. It operates as a multi-provider orchestration engine (Claude Code, Codex, Aider, etc.) with a staged pipeline: intake, plan, wall (acceptance tests), implement, verify, fix, seal, and PR. The system produces Ed25519-signed evidence receipts that can be independently verified, ensuring honest outcomes. It includes a control plane (Bun/Hono + SQLite) for run persistence and a web dashboard, plus extensive integrations (Slack, Jira, Linear, GitHub, GitLab). The architecture is polyglot: a bash CLI (autonomy/loki) and a TypeScript/Bun rewrite (loki-ts) run in parallel with parity enforcement, plus Python services for memory, learning, and the dashboard. Key entry points are the `loki` CLI, the control plane server on port 47821, and the FastAPI dashboard. External dependencies include git, Claude Code CLI, various LLM providers, and optional services like OpenTelemetry and Helm for deployment.
The LLM identified 4 files worth highlighting for reuse:
Implements an idempotency outbox for side effects (e.g., git pushes, PR creation). Records pending/done states, probes and adopts on replay after crashes, and quarantines corrupt entries. Self-contained and extractable for any system needing at-least-once semantics with crash recovery.
The sole allowed git spawn mechanism in the codebase, enforced by source-scan guards with no allowlist. Provides a safe, env-sanitized interface for git operations, preventing token leaks and command injection. Demonstrates a reusable pattern for wrapping dangerous subprocess calls with strict security policies.
Generates signed proof receipts (Ed25519) for agent runs, including event log hashes, verdicts, and cost data. Produces a JSON receipt that can be independently verified offline. The pattern of generating verifiable, tamper-evident receipts is reusable for any system requiring audit trails or attestation.
Implements a static registry pattern for quality gates with lifecycle phases (pre-commit, etc.). Gates are registered, executed, and listed via a simple in-memory map. Demonstrates a clean, extensible plugin architecture that can be extracted for any system needing pluggable validation steps.