Skip to content
cosmixPublic

About

A Rust-based agent orchestrator enabling a swarm of Claude Code instances building software.

Topics

Resources

Contributing

Stars

66 stars

Watchers

4 watching

Forks

Repository files navigation

loom

Agentic engineering for the rest of us.
You design the system. Loom builds it, checks every piece, and learns from its mistakes.

Loop engineering is sold as the whole of software development: state a high-level goal, and an agent loops until finished software comes out. It does get there, by brute force, paying in tokens for every wrong turn and rediscovering what an engineer on the team already knew.

Loom is for engineers who would rather spend their own judgment than someone else's compute. You discuss, theorise, test, explore, and plan the system, and put your experience into that plan. Loom implements it with Claude Code (and optionally Codex) sessions running in parallel across isolated git worktrees. It checks every stage's work itself, then checks all of it together in a final integration-verify stage. Along the way it records its own mistakes and distils them into a knowledge base the next plan starts from. You can watch from a terminal dashboard or a browser, steer any session, or take the keyboard at any time.

A loom run in the web dashboard: the plan as a dependency graph, a stage's detail dialog, its live terminal with control taken over, the ledger, the settings, and a stage completing and freeing the stages that depend on it

A real run in loom status --web, sped up: watch a stage's session, take the keyboard, and see a finished stage merge and start the ones that depend on it.

Why Loom

  • Your expertise where it counts, tokens everywhere else — you do the thinking and put it into the plan. Loom executes it unattended and comes back to you only when a stage needs a person; you can monitor, steer, or take over whenever you like. (Human Expertise Where It Matters)
  • Plan in the browser — loom plan is a feature planner: a chat with a planning session writes a feature's vision, product spec, metaplan and plans, and every document opens as a summary you can follow down to its source and settle. (Feature Planner)
  • It learns your project — every session records what it got wrong and what it decided. Each plan ends by distilling that into a knowledge base in your repo, so every plan starts from what the earlier ones learned. (It Learns From Every Plan)
  • Parallel by default — stages form a dependency graph, everything independent runs at once in its own git worktree, and each stage merges back as it finishes. (Parallel execution and progressive merge)
  • Done means verified — loom runs each stage's acceptance criteria itself and inspects the tree for stubs, unwired code, and code nothing calls. The agent's own account of its work does not count. Once every stage has merged, an integration-verify stage reviews and tests the combined work as one system. (Verification Model)
  • Rules enforced by hooks — commit discipline, worktree boundaries, and subagent limits fire from shell hooks, so they hold whatever the model intends. (Deterministic guardrails)
  • Contained by default — sessions run in a filesystem and network sandbox and cannot write loom's own state, hooks, or config. (Sandbox Configuration)
  • Expensive models only where judgment is needed — the orchestrator plans and commits, one loom check is the gate; implementation goes to the cheapest subagent that can do the piece, Claude or Codex. (Model Allocation)
  • Survives crashes and context limits — all state is plain files. The daemon spots dead and hung sessions and retries them, and a handoff is written before a session runs out of context. (Crash recovery and liveness)
  • Watch it live, steer when you want — loom status --live is a dashboard in your terminal. loom status --web is the same run in a browser: the plan as a dependency graph, a ledger of every stage, and terminals you can watch read-only or take over. (Primary Commands, Web Dashboard)

Quick Start

1. Install

curl -fsSL https://raw.githubusercontent.com/cosmix/loom/main/install.sh | bash

You need git, the claude CLI, and jq, plus minisign for release downloads. Signed binaries cover Linux x86_64 and macOS Apple Silicon; every other platform builds from source — see Installation.

2. Write a plan

Plans are how loom knows what to build. You can write one in the browser, with the Feature Planner, or in Claude Code, with the /loom-plan-writer skill.

In the browser. Run loom plan in your project:

cd /path/to/project
loom plan

It opens the Feature Planner, where a chat with a planning session writes a feature's vision, product spec, metaplan and plans. You read each one as a summary that opens down to its source, settle the ones you agree with, then pressure-test a plan and start its run from the same page. The next section shows it in full.

In Claude Code. Open Claude Code in your target project and use the skill to create the plan:

cd /path/to/project
claude  # start Claude Code CLI

