
Loki Mode
io.github.asklokesh由 GitHub 帳號 asklokesh 發布v10.9.1更新於 Oct 31, 2026
Autonomous spec-to-product coding-agent CLI with an MCP server exposing 39 tools over stdio.
概覽
透過 stdio 暴露 Loki Mode 自主編碼代理,讓助理啟動執行、查看狀態並驗證簽章回執。
- 可以做什麼
- 依任務、PRD 檔案或 issue 參照啟動自主編碼執行,可選擇不建立拉取請求
- 查看最近一次或指定執行的狀態,讀取結果、費用與耗時
- 驗證執行的簽章回執:重新計算雜湊、檢查簽章並與事件日誌比對
- 回覆被阻塞的執行,使其在同一執行 ID 下繼續
- 檢視路由與設定,例如某個指令會使用哪個引擎、提供者與模型
- 適用情境
- 適合想把編碼任務或 issue 交給自主代理實作、驗證並產生可核查回執,並在事後確認結果確實通過驗證、而非只是被聲稱完成的情境。
- 執行需求
- 透過 npx 以本機 stdio 程序執行(npm 套件 loki-mode),需要 Node.js 20+,首次下載需要網路。需要 Git 2.x 與 curl,Bun 已隨套件提供。必須設定模型提供者:預設需安裝並登入 Claude Code,或提供 ANTHROPIC_API_KEY;可選用 opencode 搭配 OPENROUTER_API_KEY 或本機模型路由。僅支援 macOS 與 Linux。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Loki Mode,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Loki Mode
Your agent says done. Loki proves it: an autonomous coding agent that turns a task or issue into a verified pull request with a signed receipt you can check yourself.
[npm version] [npm downloads] [Docker Pulls] [License]
Website | Quickstart | Install guide | User guide | CLI reference | Compare with opencode | Changelog
The npm badge above tracks the current release; see CHANGELOG.md for release notes.
CLI reference: docs/CLI-REFERENCE.md (generated from the command registry).
Install
The npm package installs the Bun runtime the engine needs as an optional dependency. Other ways in: bun install -g loki-mode, brew tap asklokesh/tap && brew install loki-mode, or docker pull asklokesh/loki-mode:latest (Docker guide). Upgrade with loki self-update.
Want to see a result before you install or spend anything?
npx downloads the package the first time, so that step needs the network. The receipt itself replays offline and checks with no provider and no key.
First run
Loki needs a model. Claude Code (claude) is the default provider: install it and log in. The bundled Agent SDK with an ANTHROPIC_API_KEY can stand in for the CLI on the main path. Other coding CLIs are optional. See Requirements.
loki start, loki "<task>", loki owner/repo#N and loki quick "<task>" all run on the Loki 10 engine by default, whatever the flag order or input form. Add --no-pr to build and verify without opening a pull request, --max-cost <usd> to cap spend, and --provider <name> to pick another coding CLI. The spend cap defaults to $100 when ANTHROPIC_API_KEY or OPENAI_API_KEY is set and to no dollar cap on a subscription login; budgets.per_run in loki.yaml also sets it. Inspect the route without running: loki route start prd.md or --explain-route. New here? The 5-minute quickstart walks through it.
What you get
Every run starts from a delivery contract derived from your task, writes checks from the task alone before touching code, implements, verifies, and ends in exactly one outcome: VERIFIED, ALREADY_SATISFIED, FAILED, BUDGET_STOP, BLOCKED or STALLED (exit codes). If the contract cannot be satisfied as written, the run stops and asks one question instead of guessing.
- A pull request written for a quick review: what the issue asked, what changed, how it was tested, and what was NOT PROVEN. A VERIFIED run opens a ready PR; a PARTIAL run opens a draft PR titled
[PARTIAL]that leads with what is not proven; any other outcome keeps the branch local and prints where it is. - A signed receipt at
.loki/runs/<run-id>/receipt.json, signed with a local Ed25519 key created on first run. - A specialist review when the review council runs: it selects reviewers from a specialist pool (
agents/types.json, scored byrun.sh:FOCUS_KEYWORDS) by matching the changed files and diff against each reviewer's keywords.
loki verify re-hashes the receipt, checks its signature and checks it against the run's event log. It prints a verdict and exits 0 (VERIFIED), 1 (TAMPERED), 2 (UNCHECKED), 3 (UNSIGNED, refused unless --allow-unsigned), 4 (run outcome not verified) or 66 (no runs); [ $rc -eq 0 ] is the only safe test for "verified". It also checks that your checkout still matches the sealed code: a run that opened a PR returns you to your starting branch, so verify it from the run's branch (git fetch origin loki/<run-id> && git checkout --detach FETCH_HEAD), or it reads UNCHECKED and says so. loki start also requires fail-to-pass for a declared behavior change: a Wall test must fail on the old code and pass after, or the verdict stays PARTIAL (LOKI_MUTATION_STRICT=0 opts out). Full table: docs/exit-codes.md. On another machine, export the public key with loki keys export and pass it with loki verify --pubkey <file>. A receipt claims only what its checks ran, and lists what they did not; signing proves who produced it, not that the code is bug-free. Details: docs/SIGNED-RECEIPTS.md.
For a multi-repo change set, loki start --workspace <name> "<brief>" seals one signed composite.json over every child receipt, and loki verify <run-dir>/composite.json re-checks it offline (docs/WORKSPACES.md). A composite never reads higher than its weakest child.
Two vocabularies, not one. Receipt verdicts (sealed, 5): VERIFIED, PARTIAL, ALREADY_SATISFIED, SPEC_CONFLICT, FAILED. Run outcomes (printed, 8): VERIFIED, ALREADY_SATISFIED, PARTIAL, FAILED, BUDGET_STOP, BLOCKED, STALLED, CANCELLED. BUDGET_STOP, BLOCKED, STALLED and CANCELLED are run outcomes, never receipt verdicts.
Composite: every child VERIFIED or ALREADY_SATISFIED gives VERIFIED (all ALREADY_SATISFIED stays ALREADY_SATISFIED, any SPEC_CONFLICT child keeps SPEC_CONFLICT); one PARTIAL child caps it at PARTIAL; a FAILED child fails it. loki verify on a composite exits 0 VERIFIED, 1 TAMPERED, 2 UNCHECKED, 3 UNSIGNED.
Autonomy and deploy: .loki/policies.json autonomy: propose|execute|operate governs what loki start may do (propose opens nothing, execute opens a PR, operate also allows deploy); no file keeps today's behavior. loki trust prints advisory graduation advice from your receipts and never writes the policy. Loki deploys only behind loki deploy --execute (or loki start --deploy) plus a VERIFIED, HEAD-anchored receipt and the policy permission; --health-url and --auto-rollback add a post-deploy probe and a documented provider rollback. A Sentry alert webhook can enqueue a receipt-gated fix PR (docs/sentry-intake.md).
A finished run prints a short summary (every run on both engines also ends with a unified Result, Files, Cost, Elapsed, Receipt and next: block; --quiet prints only that block, --json adds a summary object):
Core commands
Core verbs: docs/CLI-CORE-VERBS.md. Every command (generated): docs/CLI-REFERENCE.md. Engine guide, provider table, model routes, custom agents and chat: docs/v10/GUIDE.md. Honest comparison with opencode: docs/COMPARE-OPENCODE.md.
Models, providers and local models
Two providers are supported. Claude Code is the default Tier-1 provider (the claude CLI, or, with only ANTHROPIC_API_KEY, the Anthropic Agent SDK). --provider opencode (or LOKI_PROVIDER=opencode) runs opencode, which reaches any model, including OpenRouter: export OPENROUTER_API_KEY and pass --model openrouter/<vendor>/<model>; the Loki 10 engine enforces the wall-clock limit and a post-iteration guard scan there. codex, cline, aider and gemini were removed and exit 2 with a one-line migration message. To keep the Claude harness on OpenRouter or a local model, set LOKI_MODEL_ROUTE=<kind>/<id> (kinds: openrouter, ollama, lmstudio, llamacpp, vllm, custom) before loki start; loki models --local finds local runtimes and prints ready-to-paste values.
Control Plane
A local UI and API for all your runs: outcomes, receipts, costs, and an answer box for BLOCKED runs. It is on by default (LOKI_CONTROL=0 turns it off) and listens on 127.0.0.1 only.
While it is running, runs on this machine ship to it automatically. Guides: container, Helm and ECS, migrating from the old dashboard.
Requirements
loki doctor enforces this list.
Required:
- Claude Code (
claude), installed and logged in: the default provider and the only one with every feature. Or onlyANTHROPIC_API_KEY:loki "<goal>"then runs on the bundled Agent SDK with no CLI and no extra setting, butloki editandloki chatcall theclaudeCLI. - Node.js 20+ (
node; 22 LTS is the CI target) - Git 2.x (
git) curl
Optional:
- Python 3.8+ (
python3): deep scans, Python repos and group runs use it.loki "<goal>"runs without it. jq:loki statusand the bash fallback CLI use it.- opencode (
--provider opencode) for any model, including OpenRouter. Ollama or an OpenRouter key for model routes. - Bun 1.3+ (
bun) on your PATH (the npm package also bundles it). - Docker, to run Loki from the published image.
macOS and Linux are supported.
More
- Installation, environment variables, exit codes, known issues, privacy and telemetry
- Agent Change Receipt format: docs/AGENT-CHANGE-RECEIPT.md
- Issue to PR from GitHub Actions, no hosted service: docs/examples/loki-issue-to-pr.yml.example
- Jira and Linear intake: docs/trackers.md. Two-way Slack: docs/slack.md. Multi-repo runs and composite receipts: docs/WORKSPACES.md. Deploy: docs/DEPLOY-PLAN.md
- MCP: the bundled server exposes 48 tools over stdio (
loki mcp), including starting a run, reading its status and verifying its receipt. One-click install: Cursor, VS Code. Or runloki mcp install --client claude|cursor|vscode|windsurf. - Claude Code plugin:
claude plugin marketplace add asklokesh/loki-mode, thenclaude plugin install loki-mode@loki-mode. The same marketplace ships loki-seal, a Stop hook that refuses "done" when tests newly fail or were weakened. - Architecture: docs/ARCHITECTURE.md. Upgrading: UPGRADING.md
Contributing
See CONTRIBUTING.md, TESTING.md and the Code of Conduct.
License
Business Source License 1.1. Free for personal, internal, academic and non-commercial use; it converts to Apache 2.0 on March 19, 2030. Contact [email protected] for other arrangements.
Loki Mode is built by Autonomi.
來源:README.md,提交 d05e200
工具
0版本歷史
2- v10.9.1最新Oct 3, 2026
- v9.50.1Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。