Inside the Claude Code session:

  1. Load the plan-writing skill by typing /loom-plan-writer (or just mention that you're writing a loom plan).
  2. Describe what you want to build and discuss with Claude, as you would in plan mode.
  3. When done, Claude will write the plan to doc/plans/PLAN-<name>.md.

However you wrote it, validate the plan file before you spend anything on it:

loom plan verify doc/plans/PLAN-<name>.md

Then read it yourself and check that it captured your intent in enough detail. For longer plans, loom pressure doc/plans/PLAN-<name>.md has two model families (Claude and Codex) review it adversarially and harden it. Without the codex CLI, run /pressure doc/plans/PLAN-<name>.md inside a Claude Code session for a Claude-only pressure test.

3. Run it

loom init doc/plans/PLAN-<name>.md
loom run
loom status --live
loom stop

loom init parses the plan, creates stage state, and installs the project hook wiring. loom run starts the daemon and orchestrator. (The Feature Planner's Run panel does both for you.) loom status --live follows the run in your terminal, and loom status --web puts it in a browser. Add --terminals to watch or take over the Claude Code sessions from the browser. --host <addr> binds the dashboard to an address other than 127.0.0.1; read Web Dashboard Remote Access first, since a non-loopback bind serves plain HTTP.

loom stop stops the daemon, and the orchestrator with it.

Next: the Feature Planner in detail. After it come the two ideas loom is built on, human expertise where it matters and learning from every plan, then How It Works and the Feature Tour, a map of everything below.

Feature Planner

loom plan [--port <PORT>] [--host <HOST>] [--no-open]

loom plan serves a local web app for planning a project. You talk to a Claude Code session in a chat panel, it writes the documents under doc/ in loom's conventions, and you read, question and settle them in the browser. It ends at a reviewed plan, a run, and the follow-up plans the run leaves behind. The files stay plain Markdown that any editor can change, and the app picks up the edits.

The feature planner from a new idea to plans: describing the work on the New work page, the planning session settling it as a feature, then the vision, product spec, metaplan and plans each created with a button; each document opens as a summary whose sentences open to the sentences they rest on and to the source passage, then fold closed; revising a document by attaching a sentence to the chat; and the settings dialog switching the theme from Ledger to Aubergine

One feature from the first description to plans: each document as a summary that opens down to its source and folds back, a revision made by attaching a sentence to the chat, and a theme change in Settings.

Starting it

Run loom plan in a git repository. It prints a URL with an access token and opens it in a browser, unless you pass --no-open, the session is over SSH, or Linux has no display. It binds 127.0.0.1 starting at port 7272 and takes the next free port if that one is busy; --port binds exactly that port, and --host accepts the same values as the dashboard's. One planning server runs per project, and no loom init is needed. The app needs tmux, Claude Code and its login, and on Linux the sandbox prerequisites; without them it starts read-only and says what is missing. Details: Plan Commands.

The home page lists the project's features, each with its progress and what needs you. /new is the kickoff: describe the work, and the session settles whether it is a feature or a standalone plan before it writes anything.

One feature, four documents

A feature lives at /f/<feature>. A spine on the left lists its documents in workflow order and is the only place its progress is drawn:

  1. Vision: what the product is, and which sections its spec needs.
  2. Product spec: one numbered section per topic, under doc/product/<feature>/. A Coverage ledger shows which spec headings the metaplan, plans and stages cover.
  3. Metaplan: one entry per loom plan, in doc/plans/<feature>/index.md.
  4. Plans: the loom plans, plus a Findings ledger for what runs leave open.

Each document opens as a summary, with its source one click away. In a summary, opening a sentence replaces it with the sentences it rests on, and opening one of those shows the source passage; folding closes it again. Nobody has to read every document to form a view, and every claim traces to its text. Summaries are generated, kept in doc/loom/summaries/, and rebuilt when their sources change.

You mark a document settled when you agree with it. The mark is a Settled: line in the file. The spine flags a settled document that was revised, or whose vision row, metaplan entry or upstream section changed since.

The chat

The chat panel is the conversation with a planning session. Loom starts the session in tmux under your Claude Code login, and loom-plan:* skills from plan-plugin/ (vision, section, metaplan, plan, refine, review) give it loom's conventions for the step at hand. Offers on empty pages and the New chat control start one. The panel knows which document you are viewing, attaches a passage or a summary sentence to your next message, shows permission prompts as cards, and lists the files each turn changed with a diff and a Restore. An idle chat shows the background tasks it waits on, and / opens a list of the session's skills and commands with the terminal-only ones disabled and the reason shown. One browser holds the authoring seat at a time; other viewers read.

From plan to run to follow-ups

  1. Pressure test. A written plan's page offers a pressure test, the loom pressure rounds with two model families. Their dated record is appended to the plan's ## Pressure tests section, and the spine shows which plans have one.
  2. Run. The metaplan page, the Plans home, has a Run panel. Start a run does loom init and loom run for the plan (only loom run to resume a stopped one), and Open dashboard links to the Web Dashboard.
  3. Review. When plans have run, loom writes doc/plans/REVIEW-<plan id>.md: spec conformance, open questions and open findings. The review is never edited. "Review the feature" starts a session with loom-plan:review, which records what it finds in the feature's findings ledger, doc/plans/<feature>/findings.md.
  4. Follow-ups. The Findings page groups the ledger by run review. Plan this and Fold into entry send a finding to a session that adds an entry under ## Follow-ups in the metaplan, from which the next plan is written; Dismiss closes it with a reason. A finished feature offers "Plan follow-ups" for the same purpose.

File mode

/files/* browses everything under doc/: product spec, metaplan, plans, briefs, run reviews and the knowledge base. It renders Markdown, searches, diffs against HEAD or a chat turn, and edits plain documents in an editor that validates a plan before saving. Plans that are running or done, knowledge files and the summary store are read-only. A dot marks documents that changed since you last looked.

Planning sessions

Each planning session runs in its own tmux server named loom-plan-<id>, and tmux -L <socket> attach -r watches it read-only. Ctrl-C stops new sessions and waits for running ones to finish writing; a second Ctrl-C exits at once. If the server dies or restarts, messages a session had accepted but not yet confirmed are not replayed into it: they come back as one batch into the composer of the browser that held authoring, so you can read them and decide what to send again (attachments are not carried).

Human Expertise Where It Matters

Writing the plan, in the planner or in Claude Code, is your part of the work. This section is about why it comes first.

Loop engineering presents itself as the end of the story: give an agent a high-level goal, let it try, fail, read the error, and try again until the checks pass, and finished software comes out. It does produce software, at a high price and with little elegance. Every wrong turn is paid for in tokens, and much of what those tokens buy is the rediscovery of something an engineer on the team already knew. A frontier lab can afford that. Most organisations cannot.

Human engineers have a lot to offer: experience, judgment, and a working theory of the system that no loop recovers cheaply. Loom puts that first and spends tokens on the rest:

  • Up front, in the plan. In the Feature Planner or in Claude Code, you discuss the design, form theories and test them, explore the code, and decide what gets built, how it splits into stages, and what proves each stage is done. loom plan verify and loom pressure find the weak spots before anything is spent on execution. This is where an hour of your time saves the most tokens.
  • During the run, only when needed. A stage that needs a person says so: WaitingForInput when an agent asks a question, NeedsHumanReview when it is escalated, a criteria dispute when an agent believes a check is wrong. Everything else runs unattended.
  • Whenever you choose to look. The terminal dashboard (loom status --live) and the web dashboard (loom status --web) show every stage, what it is doing, which models it is running, and how much context it has used. You can open any session, from tmux with loom attach or from a terminal in the browser, and watch it or take the keyboard and steer it.

What you hand over comes back checked. Loom verifies every stage's work before it merges, then the plan's integration-verify stage reviews and tests everything together, so stages that each pass on their own still have to work as one system.

Steering is also teaching. Agents record a human correction as a memory entry before they do anything else, so what you tell one session is distilled into the knowledge base and reaches every later one.

Details: Human-in-the-loop where it matters, Web Dashboard, Terminal Sessions.

It Learns From Every Plan

Most agent setups start every session from zero. The same architecture is rediscovered, the same wrong turn is taken, and the same correction is given again. Loom keeps what each session learns and gives it to the next one.

  1. Every session keeps a journal. As they work, agents record mistakes with a prevention rule, decisions with their rationale, and whatever surprised them about the codebase (loom memory note, decision, change, question).
  2. Every plan ends by distilling it. The knowledge-distill stage reads every stage's journal and curates it into doc/loom/knowledge/: architecture, entry points, patterns, conventions, stack, concerns, and a mistakes file where each entry says what happened, why, how to prevent it, and how it was fixed.
  3. Every later session starts from it. A stage's signal carries a Knowledge Brief: the sections retrieval judged relevant to that stage, already quoted. Agents pull anything more with loom knowledge context --query, and look code up in a source graph (loom map) before they open files.
  4. Wrong knowledge gets corrected. When the code contradicts the knowledge base, the code wins. The agent records the contradiction and the next distillation applies it.

The knowledge base is plain markdown in your repository, so it is reviewed, versioned, and shared with your team like any other file. It is tiered, so it can keep growing while each session loads only the part it needs.

The effect compounds. The first plan on a project pays for discovery. After a few plans the knowledge base holds the project's structure, its conventions, and the mistakes already made on it, and later plans make far fewer of them: fewer failed verifications, fewer retries, fewer tokens.

Details: Knowledge System.

How It Works

flowchart LR
    A[Plan] --> B[loom init]
    B --> C[Stages run in parallel worktrees]
    C --> D[Loom verifies]
    D --> E[Merge]
    E --> I[Integration verify]
    I --> F[Distill knowledge]
    F -. read first by the next plan .-> A
Loading

A plan is a markdown file holding a list of stages, each with its dependencies and the commands that prove it is done.

  1. Init. loom init <plan-path> parses the plan and creates the state for every stage under .loom/work/.
  2. Schedule. loom run starts a daemon and an orchestrator. Every stage whose dependencies are met gets its own worktree (.worktrees/<stage-id>, branch loom/<stage-id>) and its own Claude Code session, briefed by a signal file: the assignment, the relevant knowledge, and the memory of earlier sessions.
  3. Work. The session's main agent decomposes the stage, delegates implementation to cheaper subagents, and records what it learns with loom memory.
  4. Verify. In a session, loom stage complete asks the daemon to run the stage's acceptance criteria and the goal-backward checks in a host job; the operator's shell runs them locally. A failure leaves the stage Executing, and the agent has to fix the work and try again.
  5. Merge. A verified stage merges back to the target branch, which frees the stages that depend on it. A real conflict gets a dedicated resolution session that works in the stage's own worktree; loom lands the merge without stashing or resetting your checkout's uncommitted work. A tracked change that overlaps the incoming change holds the merge until you commit or revert it. An untracked file in the way whose bytes equal the incoming file is moved into a quarantine directory (<git dir>/loom-displaced/<stage>-<timestamp>/) and deleted once the merge lands; a different file blocks the merge and is never deleted.
  6. Integrate. Once the implementation stages have merged, an integration-verify stage reviews the combined work and runs the full suite against it.
  7. Distill. The plan's final knowledge-distill stage curates every stage's memory into doc/loom/knowledge/, which the next plan's sessions read first.

You follow along with loom status --live or loom status --web, and step in only when a stage asks for a person: recover, verify, merge, or retry stages as needed with the stage commands.

Stage Lifecycle

WaitingForDeps → Queued → Executing → Completed

Everything else is an explicit, inspectable outcome rather than a hang:

State Meaning
Blocked A before_stage check or an explicit block stopped the stage
NeedsHandoff Context ceiling reached; a handoff was written
WaitingForInput The agent asked a question (raised automatically by the AskUser hooks)
MergeConflict Auto-merge hit a real conflict; a resolution session works on it in the stage's worktree
MergeBlocked Merge held by an operation in progress in your checkout, the target checked out elsewhere, or overlapping local changes (retried automatically); a quarantine directory left by a merge that could not put files back holds the stage until you move them back and delete it; other failures get a resolver
CompletedWithFailures Work finished but acceptance did not pass
NeedsHumanReview Escalated to a person
NeedsAdjudication A dispute is awaiting a verdict, or a verdict changed nothing and the daemon's completion job is running
Skipped Explicitly skipped

Feature Tour

Everything loom does, one line each, grouped by what you are doing at the time. Each line links to the section that documents it.

Plan

  • Draft a plan interactively with the /loom-plan-writer skill. (Write a plan)
  • Plan a feature in the browser with loom plan: vision, product spec, metaplan and plans, each written in a chat with a planning session. (Feature Planner)
  • Read any planning document as a summary that opens, sentence by sentence, down to the source passage it rests on, and settle the ones you agree with. (Feature Planner)
  • Trace spec headings to the plans and stages that cover them in a Coverage ledger. (Feature Planner)
  • Pressure-test a plan, start its run and open the dashboard from the planner's Run panel. (Feature Planner)
  • Turn a run review's open findings into follow-up plans through a Findings ledger. (Feature Planner)
  • Browse, search, diff and edit everything under doc/ in file mode. (Feature Planner)
  • Validate a plan with no side effects: schema, sandbox limits, and worker-ownership overlaps. (Plan Commands)
  • Harden a plan through adversarial review rounds from two model families. (Primary Commands)
  • Give each stage a type: knowledge, standard, integration-verify, or knowledge-distill, each with its own verification rules. (Stage Type Behavior)
  • Amend a stage's criteria mid-run through an audited path that snapshots the plan and logs the change. (Disputes, Adjudication, and Amendments)

Run

Verify

Learn

  • Journal notes, decisions, and mistakes to a per-stage memory as work happens. (Knowledge System)
  • Distill every stage's memory into permanent, tiered knowledge at the end of a plan. (Knowledge System)
  • Pull a token-budgeted, quoted context pack for one specific question on demand. (Knowledge System)
  • Query a source graph of the code's own symbols for outlines, impact, and callers. (Knowledge / Memory)

Observe

  • Follow the run in a live terminal dashboard, one row per stage with its state, models, activity, context use, and merge status. (Primary Commands)
  • Watch the same ledger and a dependency graph in the browser, with settings and remote access. (Web Dashboard)
  • Take control of a stage's live session from a browser terminal. (Web Dashboard Terminals)
  • See Claude and Codex quota bars with reset countdowns wherever the ledger renders. (Web Dashboard)
  • Report what a run actually spent per provider, and compare a policy change against paired runs. (Other Commands)
  • List and attach to any live session by stage or session ID. (Other Commands)

Contain

  • Confine each session's filesystem reads/writes and network domains by plan and per-stage rules. (Sandbox Configuration)
  • Rebuild a minimal, allowlisted environment for every command loom runs from your plan. (Command Confinement)
  • Deny a session write access to loom's own state, hooks, and config, relaying the rare legitimate exception through the daemon. (Session State Confinement)
  • Sign every stage and merge commit with your own git signing setup, although sessions cannot reach your keys. (Signed Commits)
  • Enforce commit discipline, worktree boundaries, and subagent limits from shell hooks. (Deterministic guardrails)
  • Run stages in auto permission mode by default and tighten it per plan or per stage; bypass-permissions is rejected. (Permission Mode)
  • Enable Claude Code remote control on spawned sessions automatically when its prerequisites are met. (Remote Control)

Operate

Spend

  • Run each stage's main agent at its stage type's configured model and effort. (Model Allocation)
  • Override the model or effort for one stage explicitly, without touching the rest of the plan. (Stage Fields)
  • Keep each signal's prefix byte-identical across sessions, so the large doctrine block is a cache hit. (Cost control by construction)
  • Inject at most 5 matched skills per stage out of 75 installed; 10 core skills are always loaded and the other 65 load on demand. (Cost control by construction)

Contents

What Loom Solves

Autonomous agent work fails in a small number of predictable ways. Loom answers each with a mechanism, not a paragraph of prompt.

Failure mode What actually happens Loom's answer
False completion Tests were never run, the module was written but never imported, the fix is a TODO Loom runs the acceptance criteria itself, then checks artifacts for stubs, wiring for real integration, and dead-code patterns for orphaned work. The bypass flags need a token the agent cannot read.
Instruction drift Rules decay the moment they scroll out of attention Shell hooks enforce the rules that matter deterministically — commit discipline, staging scope, worktree boundaries, subagent limits — outside the model's control.
Amnesia Every session rediscovers the same architecture and repeats the same mistakes A per-stage memory journal feeds a distillation stage that curates permanent, tiered knowledge; later sessions read it before touching code.
Cost scaling with tokens, not value Expensive models doing cheap work; re-reading everything, every time Judgment stays on an orchestrator; bulk implementation is delegated to cheap subagents. Signals are laid out for KV-cache reuse and knowledge is tiered, so agents load only what they need.
Context exhaustion The session degrades into an expensive compaction loop Context budgets are monitored per stage; a handoff is written before compaction and the resumed session is re-anchored to its assignment.
Lost runs A crashed or hung session takes the work with it All state is files under .loom/work/. The daemon detects dead and hung sessions, classifies the failure, and retries or escalates.
Serialization Multi-stage work runs one-at-a-time, or collides on the same files A dependency DAG schedules independent stages concurrently in separate worktrees, with progressive auto-merge and dedicated conflict-resolution sessions.

Key Capabilities

Deterministic guardrails

The rules that matter are not left to the model. Loom installs Claude Code hooks, a Codex-native hook subset, and a git pre-commit hook that fire regardless of what an agent intends:

  • commit-guard.sh warns when a session ends with uncommitted work or a stage still Executing; loom-relay-stop.sh blocks an unattended stop of an Executing stage session that has nothing pending (no live subagent, worker or host job), up to three times and once per tool call, and tells it to finish, dispute or block
  • git-add-guard.sh blocks git add -A / git add .; git-pre-commit-hook.sh blocks commits containing .loom/work or .worktrees
  • worktree-isolation.sh / worktree-file-guard.sh block cross-worktree writes, reads, and path traversal, and worktree-isolation.sh blocks an absolute path into the main checkout from a stage session (loom's own state, the stage's worktree and its scratch directory stay reachable)
  • commit-filter.sh blocks subagent git operations (a subagent commit loses the main agent's work) and blocks AI attribution in commit messages
  • subagent-verify-guard.sh blocks subagents from running project-wide build/test/lint suites, so implementers never verify — with integration-verify stages carved out, and no opt-out environment variable. It also blocks the main agent of a live standard stage from an unfiltered test suite (build, clippy, fmt and lint stay allowed for it), never an ordinary session
  • pre-compact.sh blocks compaction, writes a handoff, then allows it; session-start.sh re-anchors the resumed agent to its signal file
  • plans-path-guard.sh keeps plans in doc/plans/ where loom and git can see them

Subagent detection is a live process-tree ancestry check, not a PPID comparison. See Implementers Do Not Verify.

Verification that outlives the agent's opinion

loom stage complete is not a self-report. Loom executes the stage's acceptance criteria in a daemon host job and refuses completion on failure, leaving the stage Executing so the agent must fix and retry. On top of that, goal-backward verification asks whether the outcome exists:

  • artifacts — files exist and contain real implementation (stub detection rejects TODO, FIXME, unimplemented!, todo!, pass, NotImplementedError)
  • wiring — regex proof that new code is actually referenced: module registered, route mounted, component rendered
  • wiring_tests — runtime commands proving the integration behaves
  • dead_code_check — command output patterns catching code that exists but is never called
  • before_stage / after_stage — pre-spawn and post-acceptance gates; a failed pre-check blocks the stage before a session is even spawned

The escape hatches (--no-verify, --force-unsafe, --assume-merged) require a one-time proof bound to the project, stage, action, and exact flag set. The command derives it from the daemon token, which the operator can read and a sandboxed agent cannot; the proof cannot be reused for another action.

Knowledge capture and distillation

Loom treats what agents learn as a durable artifact with a pipeline behind it, rather than a scratch file.

  1. Capture — during execution, agents record to a per-stage journal: loom memory note (gotchas, mistakes-with-prevention), decision (with rationale), change, question. The journal is injected into the recitation section at the end of the next signal, where model attention is highest.
  2. Distill — a knowledge-distill stage runs at the end of a plan, reads every stage memory, and curates it into permanent knowledge — mistakes rewritten as actionable prevention rules, decisions with their rationale, reusable patterns and conventions.
  3. Retrieve — the result is a tiered base under doc/loom/knowledge/: a generated INDEX.md, seven tier-1 summaries, and tier-2 topic files. Inside a stage, the per-stage Knowledge Brief comes first. Otherwise, agents read INDEX.md for orientation, then the tier-1 summary for their area, then only the topics they touch; a specific question is pulled with loom knowledge context --query, which returns the matching sections quoted — so the base can grow without every session paying to load it.

Knowledge lives in doc/loom/knowledge/; agents write it through loom, and loom knowledge sync rebuilds the derived retrieval artifacts after the tree changes, including the one-time flat-to-hierarchical upgrade. Details: Knowledge System.

Cost control by construction

Loom's savings come from delegation, not downgrade:

  • Orchestration's model and effort come from the stage type's default — every stage's main agent plans, decomposes, fixes what the gate reports, and commits, the judgment-heavy work that is worst to economize on — and both are overridable, in [models] in either config file or per stage; see Model Allocation.
  • Delegation is a cost decision, tokens times model tier. A stage's main agent makes a change itself only when it is at most 20 lines in at most 2 files it has already read, needs no further exploration, and one command proves it; a Fable main session delegates even those. A stage main session that edits past that limit gets a one-time advisory from the PostToolUse hook; it warns and never blocks. Everything larger goes to the cheapest subagent that can do it, spawned by agent type so the choice is explicit rather than inherited: Haiku (effort high) for pieces that are extremely simple or have a highly detailed brief, and for Explore locate-only sweeps; Fable only for visual/UI design and extremely challenging algorithmic design (no agent type pins it — the model override is stated explicitly at spawn); Opus (effort medium; a failed attempt is respawned at effort: high with every attempt in the brief, and effort: xhigh is not a subagent setting) for architecture across modules, new algorithms, concurrency and distributed systems, security-sensitive code, and bugs of unknown cause — never for visual or CSS fixes, mainstream feature code, or fixes to review findings in code a cheaper tier wrote, which return to the tier that wrote the piece and escalate only on a failed fix; Sonnet for pieces that need open-ended exploration or the initial iteration on failing tests, or are too large to brief in that detail, and for any piece between Sonnet and Opus. Codex is a lane chosen per piece, never a default or first choice: Claude keeps open-ended exploration across modules, unknown-cause debugging, failing-test convergence, verification, review and planning, and Codex takes straightforward, well-specified implementation, including a bounded exploratory piece: one that explores an unfamiliar path inside the files it owns, using the navigation kit, with pinned interfaces, an equivalent sandbox and mechanical acceptance. GPT-6.1 Terra takes implementation, integration tests, boilerplate, scaffolding and simple unit tests; GPT-6.2 Sol takes a substantial well-specified unit (about 4 to 6 file-sized changes) or a Terra unit that failed once; GPT-6 Luna runs only when the user or the plan asks, all at effort xhigh. The codex tiers are licensed only on stages listing codex in implementers (the list order carries no routing meaning), and additionally require the codex CLI and its plugin to be installed — when either is missing, loom run prints an advisory warning at startup (it never aborts) and Terra- and Sol-tier work falls back to Sonnet while boilerplate and simple unit tests fall back to Haiku. A stage signal's ## Model Budget section shows each provider's fresh quota windows; when Claude is at 75% or more, straightforward pieces go to Codex where licensed and fully briefed pieces to Haiku, and when Codex is, they go to the matching Claude tier (loom usage --quota prints the same section).
  • The gate is one loom check. In a standard stage the orchestrator, at effort medium, formats the tree and runs loom check <stage-id> once while the final review round runs; the check prints a per-criterion summary and writes full logs to files. A fix round re-runs only the failed criteria with --criterion <n>. The orchestrator delegates the fixes and commits. An integration-verify stage keeps its own gate.
  • Signals are built for cache reuse. Each signal is a four-section layout with a per-stage-type stable prefix that is byte-identical across sessions, so the large doctrine block is a cache hit rather than a re-read.
  • The orchestrator's rulebook loads when it is needed. Delegation, briefs, file ownership, waiting on subagents and commit timing live in the loom-orchestration core skill, which a session loads before it fans out; the installed CLAUDE.md keeps the hard stops and a pointer, under a 20 KB ceiling. spawn-guard.sh prepends the subagent preamble to every typed spawn, so an orchestrator no longer pastes it.
  • Context budgets prevent compaction, which is the expensive failure: an uncached re-read that costs more and produces worse work.
  • Tiered knowledge and a skill index keep the working set small — at most 5 matched skills are injected per stage, out of 75 installed.
  • Waits are settled by receipts, never by polling. An orchestrator waits on a backgrounded Codex forward by its exact receipt (loom subagents wait --receipt <id>), and repeated loom subagents list polling is counted by the poll guard. A whole-file read that another agent of the session already requested is advised once, from the session's ledger of requested reads, which records an attempt and proves no delivery. An agent's first whole read of a large file is denied once with an outline (the read gate, switchable with [hooks] read_gate = false).
  • Consumption is measured, not assumed. loom usage reports Claude and Codex separately from provider-native telemetry, and loom usage --compare judges a candidate policy offline against paired runs. A token-proxy gain alone never counts as a subscription saving, and any quality regression, or a latency regression beyond a declared tolerance, rejects the candidate; see the evaluation contract.

Per-stage model, reasoning_effort, and ultracode fields let you override any of this explicitly.

Parallel execution and progressive merge

Stages form a dependency DAG; everything independent runs at once, each in its own worktree (.worktrees/<stage-id>, branch loom/<stage-id>). Completed stages merge back progressively under a file lock, and a real conflict spawns a dedicated resolution session in the stage's worktree rather than stalling the run. Loom never merges inside your checkout: it computes the merge off to the side and only fast-forwards the target branch, keeping your uncommitted changes unless they overlap what the merge touches.

Crash recovery and liveness

All orchestration state is plain files in .loom/work/, so nothing is lost when a process dies. The daemon polls every 5s, tracks PID liveness and per-session heartbeats, flags hung sessions after 300s and parks stalled stages for a person (see Startup Checks and Stalled Stages), and classifies failures across ten types into retryable (exponential backoff) and needs-diagnosis. Tool-call telemetry drives a stuck-session signal when a session's recent calls are overwhelmingly failures. Orphaned sessions are recovered on daemon restart.

A stage completes only when the daemon's host job verifies the committed tree and the daemon applies the result; a session's own report is never the evidence. A passing run from a session that is no longer running is rejected and a failing one ignored, so the successor session runs its own completion. Each session records why it exited — completed, crashed, context ceiling, stalled, operator stop, criteria blocked, or replaced — and loom status, loom status --live, and the web dashboard surface a completion-pending or blocked state with that reason ahead of generic activity.

Sandboxing and plan hardening

Plan-level defaults and per-stage overrides control filesystem reads/writes, network domains, and permission mode for the agent session, and commands loom runs from your plan get a rebuilt, allowlisted environment so they cannot read ambient credentials (Sandbox Configuration). Before you spend anything, loom plan verify validates a plan with no side effects — running the same sandbox validation that would otherwise only fail at loom init — and loom pressure hardens it through adversarial review rounds run by two different model families. A sandboxed session's own writes are confined the same way: it cannot touch loom's state, hooks, or config directly, and the handful of legitimate exceptions go through a one-shot request the daemon applies (Session State Confinement).

Human-in-the-loop where it matters

Thirteen stage states make "needs a person" an explicit outcome rather than a hang: WaitingForInput (raised automatically when an agent asks a question), NeedsHumanReview (including a v2 contract freeze refused four times), Blocked, MergeConflict. Operators get loom stage hold/release/skip/retry/human-review, and an agent that believes a criterion is wrong can escalate with loom stage dispute-criteria instead of quietly weakening it.

Installation

Loom is under active development. Signed binaries are published for Linux x86_64 and macOS Apple Silicon; every other platform builds from source with the Rust toolchain installed.

Prerequisites

Tool Needed for Required?
Rust toolchain (cargo) building the loom binary only when building from source
git worktrees, merges, crash reports yes, 2.40 or newer; loom run refuses older versions
claude (Claude Code CLI) every orchestrated session yes
jq every loom hook parses the Claude Code hook payload with it yes; install.sh and loom run refuse to proceed without it, loom repair reports it
minisign verifies downloaded release binaries before execution required for release downloads; install with brew install minisign or sudo apt install minisign
rg (ripgrep) and fd the installed CLAUDE.md steers agents to these over grep/find recommended; install.sh and loom run warn when missing
tmux every orchestrated session runs in a detached tmux server yes; loom run refuses to start without it, loom init <plan> warns
sccache shared dependency compiles across stage worktrees optional
codex CLI the codex implementer lane and loom pressure optional

Install script

curl -fsSL https://raw.githubusercontent.com/cosmix/loom/main/install.sh | bash

This downloads the signed release binary for your platform to ~/.local/bin/loom, then installs Loom's agents, skills, commands, hooks, and orchestration rules into ~/.claude/ and ~/.codex/ from the assets embedded in that binary. Codex asks you to review new or changed non-managed hooks with /hooks before they run.

The installer requires an independently installed minisign and verifies the release against its pinned public key before executing it. It validates the staged executable before atomically replacing loom, retaining the previous executable at ~/.local/bin/loom.previous for recovery.

Build from source

Required on Linux ARM64 and for development; run tests with /usr/bin/python3 scripts/run-rust-tests.py as described in the testing guide:

git clone https://github.com/cosmix/loom.git
cd loom
bash ./dev-install.sh

dev-install.sh builds an optimized development binary (cargo build --release) with LTO disabled, 16 codegen units, incremental compilation, and one Cargo job per available CPU. Set CARGO_BUILD_JOBS=4 bash ./dev-install.sh to limit concurrency. These settings apply only to this script; ordinary release builds retain fat LTO and one codegen unit. The first dev install rebuilds affected artifacts; subsequent builds reuse the incremental cache.

It then runs install.sh, which installs loom-* prefixed agents and skills (non-destructively, preserving user customizations), hooks, and configuration into ~/.claude/ and the CLI binary to ~/.local/bin/loom. Orchestration rules are written directly to ~/.claude/CLAUDE.md (existing file is backed up).

install.sh takes an optional --skills core|all flag (default core): core installs a small set of always-loaded core skills to ~/.claude/skills/ and catalogs the rest under ~/.claude/loom-skill-catalog/, loaded on demand; all installs every loom skill directly to ~/.claude/skills/.

Project hook wiring

loom init installs and configures project hook wiring automatically. For an existing repo that is missing Claude Code hook setup, run loom repair --fix.

Platform Support

  • Linux x86_64: primary development and full CI test runs; signed release binary
  • macOS (Apple Silicon): supported for build/terminal integration; native Codex workers run under a Seatbelt boundary when the host passes their qualification probes (see Native Codex workers); CI does build-only verification; signed release binary
  • macOS (Intel): builds from source; no release binary is published
  • Windows via WSL2: supported — WSL2 runs the Linux x86_64 binary unmodified. Install tmux inside WSL — see Running under WSL. Native Windows, outside WSL, is unsupported.
  • Linux ARM64: builds from source; no release binary is published yet
  • Headless (SSH, no terminal emulator): supported, since every session runs in a detached tmux server — see Terminal Sessions

What Gets Installed

Location Contents
~/.claude/agents/loom-*.md 6 specialized subagents (per-item, non-destructive)
~/.claude/skills/loom-*/ 10 core domain knowledge modules, always loaded (per-item, non-destructive)
~/.claude/loom-skill-catalog/loom-*/ 65 more domain knowledge modules, loaded on demand (--skills core, the default)
~/.claude/commands/*.md Loom slash commands (/pressure, /address, /distill)
~/.claude/hooks/loom/ Embedded lifecycle and guardrail hooks + shared libraries
~/.claude/CLAUDE.md Orchestration rules
~/.codex/skills/pressure/ Codex pressure-testing skill ($pressure)
~/.codex/hooks/loom/ Loom hook assets used by Codex-native registrations
~/.codex/hooks.json Non-destructively merged Codex hook registrations
~/.codex/AGENTS.md Codex navigation and execution doctrine
~/.local/bin/loom Loom CLI

CLI Reference

Primary Commands

loom init <plan-path> [--clean]
loom run [--manual] [--max-parallel N] [--foreground] [--watch] [--no-merge]
loom status [--live] [--compact] [--verbose] [--web [PORT] [--host HOST] [--terminals]]
loom stop
loom resume <stage-id>
loom check <stage-id> [--suggest] [--no-cache] [--criterion <n>]...   # without --criterion, a frozen standard stage also runs its contracts after the goal-backward checks
loom check <stage-id> --contracts [--replacement <frozen-file>=<path>]...   # Plan version 2: run the stage's contracts; with --replacement, trial an edited copy of a frozen file
loom check <stage-id> --criterion <n> --at-base   # run the criterion against the stage's base commit as a host job and record the result as base evidence (needs --criterion; not with --contracts)
loom pressure <plan-path> [--rounds N] [--claude-model M] [--claude-effort E] [--codex-model M] [--codex-effort E] [--address-model M] [--address-effort E] [--dry-run]

When loom run stops — every stage settled, or interrupted by loom stop — it prints stages by outcome: Completed; Failed (Blocked, MergeConflict, CompletedWithFailures, MergeBlocked, NeedsHumanReview — terminal, needing intervention); Unfinished (WaitingForDeps, Queued, Executing, WaitingForInput, NeedsAdjudication — still in progress when the run stopped); and Needs Handoff. The run succeeds only when Failed, Unfinished, and Needs Handoff are all empty.

loom pressure hardens a plan before you run it by combining two external agents over --rounds rounds (default 1, or pressure.rounds). Each round runs both pressure-tests in parallel: Claude /pressure edits the plan in place in the foreground (you watch it live), while Codex $pressure writes an independent review next to it (codex-<plan>.md) in the background (its output is captured to a temp log to keep the terminal clean). Once both finish, Claude /address folds the review back in. Claude stays interactive and auto-closes when done; Codex runs from the repo root. Requires both the claude and codex CLIs on PATH. --dry-run prints the exact commands without spawning anything.

Each of the three steps spawns with an independently selectable model and reasoning effort: --claude-model/--claude-effort for /pressure (model accepts haiku, sonnet, opus, or fable; effort accepts low, medium, high, xhigh, or max), --address-model/--address-effort for /address (same value sets), and --codex-model/--codex-effort for $pressure (model accepts gpt-6.2-astra, gpt-6.2-sol, gpt-6.1-terra, or gpt-6-luna; effort accepts low, medium, high, or xhigh — no max, that value is Claude-only). Absent a flag, each key falls back independently: the project config's .loom/work/config.toml [pressure] section first (if it sets that key), then ~/.loom/config.toml (loom config -k pressure.claude_model <value>), then its built-in default. --rounds resolves the same way: the flag, then the project [pressure] rounds, then ~/.loom/config.toml (loom config -k pressure.rounds <n>, at least 1), then 1. [pressure] resolves per key, so a project section that sets only claude_model still lets codex_effort fall through to your user config.

When the codex model is unavailable to the account (codex rejects it as not supported or not found), loom pressure retries with the same family's nearest newer version first and then the nearest older one, never another tier; every listed family currently has one model, so no fallback is tried. The fallback notice prints after the Claude session ends. When every model in the family is unavailable the run fails and shows the codex error.

A run that finishes all its rounds appends one line to a ## Pressure tests section of the plan (created after the plan's END loom METADATA marker when missing): the date, the Claude model, the Codex model that wrote each round's review, the round count, and whether the review was addressed. A stopped or failed run writes no record, and neither does a run whose plan moved or was replaced while it ran. The planning app's pressure dialog runs the same pipeline and writes the same record.

Key Default
pressure.claude_model opus
pressure.claude_effort xhigh
pressure.codex_model gpt-6.2-sol
pressure.codex_effort xhigh
pressure.address_model opus
pressure.address_effort high

loom status --live renders a live ledger dashboard: one row per stage across nine columns (STATE, STAGE, DEPENDS ON, MODELS, ACTIVITY, CONTEXT, TOKENS, TIME, MERGE), all shown from 132 cells wide. MODELS lists the orchestrator's own model first, then the models any subagents it spawned ran on. Columns drop in priority order as the terminal narrows; below a 64x16 (columns x rows) terminal a notice replaces the dashboard entirely. Press ? to toggle a legend overlay explaining every state icon, and t to toggle a per-agent token pane. When Claude or Codex quota data is available, a footer line above the legend shows a percent bar and reset countdown for each.

Token flow. A daemon thread reads the transcripts of every stage session, subagent and forwarded Codex job every 5 seconds and tracks how many tokens the run spends. "Fresh" tokens are input plus cache writes plus output; cache reads count only in the cache-hit percentage. Totals are also kept per model and reasoning effort. The web dashboard shows a TOKENS rail in the header (fresh per minute, plan total and cache hit, with no sparkline), a Token flow panel with a by-model pie, legend and totals table, a TOKENS column in the ledger, a trace on each stage card and a Tokens section in the stage dialog whose chips each carry a 30-minute trend; the terminal ledger has the TOKENS column, a plan summary in the header and the t pane, which ends in a by-model block. Beside the Claude five-hour quota meter, a label such as "~2h07m left" or "lasts to reset" estimates when the window runs out at the last 30 minutes' pace. The numbers come from local transcripts, so they are a lower bound: compaction and auxiliary calls may be missing. A Codex job appears when its forward returns, and fills in its own past minutes then.

Finished plan. When every stage is done, the daemon counts the run's last token usage, archives one statistics record under ~/.loom/stats/plans/<plan id>.json (kept by loom clean; LOOM_HOME moves it) and the live view switches to a PLAN COMPLETE screen: wall and execution time, token totals, a per-stage phase timeline (contract, executing, adjudication, retry, waiting) and a per-model table. Scroll it with the arrow keys (or j and k); q leaves. After the daemon exits, loom status --live shows the saved report from the top. The web dashboard shows the same report as a dialog over the shell, with the timeline described in text for screen readers.

loom status --web [PORT] [--host HOST] [--terminals] serves the same ledger in the browser, alongside a dependency-graph view of the plan — see Web Dashboard.

Plan Commands

loom plan [--port <PORT>] [--host <HOST>] [--no-open]    # Serve the feature planner for this repository; see Feature Planner
loom plan verify <plan-path> [--strict] [--json] [--no-color] [--dry-run]
loom plan check [--json]
loom plan hook <event> --session-dir <dir>              # Hidden internal PreToolUse path guard run by Claude Code for planning sessions; not run by hand
loom plan summary brief <IDS>... [--note <NOTE>]         # Claim summaries and print rebuild briefs
loom plan summary seal <ID> [--force]                    # Validate and save a draft
loom plan summary status [--json]                        # List summary states
loom plan summary release <IDS>...                       # Release claims

Bare loom plan starts the planning app for the current git repository and prints a URL with an access token. It opens the URL in a browser unless --no-open is given, the session is over SSH, or Linux has no display. By default it binds to 127.0.0.1, starting at port 7272 and trying the next port if that one is in use. --host selects the bind address; --port binds exactly the given port, with 0 asking the OS for a free port.

File mode in the planning app browses the repository's doc/ tree: it renders Markdown documents (raw HTML is shown as text and images as links), searches them, shows diffs against HEAD or a chat turn, and edits and saves plain doc/ documents in a CodeMirror editor. Saving needs the authoring seat, refuses a document that changed since you opened it (you merge the current text), and validates a plan before it writes unless you choose "Save with errors". Plans that are running or done, knowledge files and the summary store are read-only.

Concept mode is the reading view over the summaries in doc/loom/summaries/. The Product spec group (/product) opens on a product overview: a colour-keyed row of document chips, then the overview's sentences, each marked with the colour of the document it cites. The Plans group opens the metaplan page (/metaplan); /engineering and /run redirect there. A chip opens that document's summary page (/product/<doc>, /engineering/<slug>). Opening a sentence expands it in place to the summary sentences it cites, and opening one of those shows the source passages it rests on; a passage header links into file mode, and Fold all or folding a run closes what you opened. A summary whose sources changed since it was built shows dashed marks at once and refreshes where you stand: an open run stays open when the source sections it rests on survive, and leaves a note where it had to fold. Open runs are kept for the browser session, not in the URL. Keys: j/k or the arrows move between sentences, Enter or → opens the focused sentence, Esc or ← folds the innermost run, f opens file mode at the first source section, d opens the summary page of the sentence's first document, a attaches the focused sentence to the next chat message, g p opens the product overview and g e opens the metaplan. The "build" and "start" offers on empty pages start a chat; see the next paragraph.

The chat panel is the conversation with the planning Claude Code session. It sits beside the page on wide windows and opens as a sheet on narrow ones; c moves focus to the message box. An offer on an empty page, or the New chat control, starts a chat, and asks before it replaces a running one. Sending, interrupting, stopping and ending need the authoring seat. Attach a passage or a summary sentence to the next message (up to ten); each attachment shows as a chip, is cut to 2,000 characters and is marked changed when the document changed after you selected it. A message may be up to 100,000 bytes with its attachments. An idle chat that is waiting on background agents or shells shows "Waiting on N background tasks" under its title, and a button opens the list with each task's state, time and, for agents, model and token rate. Typing / opens a list of the session's skills and commands; commands that only work in the terminal are shown disabled with the reason, and the rest are sent as typed. Your draft and attachments are kept in this browser's local storage, per project. When Claude asks for permission, a card appears in the panel; y and n answer while the pinned card has focus. Each turn lists the documents it changed. Restore writes a file back to its text from before the turn through the same save path as the editor, so it refuses while a turn runs and when the turn created or deleted the file, and if you edited the file after the turn it opens the editor so you can merge. A viewer without the seat can use Send to author on a selected passage: the holder gets a card to attach or dismiss, at most 20 wait at once, and they are dropped when the seat changes hands. A document that changed since you last looked is marked with a dot in the tree and on its chips, and the header lists them; compare against a commit or ref, or mark everything seen. That checkpoint is also kept in local storage.

The planning server rebuilds out-of-date summaries itself, one summary session at a time. Up to five summaries rebuild without asking; when more are out of date, the header's summary status opens a "Rebuild all?" question and starts nothing until you answer. "Not now" remembers the declined summaries until a rebuild button for them is pressed or they are current again. Nothing starts during an authoring turn or in read-only mode, and a summary that a session leaves unsealed twice is marked failed instead of rebuilding forever. The summary panel in the header lists the running rebuild and shows the last rebuild's token cost, token totals for today and the last seven days, and the shared quota meters; the cost of each rebuild is appended to summary-cost.jsonl in the runtime directory, and the estimate before a rebuild comes from that log, falling back to fixed starting figures until it has lines. With plan.summary_backend set to codex, each batch runs as one background codex exec job in the workspace-write sandbox, which can write outside the project only to drafts/ and claims/ in the runtime directory; the running rebuild shows the job's log path in place of a tmux attach link, and the job records no cost.

Only one planning server runs per project. A second invocation exits non-zero and prints the running server's URL, or asks you to retry if it is still starting. Runtime state lives under ~/.loom/plan/<project-key>/; no loom init is needed. If tmux, Claude Code, its login, or the Linux sandbox prerequisites are missing, the app starts read-only and reports how to fix them.

Each Claude Code session of the planning app runs in its own tmux server named loom-plan-<id> (the chat names it), and you can watch it read-only with tmux -L <socket> attach -r. The server runs in the foreground after browser tabs close. The first Ctrl-C stops new sessions and messages and waits for running sessions to finish writing; a second Ctrl-C exits at once.

loom plan verify validates a plan file without touching .loom/work/ or requiring a git repo. It runs the same fatal validation as loom init (schema errors, unknown or retired fields at every nested policy layer, duplicate IDs, unknown dependencies, path safety) plus advisory warnings (structural issues, a stage without a summary, a missing knowledge-bootstrap stage when the repository's knowledge tree is missing or holds only the scaffold, sandbox gaps). A retired top-level truths block is rejected; move behavioral commands to acceptance. It additionally rejects requirements a sandboxed stage cannot satisfy — an allow_write grant under /tmp or missing on the host, a TMPDIR=<absolute path> override, a hardcoded /tmp/ path, and a mkdir, touch or output redirect aimed outside the worktree in acceptance, setup, wiring_tests, before_stage or after_stage commands — because the stage sandbox already provides a writable $TMPDIR. It rejects commands that cannot mean what they say inside a sandbox — an exit status masked by a final || true, || :, || exit 0 or ; true, HOME assigned from a variable or substitution, and a bare mktemp -d — and warns on network tools, reads of doc/plans/, rg -r, and hardcoded /tmp/ paths. A single rg or grep acceptance criterion that already passes at HEAD earns a baseline warning, since it cannot tell a stage that did its work from one that did nothing. A stage's skills: list is checked against the skill index: an empty, duplicate or unknown name is an error. It also warns when a stage description's worker/files-owned table claims overlapping paths between workers, or a claim outside the stage's declared files. --dry-run additionally runs the plan's provision entries in a checkout of HEAD, then every acceptance, after_stage and wiring_tests command once in that checkout under each stage's confinement and timeout; it needs a shell where loom can confine commands. It reports environment failures and timeouts as errors, an empty test selection as a note, a criterion that already passes as a note (a warning only when every acceptance criterion of a standard stage with no dependencies passes), and a plain failure as a note. A wiring pattern that starts with a definition keyword is an error in a version 2 plan and a warning in version 1. Exits 0 on success, non-zero on fatal errors; --strict promotes warnings to errors.

loom plan check prints the six-step checklist, current step, offers, and convention problems. It reads only files and needs no server. It exits 0 when there are no problems, 1 when there are problems, and 2 on an error such as running outside a repository. --json outputs the schema used by the planning app and sessions.

loom plan summary stores drafts and claims under ~/.loom/plan/<project-key>/ and needs no server. Seal refuses a summary claimed by another session. The commands exit 0 on success, 1 for a rejected seal, claimed brief, or refused release, and 2 for other errors.

Stage Commands

loom stage complete <stage-id> [--session <id>] [--no-verify] [--force-unsafe --assume-merged] [--no-cache]
loom stage block <stage-id> <reason>
loom stage commit <stage-id> -m <message>                                   # Relay the staged index for the daemon to commit and sign; wait with `loom request status <id> --wait 90`
loom stage reset <stage-id> [--hard] [--kill-session]
loom stage waiting <stage-id>
loom stage resume <stage-id>
loom stage hold <stage-id>
loom stage release <stage-id>
loom stage skip <stage-id> [--reason <text>]
loom stage retry <stage-id> [--force] [--context <message>]
loom stage merge [stage-id] [--resolved]
loom stage human-review <stage-id> [--approve|--force-complete|--reject <reason>]
loom stage dispute-criteria <stage-id> [--field acceptance|wiring|wiring-tests|artifacts] --criterion-index N --reason <text> [--evidence-commit <sha>] [--failure-output <path>]
loom stage dispute-findings <stage-id> --finding <id>... --reason <text>       # Plan version 2: challenge open review findings
loom stage dispute-contract <stage-id> --contract <id>... [--replacement <frozen-file>=<path>]... --reason <text>  # Plan version 2: challenge frozen contracts; one filing names every contract with the same cause; each --replacement pairs a frozen file with an edited copy outside the worktree (max 32 KiB each) that an accept writes in; a replacement is filed only after `loom check <stage-id> --contracts --replacement <frozen-file>=<path>` passed for the same bytes at the worktree's head
loom stage dispute-integrity <stage-id> --event <id>... --reason <text>       # Plan version 2: challenge a test-integrity event
loom stage dispute-criteria <stage-id> --field impact-tests --test <id>... --reason <text>  # Plan version 2: challenge failing impact-selected tests the stage did not cause
loom stage adjudicate --stage <stage-id> --dispute <n> --verdict-file <path>
loom stage contracts freeze <stage-id> [--test <id>=<identifier>]... [--runner <id>=<adapter>]... [--cwd <id>=<dir>]...   # Plan version 2: freeze (contract session); each flag repeats
loom stage contracts show|restore <stage-id> [--contract <id>]   # Plan version 2: inspect, or restore frozen contract files
loom stage review status|integrity <stage-id>                                 # Plan version 2: review rounds and open findings; test-integrity events
loom stage admin-proof [stage-id] [--daemon-stop] [--no-verify] [--force-unsafe] [--assume-merged]
loom stage amend <stage-id> --field acceptance|wiring|wiring-tests|contracts|harness|artifacts --op replace|insert|delete --index N [--value <yaml|glob>] [--reason <text>]   # --value: a YAML body for every field except harness and artifacts, which take a plain glob verbatim (trimmed, never parsed as YAML, so do not quote it); an operator command, refused inside a stage session (`LOOM_WORKTREE_PATH` set): a stage disputes a wrong check instead

loom stage human-review <stage-id> --force-complete lands a stage parked in NeedsHumanReview without acceptance checks: it records the committed tip of loom/<stage-id> as the completion commit, replacing any earlier one, and merges it; it refuses a missing or zero-commit branch. loom stage complete --force-unsafe without --assume-merged records the same tip and leaves the stage unmerged: with auto-merge on (the default) a running daemon lands it, otherwise loom run does, and loom stage merge <stage-id> from the stage worktree is the manual route; the command prints which applies. --no-verify adds nothing to it.

loom stage dispute-criteria is the sanctioned way for an agent to challenge a criterion it believes is wrong or impossible, instead of quietly weakening it. The daemon writes request.md and moves the stage to NeedsAdjudication; the verdict is daemon-written and never authored by the agent. loom stage adjudicate records that verdict from the adjudication session; loom stage admin-proof mints a one-time proof for a privileged action, to hand to another process through LOOM_ADMIN_PROOF (operators' own commands authorize themselves); loom stage amend is the audited, operator-facing way to edit a stage's acceptance, wiring, wiring_tests, contracts, harness, artifacts or reachable array directly. See Disputes, Adjudication, and Amendments.

Stage Outputs

loom stage output set <stage-id> <key> <value> [--description <text>]
loom stage output get <stage-id> <key>
loom stage output list <stage-id>
loom stage output remove <stage-id> <key>

Knowledge / Memory

loom map [--outline <path>] [--find-all <symbol|id>] [--impact <symbol|path|id>] [--callers <symbol|id>] [--callees <symbol|id>] [--references <symbol|id>]
         [--window <id>] [--window-lines <n>] [--limit <n>] [--path <prefix>] [--lang <dialect>] [--evidence <classes>] [--json] [--timings]
                                                                # Query the derived source graph: outlines, symbol lookup, impact, direct callers/callees/references with call sites, exact source windows
loom map --census [--root <dir>]...                             # Report what the graph can and cannot see: eligible, excluded, vendored, generated and unsupported files, coverage by dialect
loom map --eval-edges <dir> [--thresholds <file>] [--json]      # Score labelled corpora against the published edge-quality thresholds (exit 1 on a failing threshold)
loom knowledge context --query <text> [--stage <id>] [--budget-tokens <n>] [--explain] [--json]  # Token-budgeted context pack for a question
loom knowledge update <file> [content]                        # Append a section to a tier-1 file or tier-2 topic (<category>/<slug>)
loom knowledge replace-section <file> <heading> [content]      # Rewrite one section's body in place, at whatever level it's found
loom knowledge delete-section <file> <heading>                # Remove a section and its nested subsections (a heading rename is delete-section then update)
loom knowledge annotate <target> [--state <s>] [--section <heading>] [--source <path>]... [--verified <rev|HEAD>] [--alias <name>]... [--blurb <text>]
                                                                # Set lifecycle state (whole file, or one `##` section), evidence sources, verified revision, aliases, or a topic's blurb
loom knowledge telemetry [--stage <id>] [--json]                # Summarise recorded context delivery, prompt briefs, abstentions and pulls
loom knowledge sync [--structural-only] [--json]              # Rebuild derived retrieval artifacts after editing knowledge
loom knowledge check [--strict] [--strict-evidence] [--baseline <file>] [--json]  # Report knowledge-base diagnostics (read-only; never opens the context store); --strict-evidence also fails on changed or unassessable declared sources; --baseline makes --strict fail only on structural issues the file does not record
loom knowledge check --write-baseline <file>                  # Record every current structural issue in <file> and exit 0, to adopt the size limits on a tree that cannot clear them yet

loom memory note <text> [--stage <id>]
loom memory decision <text> [--context <why>] [--stage <id>]
loom memory change <text> [--stage <id>]
loom memory question <text> [--stage <id>]
loom memory query <search> [--stage <id>]
loom memory list [--stage <id>] [--entry-type <type>]
loom memory show [--stage <id>] [--all]
loom memory resolve <event-id> --outcome <promoted|merged|discarded|deferred> [--target <file#heading>] [--reason <text>]
                                                                # Record how a captured note/decision/question was processed
loom memory pending [--stage <id>] [--group] [--strict] [--json]  # List notes, decisions, and questions that have no receipt; --group prints corrections (by target file and heading), mistakes, decisions, other

A plan's .loom/work/ state is archived to <main>/.loom/memory/archive/<plan-id>-<timestamp>/ when the plan completes; loom clean/loom init --clean are what actually delete it.

Plan completion, loom clean and loom init --clean copy memory/ and telemetry/ into the archive first. When archiving fails while the memory directory holds journals, loom clean and loom init --clean stop with an error naming the archive path and leave the state directory in place. Plan completion stops before the DONE- rename: the plan stays IN_PROGRESS with its state in place. A foreground loom run returns the error; under the daemon the error is only logged (Warning: Failed to mark plan as done: ...) and the run still reports completion. Fix the cause (the error names the path), then run the command again; for plan completion, run loom run again, which finds every stage merged and retries the completion step.

To distill a failed run, start the new plan with loom init, then, before loom run, copy the archived journals into its state directory: cp <main>/.loom/memory/archive/<plan-id>-<timestamp>/memory/*.md .loom/work/memory/. The new plan's knowledge-distill stage lists them in loom memory pending --group and curates them with its own; loom memory pending --strict then requires a receipt for each. Journals are named by stage id, so an archived journal whose name matches a stage of the new plan (integration-verify.md, say) becomes that stage's journal, and the stage's signal recites its entries.

See Knowledge System for how these fit together.

Other Commands

loom review [--ai-summary]                                                   # Generate a code-review doc from stage memories; --ai-summary uses headless `claude -p`
loom usage [--since <duration|date|rfc3339>] [--until <rfc3339>] [--provider claude|codex|all] [--project <path> | --all] [--stage <id>] [--plan <name>] [--windows 5h|week] [--json]
                                                                             # Report what agent sessions actually consumed, per provider (Claude and Codex are never summed), including peak resident context by scope in a `peaks` section (main vs subagent p50/p90/max, share above 250k and 400k tokens)
loom usage [--claude-root <dir>] [--codex-root <dir>] [--receipts-root <dir>] [--forward-receipts-root <dir>]
                                                                             # Read explicit telemetry roots; a supplied root never falls back
loom usage --quota                                                           # Print the `## Model Budget` section a stage signal carries: each provider's fresh 5h and 7d windows and at most one routing line; plan authors read it when choosing lanes
loom usage --compare <artifact.json> [--json]                                # Offline paired evaluation: exit 0 supported, 1 rejected, 2 inconclusive (doc/loom/knowledge/architecture/token-accounting-and-receipts.md)
loom usage --run-evidence <declaration.json> --project <dir> --since <rfc3339> --until <rfc3339> [--claude-root <dir>] [--codex-root <dir>]
                                                                             # Print one run's RunEvidence for --compare
loom ask --question <Q> --paths <P>... [--backend claude|codex] [--model <M>] [--timeout-secs <N>] [--json]
loom ask --eval <cases.json> [--backend claude|codex] [--model <M>] [--timeout-secs <N>]
                                                                             # Evaluation only: one-shot worker answers a question about named files; --eval scores a backend against a cases file (exit 0 at 90% accuracy)
loom subagents list | harvest [--id <id>] [--json]                           # One-shot diagnostics only: list shows liveness, harvest prints a terminal report (optionally one agent's); watch/wait below are the blocking waits
loom subagents watch --worker <kind>:<id> [--worker <kind>:<id> ...] [--session <claude-parent-uuid>] --timeout <secs> [--json]
                                                                             # One owned wait, inside a loom stage only (needs LOOM_STAGE_ID/LOOM_SESSION_ID/LOOM_WORK_DIR): exit 0 all bound workers have fresh correlated success; 2 deadline passed; 3 worker failed/cancelled
                                                                             # kind is claude (spawned agent ID) or codex (--unit-id, or the --unit-id of a native start); exit 4 AlreadyWaiting/Busy (no second monitor)
                                                                             # Exit 5 identity/evidence unknown; --dir or no --worker is rejected with migration guidance; exit 6 bound worker hung: a Claude transcript grew nothing past the stall budget, or a codex job's process is gone or its log stopped growing
loom subagents wait --receipt <id> [--timeout <secs>] [--json]               # Wait on one exact forwarded Codex job; exit 0 succeeded, 1 failed/canceled, 2 still running/unknown
loom subagents start --provider codex --unit-id <unit> --brief <absolute path> --model <model> --effort <effort>
                                                                             # Native Codex backend, stage main agent only: relays one worker start; read the verdict with loom request status <id> --wait 90
loom subagents message --worker codex:<unit> --invocation <id> --delivery steer|next-turn --message-id <id> (--text <text> | --file <path>)
                                                                             # Native backend: relays a steer or next-turn message to a running worker
loom subagents cancel --worker codex:<unit> --invocation <id> --reason <text>
                                                                             # Native backend, inside a stage: relays a cancel; an operator outside a session passes --stage <stage> instead of --invocation
loom subagents status --worker codex:<unit> [--stage <stage>] [--json]       # Native backend: one-shot state of the unit's newest worker
loom subagents result --worker codex:<unit> [--stage <stage>] [--full] [--json]
                                                                             # Native backend: the worker's final report once it has ended
loom subagents release --stage <stage> --invocation <id>                     # Native backend, operator only: records that a worker's processes are gone after an unverified stop
loom attach [stage-id]                                                       # omit the id for a tiled overview
loom sessions list
loom sessions kill <session-id...> | --stage <stage-id>
loom handoff [--stage <id>] [--session <id>] [--trigger <type>] [--message <text>]
                                                                             # Capture session state to a handoff file; stage and session default to $LOOM_STAGE_ID/$LOOM_SESSION_ID, --trigger defaults to manual
loom worktree list
loom worktree remove <stage-id>
loom graph
loom project detect [PATH] [--json]                                          # Per package: language kinds, the test runner loom would use (or unsupported), and the matching skills
loom context record-edit --stage <id> --path <path> [--path <path>...]       # Deprecated compatibility no-op; validates the stage ID
loom hook user-prompt                                                        # UserPromptSubmit entry point; invoked by loom's hooks
loom hook blocks [--since-hours N] [--by-rule]                               # Summarize the guard block ledgers in $LOOM_WORK_DIR/heartbeat (default 168 h): the 20 newest blocks, or with --by-rule counts per guard/rule by role
loom request status <id> [--session <id>] [--wait <secs>]                    # Plumbing: has the daemon applied a request relayed through the sandbox? <id> is printed after the originating command
loom skill-index                                                             # Plumbing: rebuild the skill keyword index the skill-trigger hook reads
loom repair [--fix]
loom clean [--all|--worktrees|--sessions|--state]                            # runs from any subdirectory of the main checkout, refuses inside a stage worktree; --state and --all refuse while the target branch is held (see loom target)
loom target status                                                           # Accepted tip, current tip, attestation state, hold reasons and the review and restore commands
loom target accept --to <commit>                                             # Accept the target's current tip after review; refuses inside a loom session
loom update
loom config [-k <key> [<value>] | --list | --print]                          # Read or write ~/.loom/config.toml; bare in a terminal it opens the settings screen (see Configuration)
loom install-assets [--skills core|all]  # Install loom's agents, skills, commands, hooks and doctrine files into ~/.claude and ~/.codex; see Install script below for what --skills core|all installs where
loom completions [<shell>] [--install] [--migrate]

loom usage also prints an Attribution section: an estimate, per session, of where cost went by what entered the context (read:skill, read:knowledge, read:source-other, bash:*, agent reports, and so on), the startup context each agent type begins with, and a residual that is reported rather than hidden. It is an estimate from transcripts, not a provider measurement, and it overstates rows in sessions that compacted. Together with the reads section it is how the read gate and the loom-software-developer agent are judged (see Read gate).

loom ask is an evaluation instrument, not a tool for agents. It starts one worker with no tools, no settings and no project instructions, hands it the named files (400,000 bytes at most; credential files, symlinks and paths outside the project are refused) and prints its answer with a usage line. loom ask --eval runs a JSON cases file and reports accuracy, worker tokens, latency and what reading the files directly would have cost. The Claude lane is the default; the Codex lane is experimental until an isolation probe passes against the real provider. Nothing in loom's agents, skills or hooks tells an agent to call it, and none should until the evaluation and replays show a saving.

loom usage --project also reads the transcripts of the project's removed stage worktrees. Each provider reads measured or partial with reasons: a session record naming an unread transcript, an unreadable session record, unparseable lines, unknown or ambiguous rows, a forward receipt whose thread has no rollout, or a damaged forward receipt. Codex rows count for a project only through the threads its forward receipts name, so --all is the way to see every Codex rollout. --run-evidence takes the run identities from the declaration (the fields of the artifact contract, minus the measured ones) and measures tokens, retries, fixes, the critical path and the open review findings of the stages that started inside the --since/--until window; both bounds must be RFC3339, and a stage straddling either bound aborts the producer. It refuses usage from a provider the declaration does not assign. Review severities critical, major, minor and unspecified map to critical, high, medium and low. An artifact may declare "token_rule": "net-total" and "latency_tolerance_ms". Produced evidence always carries notification_latency_ms: null, so a comparison of produced runs reads missing-latency-evidence unless the artifact declares latency_tolerance_ms; produced evidence needs that declaration to reach supported-candidate.

loom handoff writes the document a successor session resumes from, under .loom/work/handoffs/. Loom's pre-compact hook calls it automatically before a compaction, and an agent that reaches its context ceiling calls it explicitly with --trigger ceiling.

loom target is the operator side of the target guard. Loom records the last tip of the target branch ([plan] base_branch, normally main) it accepted, and a git reference-transaction hook installed by loom init and loom repair --fix attests moves made by host-side git. A move loom did not make that rewrites history, touches a merge-gate control path, carries unmerged loom/* stage work, or (with attestation on) has no hook record holds every merge into the target and shows a warning in loom status; running stages continue, and new worktrees start at the accepted tip. Loom never restores the ref: review the move with loom target status, then either run loom target accept --to <commit> or restore the ref with the command status prints. loom clean --state|--all and loom init --clean refuse while a target is held, because deleting the record would let the next run trust an unreviewed move. Git runs hooks from core.hooksPath when it is set. Loom installs there only when the directory is inside the repository and untracked. Where it is outside the repository or git tracks it (husky and similar), attestation is off, and only the history, control-path and stage-work checks apply.

loom request status and loom skill-index are plumbing for loom's own hooks and its sandbox relay rather than commands a plan author types; they are listed so hook output that names them is traceable.

Configuration

Loom keeps its settings in two TOML files. A project file overrides the user file, and an explicit per-invocation value (a stage's own model field in the plan, a loom pressure flag) overrides both:

Tier File Applies to
user ~/.loom/config.toml Every workspace on this machine
project <repo>/.loom/work/config.toml This workspace only

Neither file needs to exist: every key has a built-in default. LOOM_HOME relocates the user file ($LOOM_HOME/config.toml).

There are three ways to change a setting:

  1. loom config. Run bare in a terminal it opens a settings screen; with flags it is scriptable. loom config -k <key> prints one key, loom config -k <key> <value> writes it (validated against the key's type and value set), loom config --list prints every key with its value and where it came from, and loom config --print prints the resolved user config as TOML. It reads and writes the user file only. The settings screen edits each row by its type: ↑↓/k/j move, ←→/h/l/space cycle an enum's variants or toggle a bool, Enter opens a text editor for a number or free-text key (and steps a bool/enum forward otherwise, so no keystroke opens a text field on a closed vocabulary), s saves, Esc/q quits, * marks a pending change.
  2. Edit the files. Both files use the same [section] / key = value layout as the table below, except plan.* keys use [plan] in the user file and [planning] in the project file; project sections may be partial. loom init writes a [context] section into the project file, everything else is opt-in.
  3. The dashboard. loom status --web has a settings dialog that edits both files, one key at a time, with the resolution shown per key (Web Dashboard Settings).

The keys, with their built-in defaults:

Key Default Values Project tier
update.check true true, false no
update.check_interval_hours 24 integer no
context.ceiling_tokens 800000 integer whole section
codex.backend native legacy, native per key
pressure.claude_model opus haiku, sonnet, opus, fable per key
pressure.claude_effort xhigh low, medium, high, xhigh, max per key
pressure.codex_model gpt-6.2-sol gpt-6.2-astra, gpt-6.2-sol, gpt-6.1-terra, gpt-6-luna per key
pressure.codex_effort xhigh low, medium, high, xhigh per key
pressure.address_model opus haiku, sonnet, opus, fable per key
pressure.address_effort high low, medium, high, xhigh, max per key
pressure.rounds 1 integer, at least 1 per key
plan.document_summary_model haiku haiku, sonnet, opus, fable per key
plan.document_summary_effort high low, medium, high, xhigh, max per key
plan.overview_model sonnet haiku, sonnet, opus, fable per key
plan.overview_effort high low, medium, high, xhigh, max per key
plan.summary_backend claude claude, codex per key
plan.summary_codex_model gpt-6.1-terra gpt-6.2-astra, gpt-6.2-sol, gpt-6.1-terra, gpt-6-luna per key
plan.summary_codex_effort high low, medium, high, xhigh per key
plan.spec_authoring_model opus haiku, sonnet, opus, fable per key
plan.spec_authoring_effort medium low, medium, high, xhigh, max per key
plan.plan_authoring_model opus haiku, sonnet, opus, fable per key
plan.plan_authoring_effort high low, medium, high, xhigh, max per key
models.standard_model sonnet haiku, sonnet, opus, fable per key
models.standard_effort high low, medium, high, xhigh, max per key
models.knowledge_model opus haiku, sonnet, opus, fable per key
models.knowledge_effort medium low, medium, high, xhigh, max per key
models.knowledge_distill_model sonnet haiku, sonnet, opus, fable per key
models.knowledge_distill_effort high low, medium, high, xhigh, max per key
models.integration_verify_model opus haiku, sonnet, opus, fable per key
models.integration_verify_effort xhigh low, medium, high, xhigh, max per key
models.code_reviewer_model opus haiku, sonnet, opus, fable per key
models.code_reviewer_effort high low, medium, high, xhigh, max per key
models.contract_writer_model opus haiku, sonnet, opus, fable per key
models.contract_writer_effort high low, medium, high, xhigh, max per key

"Whole section" means a project [context] section replaces the user tier's section outright, so a key it omits takes the built-in. "Per key" means a project [pressure], [planning], [models], or [codex] section overrides only the keys it names and the rest fall through to the user file. The pressure.* keys are explained under Primary Commands, the models.* keys under Model Allocation.

Read gate

Inside a live stage, an agent's first whole read of a file over 400 lines is denied once with the file's loom map --outline (a Markdown file gets a heading outline directly), and the agent's next whole read of that file passes. The key is the agent and the absolute path, so a Read and a Bash cat share one denial. Outside a stage the same message is only a warning. The gate is on by default. Hook changes take effect only after install, and installed hooks apply to every checkout at once, so install only when no other loom run is active.

The gate is an operator decision with no replay behind it. After install, compare the reads section and the Attribution read:* rows for 14 days before and after, and count the rows under .loom/work/hooks/read-denials/. Each row is a denied call that cost one request, and same_transcript_rereads counts the retry. Turn the gate off unless the read:* cost falls by more than those denied calls cost, about 15K units each at 150K resident.

To turn it off, set read_gate = false under [hooks] in .loom/work/config.toml after loom init and before loom run. loom clean and loom init --clean drop the setting, loom config does not manage it, and editing the file during a host job fails that job with verification policy changed.

Web Dashboard

loom status --web [PORT] [--host HOST] [--terminals]

The dashboard binds to 127.0.0.1 by default and serves the live ledger over a WebSocket in the browser; see Web Dashboard Remote Access for --host. Two views share the same data: the graph draws the plan as a dependency graph colored by stage state, and /ledger puts one row per stage in a table with the same columns as loom status --live. Both carry a "needs attention" panel naming the stages that need a person, with a suggested command for each.

A daemon poller checks Claude and Codex quota roughly every 180 seconds; whenever either has data, the dashboard's sticky footer shows a percent bar and reset countdown for each, the same meter drawn above the legend in loom status --live.

Without PORT, it starts at port 7373 and automatically tries the next available port when a candidate is occupied. Supplying a nonzero PORT requests that exact port; PORT 0 asks the OS for any free port. It works without the daemon by polling .loom/work/ files directly when the daemon socket is unreachable. Besides the ledger, it exposes a settings dialog for editing loom's configuration and, with --terminals, a way to open a stage's terminal from the browser.

Web Dashboard Remote Access

loom status --web --host 0.0.0.0        # every interface
loom status --web --host 192.168.1.5    # one concrete address
loom status --web --host ::             # every interface, IPv6

--host accepts an IPv4/IPv6 literal or the exact alias localhost; it rejects DNS names, URLs, and anything carrying its own port (--web already owns the port). Left unset it binds 127.0.0.1, which keeps the dashboard's original behavior exactly.

Any bind that is not loopback — a concrete address or a wildcard (0.0.0.0/::) — turns on remote mode: loom mints one process token and prints a URL containing it at startup. Every route then requires a cookie exchanged for that token by opening the printed URL once; a wrong or missing token gets refused. Each request's Host must name the connection's own accepted socket address exactly, and a supplied Origin must match it too, so a DNS name, wrong port, or a proxy that rewrites Host all get refused.

Limits:

  • Plain HTTP, no TLS — anyone who observes the token or cookie on the network gets dashboard and settings access, and terminal control if --terminals is also set. Use it only on trusted networks, or tunnel a loopback bind instead: ssh -L 7373:127.0.0.1:7373 host. A tunnel may map any local port (ssh -L 8080:127.0.0.1:7373 host): on a loopback bind the Host header must be a loopback name with any port, and a supplied Origin must be http:// or https:// plus that same Host, so a page served from another local port is still refused.
  • No reverse-proxy support: a proxy that rewrites Host to a DNS name is refused.
  • No DNS hostnames for --host, and no config key for the bind host — it is a CLI flag only.
  • The token is per process; restarting the dashboard invalidates every existing cookie.

Web Dashboard Settings

The dashboard header has a settings button; opening it (or navigating to ?settings=1) edits loom's configuration in place, so the browser's back button closes the dialog. Each row shows all three tiers — built-in, user, project — side by side as table columns, or as one card per row below 700px wide. It edits every key in the registry loom config does — thirty-five keys across update, context, pressure, models, plan, and codex: update.check / update.check_interval_hours (loom's self-update check), context.ceiling_tokens (see Plan-Level Context Fields), the six pressure.* model and effort picks described under Primary Commands plus pressure.rounds, the thirteen models.* model and effort picks described under Model Allocation, the eleven plan.* model, effort and summary-backend keys, and codex.backend, which selects the default native Codex worker lane or the legacy forwarder. loom config --list prints every key with its current value and origin. Every control here writes immediately on change, one key at a time; there is no separate Save step, and validation errors from the server surface next to the control that triggered them.

Above that config table sits a dashboard section that never touches those files — two preferences kept entirely in the browser's localStorage: a theme picker (Ledger, Harbor, Aubergine, Graphite, Midnight, Obsidian, Indigo Night, each drawn as a miniature of the stage graph in that theme's own colors) and a desktop-notification switch that raises an OS notification when a stage needs a human, needs a handoff, or the whole run finishes. The section renders even when /api/config is unreachable, and stays visible under any filter that matches it. Desktop notifications need a secure context — https, localhost, or a loopback address — so the switch disables itself and explains why when the dashboard is served over plain HTTP to a non-loopback host.

Two scopes:

Scope File Applies to
user ~/.loom/config.toml Every workspace on this machine
project <repo>/.loom/work/config.toml This workspace only

Thirty-three of the thirty-five keys have a project tier: context.ceiling_tokens, and every pressure.*, models.*, plan.* and codex.backend key; the dialog marks the remaining update.* keys as machine-wide rather than offering a project control that would do nothing. A key's effective value resolves project → user → built-in default, and each row shows which tier is currently in force plus what clearing an override would fall back to.

The fallback is not uniform across sections. For [pressure] and [models], the project tier resolves per key — a project section that sets only one key still lets every other key in that section fall through to your user config. For [context], a project override still replaces the whole .loom/work/config.toml section, not just one key: clearing the override removes the key and, if that empties the section, the section too — but if a sibling key is still in there (as with [context], since loom init writes ceiling_tokens alongside subagent_ceiling_tokens), the section still wins as a whole and the value resolves to the built-in default rather than falling through to your user setting. The dialog reports each case accurately; for [context] that section-level fallback just may not be what you expected.

On the default loopback bind, the dashboard stays an unauthenticated tool for the person running it — the settings endpoint adds no login. On a remote (--host) bind, every route including settings requires the startup-token cookie in addition to the checks below. Writes are gated by the same Host check as the rest of the dashboard, plus a strict Origin check (loopback: must be present and loopback; remote: must equal the connection's own address exactly) and a per-process CSRF token issued on load.

Web Dashboard Terminals

loom status --web --terminals adds a "Take control" view to each stage's detail dialog: an xterm.js terminal opens right in the browser, attached to that stage's live tmux session. It starts in a read-only View mode; switching to Control sends every keystroke to the running agent. Enabling --terminals mints a one-time token and prints it in the startup URL — open that exact link once to set an auth cookie for the dashboard; a plain --web link never gets the "Take control" option. With a non-loopback --host, the same startup token already covers the dashboard cookie; the cookie alone still never grants "Take control" — that capability comes only from passing --terminals.

Scrolling and replay. In View mode a full-screen program (tmux's alternate screen) scrolls by gesture: a wheel gesture needs a short lead (a quarter of the screen, at least three lines) for its first page, then a full screen per page, at most three pages per gesture, and a pause of 250 ms starts a new gesture; a touch swipe pages one screen at a time. A stopped session's terminal is saved when its tmux server ends and the stage dialog replays it read-only. A session that ran a full-screen program has no scrollback, so loom samples its visible screen on every monitor poll and saves the last frame instead, labelled as the last screen.

Plan Format

Plans live in doc/plans/ with metadata in fenced YAML between loom markers.

# PLAN-0001: Feature Name

<!-- loom METADATA -->

```yaml
loom:
  version: 1
  sandbox:
    enabled: true
  stages:
    - id: implement-api
      name: Implement API
      summary: Adds the endpoint and its tests.
      description: Add endpoint + tests
      working_dir: "."
      stage_type: standard
      dependencies: []
      acceptance:
        - "cargo test"
        - command: "cargo test api_integration::returns_200"
          stdout_contains: ["test result: ok"]
      files:
        - "loom/src/**/*.rs"
      artifacts:
        - "loom/src/api/*.rs"
      wiring:
        - source: "loom/src/main.rs"
          pattern: "mod api;"
          description: "API module registered"
      execution_mode: team

    - id: integration-verify
      name: Integration Verify
      working_dir: "."
      stage_type: integration-verify
      dependencies: ["implement-api"]
      acceptance:
        - "cargo test --all-targets"
        - command: "cargo test api_integration::returns_200"
          stdout_contains: ["test result: ok"]
```

<!-- END loom METADATA -->

Plan-Level Context Fields

Set in the loom: block alongside version and stages, these supply the default ceiling for every stage that does not declare its own. Both are absolute resident-token counts with a minimum of 60000, and both are persisted into .loom/work/config.toml's [context] section at loom init.

Field Required Notes
context_ceiling_tokens No Default ceiling for a stage's main agent session (default 150000)
subagent_ceiling_tokens No Ceiling for subagents spawned by a stage session (default 120000); never read from a stage
auto_merge No Plan-wide default for automatic merge on completion; a stage's own auto_merge overrides it, and both fall back to the orchestrator's own setting (loom run --no-merge disables it) when unset

Stage Fields

Field Required Notes
id Yes Stage identifier
name Yes Human-readable title
working_dir Yes Relative execution directory (. allowed)
description No Task brief for the agent: the full spec its session works from
summary No 1-3 sentences for a human on what the stage delivers; the web dashboard shows it instead of description. loom plan verify warns on a stage without one
dependencies No Upstream stage IDs
parallel_group No Optional label grouping related stages; the dependency graph alone still decides scheduling order
auto_merge No Per-stage override for automatic merge on completion; takes priority over the plan-level and orchestrator defaults
acceptance Conditionally required Shell criteria (strings or extended objects with stdout_contains etc.)
setup No Setup commands
files No File glob scope
stage_type No standard (default), knowledge, integration-verify, knowledge-distill
artifacts / wiring Conditionally required Required for standard and integration-verify (acceptance OR goal-backward)
wiring_tests / dead_code_check No Extended verification
before_stage No Pre-spawn checks (TruthCheck list); stage → Blocked if any fail
after_stage No Post-acceptance checks (TruthCheck list); completion fails if any fail
code_review No integration-verify only: dimensions (string list) and require_all (bool); rendered as checklist in agent signal
bug_fix No Marks this stage as a bug fix; requires regression_test (Bug-Fix Stages)
regression_test Conditionally required Required when bug_fix is true: file (test path, relative to working_dir) plus optional must_contain patterns
model No Model for this stage's main agent; one of haiku, sonnet, opus, fable (any other value fails when the plan is parsed); omit to use the stage type's configured default (Model Allocation), overridable via [models] in either config file, or set here as a deliberate per-stage override
reasoning_effort No low, medium, high, xhigh, max; omit to use the stage type's configured default (Model Allocation), overridable the same way
implementers No Licensed agent lanes as a list, first = preferred for routine work: ["codex", "claude"]. Default ["claude"]. Listing a lane makes it available, not mandatory — a stage mixes lanes per subagent
ultracode No License this stage for large multi-agent fan-out; per-stage opt-in (default false)
skills No Skills this stage's agents need, by catalog name (["loom-rust", "loom-debugging"]). loom plan verify rejects an empty, duplicate or unknown name; the signal lists each as a skill to load before the detected ones, and a subagent's brief names them
consumer_deferred No One line (at most 300 bytes) saying why no consumer of the stage's new units exists in the plan; satisfies the wiring-coverage warning and the version 1 leaf rule for a stage with artifacts and no wiring, and waives nothing else
subagent_timeout_secs No Seconds of tool silence before the monitor warns appears hung (default 300); the advisory idle budget death is judged against — never the --timeout on the single owned loom subagents watch --worker ... --timeout 3600 call
context_ceiling_tokens No Absolute resident-token ceiling for this stage's session (minimum 60000). Resolved stage value → plan-level context_ceiling_tokens → 150000. The session hook warns at 80% and blocks at 100%; the daemon forces a handoff at 125%
plan_overview No Set false to suppress the embedded plan overview in this stage's signal
sandbox No Per-stage sandbox override
sandbox.permission_mode No auto (default), accept-edits, plan, default — resolves stage > plan > stage-type default; bypass-permissions is rejected at init
execution_mode No single (default) or team hint

Stage Type Behavior

  • knowledge: knowledge/bootstrap work, different verification expectations
  • standard: implementation stage; must define goal-backward checks
  • integration-verify: final quality gate combining code review and functional verification; must define goal-backward checks. Define code_review.dimensions to render a checklist of review dimensions in the agent's signal.
  • knowledge-distill: final stage; curates stage memories into permanent knowledge files

Plan Version 2

version: 2 turns on stricter verification; version: 1 keeps the rules above unchanged, and a v1 plan that uses a v2-only field is rejected (`<field>` requires `version: 2`). The v2 fields:

Field On Notes
contracts stage Tests written and frozen before implementation: id, file, test, optional runner, scenario, and rejects (the plausible wrong implementation the test must fail on). Every standard stage of a v2 plan needs at least one; knowledge, knowledge-distill and integration-verify stages take none
harness stage Globs of extra test-only files the contract writer may edit. Every matched file is frozen with the contracts, so do not glob production files. Module declarations a Rust contract needs are derived by loom (scaffold) and are not frozen.
reachable stage symbol, from, description, optional min_confidence: the new unit must be reachable from an entry point in the source graph
literal: true, glob source wiring entry Match the pattern as literal text; let source be a glob (*, ?, [). A pattern that matches only a definition of a name defined in that file is rejected, so point it at a consumer
ratchet_files plan Exact paths of baseline or ledger files a stage could loosen; a change that loosens one raises a test-integrity event
provision plan Host commands that prepare each worktree (for example a dependency install), each with a working_dir and a command. loom init snapshots the entries into the work directory's config.toml; the daemon runs that snapshot, never the plan file, on the host in each worktree after the before_stage checks and before the session spawns. A failing entry blocks the stage. Entries must be idempotent, and loom plan verify rejects an install without the hardening flags and a JS package with no entry
loom:
  version: 2
  ratchet_files: ["loom/maintainability-baseline.txt"]
  stages:
    - id: implement-api
      stage_type: standard
      contracts:
        - id: rejects-empty-name
          file: "tests/api_contract.rs"
          test: "rejects_empty_name"
          scenario: "POST /users with an empty name"
          rejects: "an implementation that stores the empty name"
      reachable:
        - symbol: "create_user"
          from: "main"
          description: "the handler is reachable from main"

In a version: 2 plan, loom plan verify rejects a plan that does not have exactly one knowledge-distill stage, a distill stage that another stage depends on, a stage that is not an ancestor of the distill stage, and a standard stage that is not an ancestor of an integration-verify stage; a version-1 plan gets each of these as a warning. Stage types are resolved as the plan runs them, so an omitted stage_type counts by the stage's id and name.

A v2 standard stage starts with a separate contract session that writes the contract tests, runs them red, and ends with loom stage contracts freeze; loom then hands the stage to the implementing session. The writer names each contract's test on that command (and, where the plan leaves them open, the runner and directory), and the freeze also runs the stage's lint and search checks over what the writer wrote. loom project detect shows which test runner loom will use for each package. Runners without an adapter fall back to running the contract's test string and judging its exit code.

The contract phase is visible wherever loom status renders: a magenta contracts tag next to the stage's [model] tag (added to the legend while such a stage exists), the live TUI's activity cell reading writing contract tests or, once stale, contract writer idle <duration>, and the web dashboard's violet contracts tag with a dashed node outline, the same activity text, a ... · contract phase stage-strip label, and a contract writer row in the stage dialog's session type.

While the daemon runs the frozen contracts as a host job, the writer is blocked and silent, so every surface says so instead: the static tag and the live TUI's activity cell read contracts written, testing 9/11 · 6m12s (contracts written, waiting to test while the run is queued), the dashboard shows the same text with a ... · testing contracts stage-strip label, a separate testing contracts chip in the state key and a contract testing row in the stage dialog, and the stage line drops its idle marker. An orphaned or crashed writer keeps its own state.

A refused freeze — a file changed outside the contracts and harness globs, a contract not reported red, a lint or search check of the stage that fails on a file the writer wrote, or (checked by the daemon) a FIFO, socket or device node left in the worktree — does not park the stage. A failed lint or search check comes back to the live writer session with the failing output, and only the third such return in one session, or five quiet minutes after one, files the dispute. Loom files it as a freeze-refusal dispute and an independent adjudicator decides: at once for a refusal the daemon made, and after five quiet minutes with no running subagent for one recorded by the writer's own pre-check. reject starts a fresh contract writer with the adjudicator's instructions; accept amends contracts or harness, or replaces a format criterion, with a cited reason; needs-more-evidence is answered by the writer through loom memory note and a re-freeze. The fourth refusal escalates to NeedsHumanReview. Agents never file this dispute; only loom does. A writer that stops before its first freeze attempt is not disputed.

Completion runs a Rust contract by test name, so the freeze and completion also prove that the frozen file is the one compiled under that name. The module declarations a contract file needs are derived from the stage base, and the writer may add exactly those (any other change outside the contracts and harness is refused). Loom then walks the mod chain from a libtest test target root to the file and refuses #[path], #[cfg_attr], any cfg other than #[cfg(test)] on a chain mod item or as an inner attribute of a chain file, inline modules, a target with test = false, harness = false or required-features, a chain no test target compiles, and a run directory whose Cargo.toml does not select the contract's package (a workspace root whose default-members leave it out). A contract that needs one of these belongs in a tests/ file. cargo runner overrides in .cargo/config.toml, build.rs and code elsewhere in the same test binary can still change a run; the check does not see them.

Verification Model

loom check <stage-id> validates outcomes, not just compilation/tests. A standard stage's orchestrator runs it once on the formatted tree, beside the final review round, and a fix round re-runs only the failed criteria with --criterion <n> (0-based, repeatable, plus the lint and format criteria). It checks:

  • acceptance: shell criteria (simple strings or extended objects with stdout_contains, exit_code, etc.; an extended criterion without timeout_secs runs for up to 300 s, while before_stage, after_stage and wiring_tests commands keep 30 s)
  • artifacts: real implementation files exist
  • wiring: critical integration links exist
  • wiring_tests: runtime integration checks
  • dead_code_check: detect unused code via command output patterns

For standard and integration-verify stages, acceptance criteria or at least one goal-backward check must be defined.

In a version 2 plan, loom stage complete also runs, in order: the contract check (every frozen contract file unchanged, every contract test passing), test integrity (fewer test declarations or assertions, removed or changed assertion statements, or a loosened ratchet_files entry each raise an event that must be fixed or accepted through an adjudicated dispute; a reflow, a multi-line rewrap, a test moved to a file the runner still collects and a tightened ratchet raise nothing, and every final code review sees the stage's events in a brief loom computes), the tests reached from the changed code in the source graph, and the review gate. A criterion that runs a recognised test runner and selects zero tests fails. The gate needs a loom-code-reviewer round on the final change fingerprint with every finding fixed or ruled on; editing any file after the last round, formatting included, needs another round, while committing does not. The loom daemon that owns the worktree computes this fingerprint, once, for both the round a review records and the completion that checks it; a session runs no check locally: its loom stage complete relays the request, and the daemon runs test integrity and the review gate once, when it applies a passing run. Integration-verify re-checks every stage's reachable and wiring on the merged tree and lists the full test command.

In a version 2 plan, loom check <stage-id> --contracts runs the stage's frozen contracts the way completion does and prints one outcome per contract (contract:<id>): in a session as a host job the daemon runs, from the operator's shell locally. A plain loom check <stage-id> on a standard stage whose contracts are frozen runs them too, after the goal-backward checks, so the gate run before loom stage complete shows a failing contract. Every contract runs inside loom's confinement, at freeze and at completion: no network, writes only inside the worktree and TMPDIR, and no nested OS sandbox, so a test that starts sandbox-exec, bwrap or a confined loom command cannot start there. The freeze refuses a red whose output shows such an environment failure. Run the check as soon as the contract tests compile. A contract that fails for a reason no implementation can change is disputed at once: add --replacement <frozen-file>=<path> (repeatable, one per file) to run an edited copy of the frozen file in place of it, after the format and static gates. A trial runs only as a host job requested from the stage's session; the operator's shell refuses it. A passing trial leaves a receipt for the head commit and the replacement's bytes, and loom stage dispute-contract refuses a replacement without one. The adjudicator sees the trial result and the assertions the replacement drops or changes.

Verification Is Enforced, Not Self-Reported

loom stage complete is the only way a stage finishes, and it runs the acceptance criteria itself before doing anything else. If they fail, the stage stays Executing — the agent must fix the work and re-run, and fix_attempts is incremented so repeated failures surface rather than accumulate silently. after_stage checks then run post-acceptance, and goal-backward verification runs before the progressive merge. A passing criterion is cached against an exact fingerprint of its command and the tree's content, so an unchanged criterion is not re-run on the next attempt, including the completion that follows a commit of the tree loom check passed; --no-cache on loom check, or on loom stage complete from the operator's shell, forces a real run regardless and still stores its passes.

Checks for the same session, commit and tree join a running job when it covers the requested criteria. An uncovered selection waits behind it; waiting selections are combined, so a waiting reviewer can see failures from criteria another reviewer requested. Repeated calls follow their job until it finishes.

Artifact verification treats a stub as a failure: a file that exists but contains TODO, FIXME, unimplemented!, todo!, a bare pass, or raise NotImplementedError does not count as delivered.

Normal stage completion crosses a narrow control boundary. The stage runs one exact pinned loom stage complete <stage-id> command, which relays a non-extensible request to the daemon; the request cannot carry commands, paths, or bypass flags. The daemon runs the criteria in a host job under Loom's confinement and completes the stage itself. The command's first line is Host job: <state>: requested and pending (exit 0) are not results, so run it again; completed exits 0; failed, rejected and refused exit 1; stopped exits 4, also run again.

The three bypass flags — --no-verify, --force-unsafe, --assume-merged — are the operator's, and cost the operator nothing: loom stage complete <stage> --no-verify just works from your shell. It authorizes itself against .loom/work/admin.token, which you can already read and a sandboxed agent cannot (the sandbox binds the whole process tree, so a loom an agent spawns is denied the same read). The proof is still bound to the project, stage, action, and exact flag set, and consumed on first use — you simply never handle it.

The same applies to loom stop. Nothing asks a human to mint a credential they already hold; making them carry an HMAC between two commands added ceremony, not security.

loom stage admin-proof remains for the case it was actually built for: minting a narrowly-scoped capability for another process, which receives it through LOOM_ADMIN_PROOF. It takes the secret through LOOM_ADMIN_TOKEN and never reads the token file, so a caller that can invoke loom but cannot read that file gains nothing.

An agent that genuinely believes a criterion is wrong or impossible has a sanctioned path — loom stage dispute-criteria — rather than an incentive to weaken it.

Implementers Do Not Verify

In an orchestrated Loom stage, an implementing subagent compiles the files it wrote freely (cargo check, cargo build, cargo test --no-run, tsc --noEmit, <pm> run build) and runs the tests for the code it wrote and its module when it is confident the code is ready or the fix is correct, never the whole suite. Full test suites, cargo clippy, every cargo fmt form and repo-wide lint or typecheck runs belong to the stage's gate: in a standard stage the orchestrator runs loom check on the finished tree, and an integration-verify stage is exempt: its orchestrator and reviewers run the full suite through loom check integration-verify [--criterion <n>]. The orchestrator acts on the result: it delegates the fixes and commits.

This is enforced, not just advised: loom-hooks/subagent-verify-guard.sh (a PreToolUse:Bash hook) blocks project-wide verification — an unfiltered cargo test, cargo clippy, every cargo fmt form, make test, a whole-project tsc, lint and typecheck scripts — when the caller is detected as a subagent. Compile commands (cargo check, cargo build, cargo test --no-run, tsc --noEmit, <pm> run build) and scoped invocations pass, quoted mentions are ignored, and unrecognised commands are always allowed: a false block would strand a subagent mid-task. The main agent of a live loom standard stage is held to one rule: an unfiltered test suite of any runner loom has an adapter for (cargo test, cargo nextest run, go test, bun test, jest, pytest, rake test, sbt test and the rest) is refused, because the full suite runs only through loom check; filtered runs, builds, clippy, fmt and lint pass. The hook is installed globally, so it acts only when LOOM_MAIN_AGENT_PID names a live process-tree ancestor: an ordinary Claude Code session is never blocked.

Outside an orchestrated stage, operators and contributors run the native checks appropriate to their work; no Loom stage is required for verification.

Two things worth knowing:

  • One carve-out: integration-verify stages. That stage type is exempt from the test rule: its orchestrator and reviewers may run the full suite, always through loom check integration-verify [--criterion <n>], never a bare runner. The hook does not enforce that; it only lets those subagents through. The carve-out is read from the stage file and fails safe — an ambiguous or missing stage file means no relaxation.
  • There is deliberately no opt-out environment variable. An escape hatch would only serve to defeat the rule.

Bug-Fix Stages

A stage with bug_fix: true requires a regression_test block naming the test that pins the fix: file (path to the test, relative to working_dir) and optional must_contain (patterns the file's content must include). Verification checks the file exists and carries those patterns, so a bug-fix stage cannot complete on a fix with no test guarding the regression.

Disputes, Adjudication, and Amendments

loom stage dispute-criteria is how an agent challenges a criterion instead of quietly weakening it; --field wiring, --field wiring-tests or --field artifacts makes the index point into those lists instead of acceptance. The daemon moves the stage to NeedsAdjudication and spawns a real session — with the full tool surface, running the disputed criterion itself — to judge it; loom stage adjudicate records that session's verdict, and a stage's own worktree session is refused so it can never judge its own dispute.

A criterion that fails only because of where completion runs (no network, unreadable git metadata, the command timeout, a sandbox denial) is disputed, never blocked: --criterion-index repeats, so one filing names every such criterion. A credential, a host install or a decision only a person can make is not a dispute, and loom refuses a block while the latest loom stage complete shows a failing criterion; the agent runs loom stage block <stage-id> "<what is needed and why>". A block, the agent's or the operator's, retires the stage's live session, so the agent's later exit is not filed as a crash, and shows the reason in loom status.

A repository's own commit hooks run inside loom stage commit, and a refusal does not stop a filing. The refusal text tells the session to fix what the hook names (the hook outranks a plan instruction, and lowering or removing a ratchet-file entry is always allowed) and to dispute or block as usual. The verdict notices of one dispute round accumulate in the stage's feedback file for the next session, and the first filing of a later round clears it. An accepted contract replacement is written to the worktree uncommitted; the latest review round still covers it, so the session stages the file and commits without another review. loom plan verify --strict fails a criterion that negates a search over another command's output (! cargo test | rg -q FAILED), which passes whenever the command dies another way.

A verdict does one of three things: Accept patches the disputed list (acceptance, wiring or wiring_tests; an acceptance dispute may also patch wiring) and re-queues the stage; NeedsMoreEvidence appends the judge's questions to the next signal and re-queues, up to a capped number of rounds; Reject moves the stage to NeedsHumanReview. Every accepted amendment writes a numbered snapshot under .loom/work/plan_versions/ plus an audit row.

An adjudicator narrows a criterion (replaces it with one that selects fewer tests, or deletes it) only on a failing base run: loom check <stage-id> --criterion <n> --at-base runs the criterion against the stage's base commit and records the result, and an amendment without that evidence is refused. A narrowing names every test it leaves out in plan_patch.leaves_out (index, tests, runs_at, reason); runs_at is integration-verify, ci or nowhere. A test the stage itself adds is never narrowed. Each accepted leaves_out entry is recorded as a hand-off, and the integration-verify signal lists them under ## Handed-Off Tests (marked (unverified) when the base run did not count the failing tests), followed by ### Amendments with every amendment of the plan: the full-suite criterion runs the tests that can run there, and a failure among them is the stage's to fix or dispute. The completion summary repeats both: Adjudicators amended <n> checks in this plan. and Tests left out of a stage check: followed by one line per hand-off.

Version 2 plans add five more dispute kinds, each filed once per review round with several ids: dispute-findings (a judge rules each finding uphold, dismiss or defer to a dependent stage that is not yet finished; integration-verify never defers), dispute-contract (--contract <id> repeats: one filing names every contract with the same cause. Every change to a frozen file travels as a --replacement <frozen-file>=<path>, one per file, the complete replacement copied to $LOOM_SCRATCH_DIR and edited there, never the frozen file itself. The filing is refused while any frozen file in the worktree is edited, so restore it first with loom stage contracts restore. The judge reads each replacement and rules accept or reject on every contract. An accept must change something: a replacement it lets the daemon write (its own file's, or a harness file's), or the judge's contracts patch targeting it; a ruling that changes nothing is refused when recorded. A replacement is written into the worktree when every contract in its file is accepted, a harness replacement only when every ruling is accept, and the stage's whole frozen set is then re-frozen at bytes loom vetted: each written file at its replacement, every other recorded file at its frozen copy (put back if the worktree differs, a deleted harness file included), and only a new contract or harness file as the worktree holds it. A reject discards the replacement and leaves the worktree unchanged), dispute-integrity (Accept records the event as accepted at its current count or hash) and dispute-criteria --field impact-tests (for a failing impact-selected test selection the stage did not cause; Accept records the failure, and completion notes it while it fails no worse). A selection whose tests fail at the stage's merge base with at least as many failures counted is noted without a dispute; a build failure or unreadable output there still fails. The dispute names the ids (IT-<runner>:<package>) the last failing loom stage complete listed, and the judge reads loom's own record of those failures. freeze-refusal is filed by loom itself when a contract freeze is refused (the adjudicator may accept it with contracts, harness or acceptance patches). Each kind has its own budget of three disputes per stage.

When an accepted dispute-integrity or impact-tests dispute, or a findings verdict that upholds nothing, is the stage's last open dispute and the worktree is clean, the stage stays in NeedsAdjudication with no session. The daemon runs one completion job (VerdictComplete) on the committed tree, and loom status shows the stage adjudicating with no judge. A pass completes and merges the stage; a failure, a cancel or an interrupt re-queues it for a fresh session with the failures in its feedback. An operator-held stage is re-queued and stays held.

The plan-level adjudication.max_amendments_per_stage field bounds autonomous amendments per stage (default 10), so a multi-fix plan is not sent to a human part-way through. loom stage amend gives an operator the same audited path directly: it replaces, inserts, or deletes one element of a stage's acceptance, wiring, wiring_tests, contracts, harness, artifacts or reachable array, snapshotting and logging the change the same way. It is an operator command: it refuses to run in a stage session (LOOM_WORKTREE_PATH set), since a stage may not change its own checks.

Knowledge System

Loom's answer to "every session starts from zero" is a three-stage pipeline: capture during execution, distill at the end of a plan, retrieve cheaply forever after.

1. Capture — session memory

While a stage runs, its agents journal to .loom/work/memory/<stage-id>.md, one journal per stage:

loom memory note "gotcha: worktree exclude lives at <worktree>/.git/info/exclude, not <dir>/.git/..."
loom memory decision "centralized plan lookup in plan/parser" --context "avoids an orchestrator→commands layering violation"

Entries are typed (note, decision, change, question). The last ten entries of a stage's own journal are embedded in the recitation section at the end of every later ordinary signal for that stage (a re-spawn, a handoff successor), the position with the highest model attention. A recovery signal, written when a crashed, hung or retried session is recovered, carries no recitation, so a recovered session reads its journal with loom memory list --stage <stage-id>. Another stage's signal lists only the relevant findings of its accepted dependencies, in one capped Dependency Findings section, and its briefs boost the files those dependencies changed. Knowledge-distill curates every journal into doc/loom/knowledge/, which later plans read.

Memory is deliberately cheap and disposable. It is a working journal, not the deliverable.

2. Distill — memories become knowledge

A knowledge-distill stage runs at the end of a plan and performs the reduce step: it reads every stage memory, dedupes, and curates the survivors into permanent knowledge. Mistakes are rewritten as actionable prevention rules rather than anecdotes:

## [Short description]

**What happened:** ...
**Why:** [root cause]
**Prevention:** [how to detect it earlier]
**Fix:** [what to do instead]

Procedural noise ("spawned agents", "ran tests") and anything recoverable from git history is dropped. The stage starts from loom memory pending --group, which prints corrections first, sorted by target file and heading so each one is applied with replace-section, then mistakes, decisions and the rest; a mistake that repeats one already in the tree becomes a proposal for a hook or a loom plan verify check rather than another paragraph. Every entry ends with a loom memory resolve receipt. loom review turns the same memories into a human-readable code-review document.

3. Retrieve — a tiered base agents can afford to read

Knowledge lives in doc/loom/knowledge/ and is tiered: a generated INDEX.md (tier 0) maps the seven curated summary files (tier 1), which link out to per-category topic files (tier 2, e.g. architecture/merge-flow.md). Tier-1 files stay navigable summaries; detail lives in topics. The index is regenerated automatically on every knowledge write.

Reading protocol — agents read INDEX.md first for orientation, then the tier-1 summary for the area they are working in, then only the tier-2 topics they actually touch; a specific question is pulled with loom knowledge context --query, which returns the matching sections quoted. Inside a stage, the per-stage Knowledge Brief comes first. Loading the whole base defeats the point of tiering. Every session that starts inside a repository holding doc/loom/knowledge/INDEX.md also receives a one-paragraph pointer to it from the knowledge-orient.sh SessionStart hook, installed globally by loom init/loom repair --fix.

Writing protocol — when a tier-1 section grows past roughly 40 lines, move its body into a topic with loom knowledge update <category>/<slug> and leave a 2-4 line summary plus a relative link behind. Write the link as [Title](category/slug.md) in a tier-1 file: that is the tree's convention for references.

There is no aggregate line budget across the knowledge base. What matters is per-file size, and loom knowledge check --strict enforces it: a tier-1 summary is at most 250 lines with sections of at most 40, a tier-2 topic at most 400 lines with sections of at most 80, and the generated INDEX.md at most 16 KB. A tree that cannot clear those yet records its current issues once with --write-baseline and gates with --baseline, so only new issues fail. loom memory note refuses a mistake: note without a Prevention: and a stale-knowledge: note that does not name <file>#<heading> and a Correction:, so a correction can be applied mechanically.

Retrieval is deterministic and offline. loom knowledge context --query <text> returns a token-budgeted context pack: the tool chunks the curated prose, scores each chunk, fuses the per-channel rankings, and takes whole chunks in order until the budget is spent, always reporting what it left out. There is no embedding model, no network call and no randomness — a pack is a pure function of the bytes on disk and the query string, so the same query returns the same pack.

loom knowledge context --query "how does merge cleanup order work" --budget-tokens 3000
loom knowledge context --query "source graph coverage" --explain   # per-item scores and why each was selected
loom knowledge context --query "sandbox rules" --json              # machine-readable

Stage sessions do not have to ask. Signal generation embeds a per-stage Knowledge Brief built through the same single entry point, so what a stage receives at spawn and what you get from the CLI are produced identically. Loom records what each recipient was given, so a second retrieval in the same session skips what the first already quoted rather than repeating it.

--scope selects which channels to search: knowledge searches the curated prose, source searches the derived source graph of symbols extracted from the code, and all (the default) fuses both. The two are ranked separately — prose over chunk text, symbols over their scope and signature — and then fused, so one pack can mix curated prose with the exact symbols a query names. A symbol whose file the parser could not fully read is still returned, but without a high-confidence claim.

The source graph maintains itself. loom init and loom run publish a base layer for the current revision before anything else starts, and each stage's working-tree overlay is refreshed immediately before its signal is written — so a stage's brief describes the code as that stage will actually find it. Publication is advisory: when it cannot run, loom prints one line and carries on, because a missing graph must degrade retrieval rather than block a run. A base layer is keyed to a revision and so is never published from a dirty tree; there, loom knowledge sync builds a working-tree overlay instead and tells you which layer it wrote.

Codex's native PostToolUse:apply_patch hook records every patched path into the stage overlay, and its UserPromptSubmit hook uses the same retrieval entry point as Claude. Shell-based edits remain outside file-tool hook visibility and are reconciled by the next explicit graph refresh.

Run loom knowledge sync after editing knowledge outside the CLI; it reports whether both derived layers are current, naming the source-graph layer it produced — base, local-overlay or skipped, with the reason.

Bootstrapping and maintenance

Agents populate knowledge during orchestration: a knowledge-bootstrap stage writes CONTENT, while loom init scaffolds the directory automatically. loom knowledge sync rebuilds the derived retrieval artifacts.

Knowledge directories created before the hierarchy existed stay flat and keep working unchanged — neither reading nor updating migrates them behind your back. loom knowledge sync performs the opt-in upgrade, creating INDEX.md the first time it runs on a flat directory.

Knowledge writes are protected by the sandbox defaults: agents update knowledge through loom knowledge ..., never by editing the files directly.

Bootstrapping a repo not managed by loom

loom knowledge bootstrap [--structural-only] [--refresh] [--dry-run] [--model M] [--effort E] builds doc/loom/knowledge/ from scratch for a repository that has no loom plans — retrieval needs the directory to exist before sync/context can do anything. It runs a deterministic host phase (scaffold the tree, rebuild the catalog and source graph, partition the repo into directory clusters with content digests) followed by an interactive foreground Claude session that writes knowledge only through loom knowledge ..., then a host finalization that refreshes the index and writes a receipt.

  • --structural-only stops after the deterministic phase — no model session is launched.
  • --refresh narrows the work to clusters whose digest changed since the last receipt, any removed cluster, and any tier-1 file still at its template content; with nothing changed it prints knowledge is current and spawns nothing.
  • --dry-run prints the work plan and the exact claude command it would run, without spawning anything.
  • --model/--effort pick the model and effort for the semantic session, same values as elsewhere in loom.

The command refuses to run inside a stage session — knowledge stages (knowledge-bootstrap and knowledge-distill) write knowledge through loom knowledge update instead. The committed receipt doc/loom/knowledge/.bootstrap-receipt.json records one digest per cluster; commit it alongside the generated knowledge files so --refresh reports current across clones, not just locally.

Model Allocation

Every stage's main agent is an orchestrator; the model and effort it runs come from its stage type's default, which the operator can override:

Stage type Default model Default effort
standard sonnet high
knowledge opus medium
knowledge-distill sonnet high
integration-verify opus xhigh

Configure either default per stage type in the [models] section of ~/.loom/config.toml (user tier) or <repo>/.loom/work/config.toml (project tier, resolved per key — a project section that sets only one of these keys still lets the rest fall through to the user config):

# ~/.loom/config.toml or .loom/work/config.toml
[models]
standard_model = "sonnet"
standard_effort = "high"
knowledge_model = "opus"
knowledge_effort = "medium"
knowledge_distill_model = "sonnet"
knowledge_distill_effort = "high"
integration_verify_model = "opus"
integration_verify_effort = "xhigh"
code_reviewer_model = "opus"
code_reviewer_effort = "high"
contract_writer_model = "opus"
contract_writer_effort = "high"

A plan stage's model / reasoning_effort field overrides both config tiers for that one stage. standard_model/standard_effort set the orchestrator of standard (implementation) stages. code_reviewer_model/code_reviewer_effort are not a stage type: they set the model and effort of the loom-code-reviewer subagent, applied by the spawn guard to every loom-code-reviewer spawn and overriding a model the caller passes. contract_writer_model/contract_writer_effort set the model and effort of the contract test writer session; a plan stage's model/reasoning_effort do not apply to it. Merge and base-conflict sessions stay pinned at opus/high and adjudication keeps its own [adjudication] model; neither is configurable through [models].

The orchestrator decomposes the work, hands each subagent full context, then runs the gate and commits. In a standard stage the gate is the orchestrator's loom check, the only place the full suite runs, and a fix round re-checks with --criterion <n>; an integration-verify stage keeps its own gate. Either way the orchestrator owns the fixes and the commit. It makes a change itself only when that is cheaper than a spawn: at most 20 changed lines in at most 2 files it has already read, proven by one command; a fable session delegates even those. Implementation is delegated to as few subagents as the work allows, each spawned by agent type so the model choice is explicit:

Agent Model Use for
loom-software-engineer Sonnet (effort high) Pieces that need open-ended exploration or the initial iteration on failing tests, or too large to brief in detail
loom-software-developer Haiku (effort high) Extremely simple pieces, or ones with a highly detailed brief: feature code and unit tests
loom-codex-forwarder Codex GPT-6.1 Terra or GPT-6.2 Sol (GPT-6 Luna on explicit request) Codex lane, licensed only on stages listing codex in implementers and chosen per piece: Terra for well-specified implementation, integration tests, boilerplate, scaffolding and simple unit tests; Sol for a substantial well-specified unit or a Terra unit that failed once; Luna only when the user or plan asks
loom-senior-software-engineer Opus (effort medium) Architecture across modules, new algorithms, concurrency and distributed systems, security-sensitive code, bugs of unknown cause; a failed attempt is respawned at effort: high
loom-code-reviewer Opus Read-only code, security, and architecture review
loom-advisor Fable Diagnosis after an Opus implementer failed — advice returned, nothing written

loom-software-developer has the Skill tool and loads the skills its brief names. It is a default, not a proven saving: after a run that used it, read the Attribution section for its median first-request resident, then compare its whole cost per transcript with Haiku loom-software-engineer transcripts (divide each type's by_agent_model usage row by that row's transcripts, and count any task respawned at a higher tier against it). Route its work back to loom-software-engineer if the whole cost does not fall.

Fable-tier work — visual/UI design or extremely challenging algorithmic design — has no dedicated agent type; it is spawned with an explicit model override rather than relying on inheritance.

The loom-codex-forwarder row additionally depends on the codex CLI and its plugin's companion runtime being installed. loom run checks this at startup and prints an advisory warning if either is missing — it never blocks the run — and terra- and sol-tier work falls back to Sonnet and boilerplate and simple unit tests to Haiku for the duration; the stage signal states the fallback explicitly and does not spawn loom-codex-forwarder.

This is why savings come from delegation rather than downgrade: an untyped subagent inherits the spawning session's model, so the spawn guard denies it inside a stage and sets model: sonnet on it elsewhere. A failure against clear acceptance moves the work up one tier: Haiku to Sonnet, Sonnet to Opus at medium, Opus at medium to Opus at effort: high; Codex Terra to Sol, then Claude. Only after an Opus implementer fails at effort: high does loom-advisor diagnose, which is rare. loom usage attributes every transcript to its stage and every subagent to its requested model, from the worktree directory name and the spawn record when no hook ledger exists, so a misrouting shows in by_agent_model.

A stage omits model and reasoning_effort by default, so the stage type's configured default applies. Set either field only as a deliberate per-stage override (low, medium, high, xhigh, max for effort). ultracode: true licenses a stage for large multi-agent fan-out; it is per-stage opt-in so the cost decision stays explicit.

Native Codex workers

By default (codex.backend = native) a stage's main agent reaches Codex through relayed commands; codex.backend = legacy (loom config -k codex.backend legacy) selects the loom-codex-forwarder subagent instead. On the native lane the main agent starts each worker with loom subagents start, loom's daemon admits it and runs one supervisor per worker, and the worker's record lives under .loom/work/native-workers/. The worker runs codex app-server inside a bubblewrap boundary with its own pid namespace, no network except an allowlist proxy to the model provider, and a private Codex home, so no config.toml, rules, hooks or MCP servers from your own ~/.codex load. The worktree is writable except .loom, .git and .claude, so the worker cannot commit or change the repository's git state and cannot change .loom/; the instruction not to run git stays as a second layer, and no Loom or Claude hook runs for its commands. Briefs, model tiers, sizing rules, the cap of 6 workers per stage and the 1500000 ms deadline are the same as on the forwarder lane.

loom subagents start --provider codex --unit-id <unit> --brief <absolute path> --model <model> --effort xhigh
loom request status <id> --wait 90
loom subagents watch --worker codex:<unit> --timeout 3600
loom subagents result --worker codex:<unit>
loom subagents message --worker codex:<unit> --invocation <id> --delivery steer|next-turn --message-id <id> --text <text>
loom subagents cancel --worker codex:<unit> --invocation <id> --reason <text>

Only the stage's main agent can start, message or cancel a worker, and each of those commands runs alone in its own Bash call. While a worker of the stage runs, or its processes cannot be proven stopped, loom stage reset, retry (even with --force), skip, commit, loom check and loom stage complete are refused; an operator checks a worker with loom subagents status and, after inspecting the worktree, clears an unverified one with loom subagents release --stage <stage> --invocation <id>.

The native backend runs on Linux, where bubblewrap can create a pid namespace, and on macOS, where the worker runs under one Seatbelt profile (sandbox-exec) instead: the profile denies by default, grants the worktree and the worker's private temp directory and Codex home, denies writes to .git, .loom and .claude, and hides your own ~/.codex, .loom/work and the Cargo configuration files above the worktree. macOS has no pid namespace, so loom proves a worker's processes gone from the process table (its session, group and environment marker) rather than from a namespace, and a worker's session files move into your Codex sessions directory only after that proof, so its tokens count in the totals after the worker is released rather than while it runs. macOS qualifies the lane with three live probes (sandbox-exec runs, a payload is confined, and Codex honours a controlled CODEX_HOME); a Codex installed as a script wrapper, or running loom from inside another sandbox, fails them. Known macOS limits: Codex's auth copy is read-only, so a token refresh does not persist; there is no pseudo-terminal grant; worker suites that bind 127.0.0.1 fail by design. When the key is native and the host cannot run it, the stage signal reports the Codex lane as unavailable with the reason; it does not fall back to the forwarder; set codex.backend = legacy to use the forwarder lane. native is the default. loom's own tests drive it with a scripted peer, so on a new host check that codex --version is 0.169.0 (the version the protocol was measured against) and run one real job on a disposable worktree, confirming that the report arrives, git status shows only the briefed files, and loom usage attributes the thread.

Sandbox Configuration

Loom supports plan-level defaults plus stage-level overrides.

loom:
  version: 1
  sandbox:
    enabled: true
    auto_allow: true
    filesystem:
      deny_read:
        - "~/.ssh/**"
        - "~/.aws/**"
      deny_write:
        - "vendor/**"
      allow_write:
        - "src/**"
    network:
      allowed_domains: ["github.com", "crates.io"]
      additional_domains: []
      allow_local_binding: false
      allow_unix_sockets: []

Note: every stage's sandbox grants writes to doc/loom/knowledge/**, because the knowledge CLI runs inside it (sandbox/config.rs, apply_knowledge_write_grant); a deny_write entry for that path is ignored and loom plan verify warns about it, and in a worktree worktree-file-guard.sh blocks Write and Edit on knowledge files, so knowledge changes go through loom knowledge ... commands. Plan-configured excluded_commands are rejected because broad executable exemptions bypass the host sandbox. When sandboxing is enabled, generated settings use host denyRead rules for sensitive paths and failIfUnavailable: true; failure to write those settings blocks session spawn. Unit tests pin the generated policy and blocked-spawn behavior. Every session capsule also read-denies, for Bash and every command it starts, the common credential files (~/.netrc, ~/.npmrc, ~/.git-credentials, ~/.pypirc, and the gh, docker, kube and cargo token files), and ~/.codex/auth.json unless the stage licenses the codex lane; such a file fails to open. The file tools are outside that list: in a worktree worktree-file-guard.sh refuses paths outside it, and a checkout-rooted session's file tools are not checked against these files. The capsule also denies the tools that run outside the Bash sandbox: LSP, RemoteTrigger, CronCreate, PushNotification, and Workflow everywhere except the stage session of an ultracode stage. deny_read and deny_write entries holding ../ never reach the OS sandbox. A credentialed check of these denies against a live Claude Code session is the manual sandbox release checklist.

Command Confinement

The sandbox: block above bounds the agent session. A separate control bounds the commands loom itself runs from your plan — every acceptance criterion, setup command, truth check, wiring test and dead-code check:

loom:
  version: 1
  sandbox:
    command_confinement: confined # plan-level default; `inherit` to opt out

  stages:
    - id: build
      sandbox:
        command_confinement: inherit # per-stage override
Level Behavior
confined Default. The child process environment is cleared and rebuilt from a fixed allowlist
inherit The child inherits loom's ambient environment

Plans are trusted artifacts, but trusted is not privileged: under confined, a plan line cannot read GITHUB_TOKEN, AWS_* or ANTHROPIC_API_KEY merely because you started loom from a shell that had them. The allowlist carries what a build toolchain needs to find itself — HOME, PATH, USER, LOGNAME, CARGO_HOME, RUSTUP_HOME, locale and terminal variables, TMPDIR, the proxy variables and the CA-bundle locations (SSL_CERT_FILE, SSL_CERT_DIR, NIX_SSL_CERT_FILE). SSH_AUTH_SOCK is deliberately withheld, so an acceptance criterion that needs SSH auth fails by design rather than silently borrowing your agent.

What confinement adds. Under confined, loom also runs each plan-authored command inside an OS boundary it builds for that command: bubblewrap (bwrap, with --unshare-all) on Linux, sandbox-exec on macOS. Inside that boundary only the working tree, a private scratch directory and the stage's build-cache directory are writable (the scratch holds the command's TMPDIR and CARGO_HOME; the stage cache, one directory per stage under your user cache directory, holds the Go, npm, pnpm, yarn, bun, uv, pip, Maven, Gradle, ccache and sccache caches and is removed when the stage is merged), the runtime and compiler installation directories, your Go module, Maven, Gradle and ccache caches (read-only seeds) and the toolchains installed under your home directory are readable, and verification commands get no network. On macOS a confined command gets no loopback either unless the plan or stage sets sandbox.network.allow_local_binding: true, and a failed run that prints a refused-bind code (EADDRINUSE, FailedToOpenSocket) carries a note naming that opt-in. A toolchain under your home directory is readable through its PATH entry plus, when the parent of that bin directory has a recognised install layout (Go, a JDK, Node, Gradle, a CI tool cache) and no project files, the whole install; a PATH entry, seed or symlink that leads through a writable directory grants nothing, so one command cannot widen what the next may read. On macOS a confined command cannot run Gradle: even building in-process (loom sets GRADLE_OPTS=-Xmx1g), Gradle binds a UDP socket for every cache lock and talks to its workers over loopback TCP, which the boundary denies. Gradle works under bubblewrap on Linux. Verification commands run in a host job the daemon starts, in a boundary loom builds on both platforms. provision entries always run in a boundary loom builds, with network so they can fetch dependencies, whatever command_confinement says. A host without the facility fails the command before any repository code runs. command_confinement: inherit adds no command-level boundary: the command keeps loom's ambient environment and runs inside whatever sandbox the calling process already runs in (the daemon's, for a host job).

Session State Confinement

Every spawned session — stage, merge, base-conflict, adjudication — launches from a settings capsule that denies writes to .loom/, .claude/, .worktrees/, the hooks directories, git hooks and config, and the git administrative directories of other stage worktrees, regardless of the filesystem rules above.

A handful of commands still need to reach that state from inside a sandboxed session: loom memory ..., loom check, loom stage complete, loom stage contracts freeze, loom stage block, loom stage dispute-criteria, loom stage commit, loom handoff, loom stage merge --resolved, and loom worktree remove. Each writes a one-shot ticket instead, picked up by a PostToolUse relay hook and applied by the daemon at most once through a per-session ledger. loom request status <id> reports whether the daemon has applied a given ticket yet.

The daemon also refuses to merge, or hand to a conflict-resolution session, any branch whose diff touches .claude/, .mcp.json, .loom/, or the in-repo hooks directory — the stage moves to NeedsHumanReview naming the offending paths instead.

Signed Commits

A session does not run git commit. It stages its change and runs loom stage commit <stage-id> -m "<message>", which runs the project's pre-commit and commit-msg hooks inside the sandbox and relays the staged tree to the daemon. The session then waits for the outcome in its own next Bash call with loom request status <id> --wait 90. The daemon makes the commit outside the sandbox with plumbing only, using your git configuration, so with commit.gpgsign set the commit is signed even though ~/.gnupg stays unreadable to the session. Loom's own merge commits and the plan-completion commit are signed the same way. Merge-resolution sessions stage the merge with git merge --no-commit --no-ff <target> and commit it through the same command.

The daemon signs unattended, so the signer must work without a prompt:

  • gpg: run gpg-agent with a cached passphrase or a graphical pinentry. The agent forgets a cached passphrase after default-cache-ttl (600 s) of disuse and at most max-cache-ttl (7200 s) after first use, so raise both in gpg-agent.conf for a long run.
  • ssh: load the signing key into an ssh-agent reachable through SSH_AUTH_SOCK.
  • Put commit.gpgsign in a git config file, not in GIT_CONFIG_COUNT variables or git -c, which the daemon's environment does not see.

loom run refuses to start when commit.gpgsign is true and a probe signature fails, and it runs the probe twice: in your own environment and in the exact environment the daemon runs with. If a stage's commit later fails to sign, the stage is blocked: fix signing, then run loom stage retry <stage-id>. If loom's own merge commit fails to sign, the stage parks in NeedsHumanReview: fix signing, then loom stage human-review <stage-id> --approve.

Startup Checks and Stalled Stages

loom run checks what a run needs before it marks the plan in progress, and refuses with the reason when a check fails. Stage sessions must be logged in: loom runs claude auth status in the same stripped environment stage sessions receive, not in your shell, because a login your shell can see through $USER or the Keychain may be invisible to a session. A logged-out result refuses the run and says whether your own shell is logged in; an inconclusive probe warns and continues. Other checks cover the sandbox prerequisites, the git version, command confinement, signing (above), and whether the daemon's socket path fits the operating system's limit for Unix socket paths (the repository path must be short enough that .loom/work/orchestrator.sock stays under 104 bytes).

A stage whose session stops answering is first re-queued for a continuation session, at most twice. A stage whose session never started work (no tool call and no context recorded within its response budget) is parked at once, because a re-queue would repeat whatever stopped it, and the reason says to run claude /login when the login probe reports a logged-out CLI. Either way the stalled stage ends in NeedsHumanReview with its reason (the silence, the budget, the last pane lines) and a desktop notification. Fix the cause, then run loom stage human-review <stage-id> --approve, which resets the stall count and re-queues the stage. Raise subagent_timeout_secs on a stage that legitimately opens with a long foreground subagent or codex run, since it has no tool heartbeat until that call returns.

Permission Mode

All stages default to auto (agents auto-accept any action their heuristics deem safe, since loom stages run autonomously with no human to answer prompts; the sandbox deny/allow rules are the safety boundary). Override per-plan or per-stage to tighten control:

loom:
  version: 1
  sandbox:
    permission_mode: accept-edits # plan-level override

  stages:
    - id: my-stage
      sandbox:
        permission_mode: plan # stage-level override (takes precedence)

Valid values: auto (default), accept-edits, plan, default. bypass-permissions is rejected at init time.

Remote Control

Claude Code's --remote-control flag lets the loom orchestrator drive spawned Claude sessions programmatically. Loom enables it automatically when prerequisites are met — no configuration required.

Prerequisites (preflight check):

  • Claude version ≥ 2.1.51
  • Auth: a claude.ai login, read from claude auth status --json run in the environment stage sessions receive. A console (API key) login, a logged-out CLI and an inconclusive probe all disable Remote Control.

The flag exits non-zero when its prerequisites are not met, so loom never passes it blindly. When preflight fails, loom falls back silently to standard mode and prints a one-line advisory at orchestrator startup (e.g. ⚠ Remote Control disabled: <reason>).

Configuration — the [remote_control] section of .loom/work/config.toml carries a single switch:

# .loom/work/config.toml
[remote_control]
mode = "auto"   # default: enable whenever preflight passes
# mode = "off"  # never enable, regardless of preflight

Toggling mode takes effect on the next session spawn — no daemon restart needed.

Fast crashes — a session that crashes within 15 seconds of spawn while Remote Control is active disables Remote Control for the rest of that daemon run, logs it once, and retries the stage without the flag. Nothing is written to disk: a daemon restart tries Remote Control again from scratch. Set mode = "off" above to stop it from trying at all.

Session naming — every spawned session is named after its stage in the Remote Control UI: the stage name for stage sessions, and Merge: <stage name>, Base conflict: <stage name>, Knowledge: <stage name> for merge, base-conflict, and knowledge sessions respectively. Claude binaries whose --remote-control flag doesn't accept a name argument automatically fall back to the bare flag — detected via a one-time claude --help capability check, no configuration needed.

Terminal Sessions

Loom runs every orchestrated Claude Code session in its own detached tmux server, so it works the same locally, over SSH, on a headless Linux box and under WSL. tmux must be installed and on PATH. Without it loom run (background and --foreground) and any direct session spawn fail with Loom needs tmux on PATH to start sessions. Install tmux and retry.; loom init <plan> prints the same text as a warning and finishes. Plan verification, loom config, loom status and history keep working without tmux.

There is no terminal selector: loom init and loom run take no --backend, and loom config has no terminal key. A leftover terminal section in ~/.loom/config.toml or .loom/work/config.toml is ignored and can be deleted.

Upgrading from a release that opened native terminal windows: let running native-terminal sessions finish, stop the old daemon, install tmux, then start the new binary with loom run.

Running under WSL

WSL2 runs the published loom-linux-x86_64 binary unmodified — it is an ordinary glibc ELF, and git worktrees, the .loom/work/ Unix socket and PID liveness checks all behave as they do on native Linux.

A stock WSL install ships no Linux GUI stack, which is fine: sessions run in detached tmux servers. Install tmux and start the run:

sudo apt install tmux jq          # both required; ripgrep and fd are recommended
loom init doc/plans/PLAN-<name>.md
loom run

You watch the sessions from a Windows Terminal tab:

loom status --live       # live ledger dashboard
loom status --web        # browser dashboard: starts at 7373, then the next free port
loom attach              # tiled overview of every live session
loom attach <stage-id>   # attach to one stage

A run survives closing the window, and loom attach reconnects to one already in progress.

Two WSL-specific notes:

  • Keep the repository on the Linux filesystem (~/src/…), not under /mnt/c. Loom creates a worktree per parallel stage and the daemon polls stage files every 5s; 9p latency across the Windows drive makes both crawl.
  • ARM64 Windows has no published Linux ARM64 binary. Install the Rust toolchain inside WSL and build from source.

One tmux server per session

Loom does not put every stage in one shared tmux server. Each session gets its own server on its own socket, named loom-<session-id> under $TMUX_TMPDIR (else /tmp).

This is deliberate: a wedged or killed server takes down exactly one stage, instead of every stage running in parallel. Liveness is tracked from PID files rather than by asking tmux, because a tmux server whose agent process has died still reports the session as existing — which would hide the crash from loom's monitor and prevent the retry.

Attaching

loom attach              # tiled overview of every live session
loom attach <stage-id>   # attach directly to one stage's session

With no argument, loom attach builds a per-repo viewer window with one pane per live session, tiled. With a stage id it attaches straight to that stage. Both require a real terminal (a TTY). Detach with the tmux prefix then d (default Ctrl-b d); re-run loom attach to reattach. loom status --web --terminals enables the same view and control from the browser.

Panes in the overview are live, writable terminals, not read-only views: keystrokes go to the agent, and C-b x closes that stage's pane. Detach the normal way with C-b d.

Tmux unavailable

If tmux is not on PATH, loom run refuses to start; if it becomes unavailable mid-run, a spawn fails with the same error naming the fix.

Agent Teams (Experimental)

Loom enables agent teams in spawned sessions (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) and injects team-usage guidance into stage signals.

Use teams when work needs coordination/discussion across agents (multi-dimension review, exploratory analysis). Use subagents for independent, concrete file-level tasks.

State Layout

project/
├── .loom/
│   ├── work/                  # orchestration state (mode 0700)
│   │   ├── config.toml
│   │   ├── stages/
│   │   ├── sessions/
│   │   ├── signals/
│   │   ├── handoffs/
│   │   ├── memory/            # per-stage journals
│   │   ├── archive/
│   │   ├── crashes/
│   │   ├── logs/              # per-session captured stderr
│   │   ├── pids/
│   │   ├── wrappers/
│   │   ├── orchestrator.sock  # daemon IPC socket
│   │   └── orchestrator.pid
│   ├── memory/archive/        # state of completed plans
│   └── cache/                 # derived caches
├── .worktrees/
│   └── <stage-id>/            # one per stage; its .loom/work links to the main one
├── doc/plans/
└── doc/loom/knowledge/
    ├── INDEX.md            # generated tier-0 map
    ├── architecture.md     # tier-1 summaries
    ├── patterns.md
    ├── ...
    └── architecture/       # tier-2 topics, one directory per category
        └── merge-flow.md

Shell Completions

Loom provides context-aware tab completions for all commands, subcommands, flags, and dynamic values (stage IDs, plan files, session IDs, knowledge files).

Quick Install

loom completions --install

Auto-detects your shell from $SHELL and writes completions to the standard location:

Shell Install Path
Bash ~/.local/share/bash-completion/completions/loom
Zsh ~/.zfunc/_loom
Fish ~/.config/fish/completions/loom.fish

Follow the printed post-install instructions to activate (e.g., for zsh, ensure fpath=(~/.zfunc $fpath) appears before compinit in ~/.zshrc).

Manual Setup

You can also write the completion script to a file yourself:

# bash
loom completions bash > ~/.local/share/bash-completion/completions/loom

# zsh — ensure ~/.zfunc is in fpath (add before compinit in ~/.zshrc):
#   fpath=(~/.zfunc $fpath)
#   autoload -Uz compinit && compinit
mkdir -p ~/.zfunc
loom completions zsh > ~/.zfunc/_loom

# fish
loom completions fish > ~/.config/fish/completions/loom.fish

Migrating from Older Versions

Older versions of loom used clap_complete and required an eval line in your shell RC file that ran a subprocess on every shell startup. The new system writes a static script to disk and only calls loom at actual tab-completion time, which means faster shell startup and completions that work even before loom is in your PATH.

To check whether you need to migrate:

loom completions --migrate

This scans for two things:

  1. eval lines in RC files (.bashrc, .zshrc, etc.) like eval "$(loom completions zsh)" — these should be removed
  2. Stale completion files containing old clap_complete markers — these need to be regenerated

If issues are found, follow the printed instructions. Typically: remove the eval line from your RC file, then run loom completions --install to write the new file-based completion script.

What's Completed

  • Commands and subcommands (loom stage <TAB> shows all stage subcommands)
  • Flags (loom run --<TAB> shows available flags)
  • Stage IDs with smart filtering (loom stage complete <TAB> shows only executing stages)
  • Plan files, session IDs, knowledge files (including aliases like deps, tech)
  • Model names, trigger types, and more

License

MIT

About

A Rust-based agent orchestrator enabling a swarm of Claude Code instances building software.

Topics

Resources

Contributing

Stars

66 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages