| name | loom-usage |
| description | Meta-orchestration skill for Claude driving loom itself. Use when running plans, interpreting loom status, debugging failed or blocked stages, managing worktrees, recovering from crashes, and coordinating multi-stage execution. Do NOT use for writing plans (use loom-plan-writer) or wiring checks (use loom-wiring-test). |
| allowed-tools | ["Read","Grep","Glob","Bash","Edit","Write"] |
| triggers | ["loom run","loom init","loom status","loom stage","loom usage","run loom","execute plan","loom orchestration","loom debug","loom recover","stage failed","stage blocked","loom worktree","merge conflict loom","loom daemon","loom clean","loom repair","context exhausted","handoff","loom memory","loom knowledge","acceptance criteria failed","loom check","orchestrate","multi-stage","parallel stages"] |
Loom Usage — Meta-Orchestration for Claude
Overview
This skill enables Claude to drive loom itself — initializing plans, running
orchestration, monitoring execution, debugging failures, and recovering from
errors. This is meta-orchestration: Claude operating loom as a tool rather than
working inside a loom worktree as an agent.
When to Use
- Running a loom plan end-to-end
- Interpreting
loom status output and deciding next steps
- Debugging why a stage failed, is blocked, or has merge conflicts
- Recovering from crashes, context exhaustion, or corrupted state
- Managing worktrees, sessions, and daemon lifecycle
- Understanding
.work/ directory structure and signal files
Complementary Skills
| Skill | Use For |
|---|
/loom-plan-writer | Creating new plan files |
/loom-wiring-test | Designing wiring verification YAML |
/loom-before-after | Before/after delta-proof verification pairs |
/loom-dead-code-check | Dead code detection configuration |
| This skill | Everything after the plan is written |
The Loom Lifecycle
WRITE PLAN VALIDATE & INIT EXECUTE MONITOR & DEBUG
─────────────────── ─────────────────────── ────────────────── ──────────────────
/loom-plan-writer → loom init plan.md → loom run → loom status
loom repair --fix loom check
loom diagnose
loom stage retry
────────────────── ──────────────────
COMPLETE CLEAN UP
────────────────── ──────────────────
All stages merged → loom clean
Plan → DONE-PLAN-*
Phase 1: Validate & Initialize
Pre-Flight Checks
Before initializing, verify the workspace is healthy:
loom repair --fix
loom clean --all
Initialize a Plan
loom init doc/plans/PLAN-my-feature.md
What happens:
- Parses the plan markdown, extracts YAML metadata
- Validates all stages (IDs, dependencies, goal-backward fields)
- Creates
.work/ directory with stage files, config.toml
- Installs git hooks (commit guard, commit filter)
- Builds execution DAG, checks for cycles
Common init failures and fixes:
| Error | Cause | Fix |
|---|
| "must define acceptance criteria or ... artifact, wiring check, or wiring_test" | Standard/IV stage has no acceptance AND no goal-backward check | Add non-empty acceptance OR one of artifacts/wiring/wiring_tests/dead_code_check |
| "cycle detected" | Circular dependencies between stages | Remove the cycle in the dependency graph |
| "invalid stage_type" | PascalCase like "Standard" | Use lowercase: standard, knowledge, integration-verify, knowledge-distill |
| "working_dir required" | Stage missing working_dir field | Add working_dir: "." or appropriate subdirectory |
| "path traversal" | ../ in any path field | Use paths relative to working_dir, no ../ |
| "triple backticks in YAML" | Code fences inside description | Use plain indented text instead of fences |
| "bypass-permissions is not allowed" | permission_mode: bypass-permissions | Use auto (default), accept-edits, plan, or default. Note: loom plan verify misses this; only loom init catches it |
⚠️ truths was removed as a standalone field. Behavioral checks now go in acceptance (Simple string / Extended object); the goal-backward layers are artifacts, wiring, wiring_tests, dead_code_check. A leftover top-level truths: in an old plan is silently ignored (no error, no check) — migrate it.
Re-Initialization
loom clean --all
loom init doc/plans/PLAN-my-feature.md
loom init doc/plans/PLAN-my-feature.md --clean
Phase 2: Execute
Start Orchestration
loom run
loom run --max-parallel 2
loom run --manual
loom run --no-merge
loom run --foreground
What loom run does:
- Renames plan file:
PLAN-* → IN_PROGRESS-PLAN-*
- Spawns background daemon on Unix socket (
.work/orchestrator.sock)
- Daemon polls every 5 seconds:
- Loads stage files → builds execution graph
- Finds stages with all dependencies completed+merged
- Creates worktrees, generates signals, spawns Claude Code sessions
- Monitors sessions for crashes, context exhaustion, completion
- Auto-merges completed stages to main branch (progressive merge)
- When all stages complete → renames to
DONE-PLAN-*
Plan File Lifecycle
| State | Filename | When |
|---|
| Not started | PLAN-feature.md | After writing |
| Running | IN_PROGRESS-PLAN-feature.md | After loom run |
| Finished | DONE-PLAN-feature.md | All stages merged |
Phase 3: Monitor
Check Status
loom status
loom status --live
loom status --compact
loom status --verbose
Read the Execution Graph
loom graph
Status icons:
✓ Completed
● Executing
▶ Ready/Queued
○ WaitingForDeps
✗ Blocked
⟳ NeedsHandoff
⚡ MergeConflict
? WaitingForInput
⊘ Skipped
⚠ CompletedWithFailures
⊗ MergeBlocked
Interpret Status Output
When checking status, look for these patterns:
Healthy execution:
- Stages flowing left-to-right through the DAG
- Context usage < 60% (green)
- Sessions running with heartbeat
Warning signs:
- Context usage 60-75% (yellow) — handoff may be needed soon
- Stage stuck in Executing for a long time — check session liveness
- Multiple retries on same stage — investigate root cause
Failure indicators:
- Stage in Blocked state — read the block reason
- MergeConflict — needs manual resolution or retry
- NeedsHandoff — context exhausted, will auto-resume
- CompletedWithFailures — acceptance passed but with warnings
Phase 4: Debug & Recover
Stage Failed or Blocked
loom status --verbose
loom check <stage-id>
loom check <stage-id> --suggest
loom diagnose <stage-id>
Common Failure Scenarios
Acceptance Criteria Failed
The stage's acceptance commands returned non-zero.
loom stage verify <stage-id> --dry-run
loom stage retry <stage-id>
Debugging tips:
- Read stderr even when exit code is 0 — silent failures are common
- Check that
working_dir is correct (most common cause of "command not found")
- Verify paths are relative to working_dir (no double-paths like
loom/loom/src/)
Merge Conflict
Stage completed but merge to main failed.
loom stage merge <stage-id>
cd .worktrees/<stage-id>
git merge main
git add <resolved-files>
git commit -m "resolve merge conflict"
loom stage merge <stage-id> --resolved
Context Exhausted
Agent ran out of context window. Loom auto-creates handoff.
ls .work/handoffs/
loom resume <stage-id>
Session Crashed
Claude Code process died unexpectedly.
ls .work/crashes/
loom stage retry <stage-id>
loom stage retry <stage-id> --force --context "crashed during compilation"
Stage Stuck in Executing
Session appears alive but making no progress.
loom sessions list
loom sessions kill --stage <stage-id>
loom stage reset <stage-id> --kill-session
loom stage retry <stage-id>
Daemon Not Running
loom status
loom run
Phase 5: Manual Stage Management
Hold/Release Stages
Prevent a stage from auto-executing:
loom stage hold <stage-id>
loom stage release <stage-id>
Skip a Stage
Mark a stage as intentionally skipped (dependents will be blocked):
loom stage skip <stage-id> --reason "not needed for this iteration"
Force Complete
When a stage is functionally done but acceptance criteria are wrong:
loom stage dispute-criteria <stage-id> "criteria X is incorrect because..."
loom stage complete <stage-id> --force-unsafe --assume-merged
Pass Data Between Stages
loom stage output set <stage-id> api_port 8080
loom stage output get <dependency-stage-id> api_port
Memory & Knowledge Commands
During Knowledge-Bootstrap Stages
loom knowledge init
loom map --deep
loom knowledge check
loom knowledge update architecture "## New Section\n\nContent here"
loom knowledge update patterns - <<'EOF'
Uses JWT with refresh token rotation.
Key files: src/auth/jwt.ts:15-80
EOF
loom memory note "Found that auth uses middleware pattern"
loom memory decision "Using JWT over sessions" --context "Stateless scaling"
During Implementation Stages
ONLY use loom memory — NEVER loom knowledge update
loom memory note "observation about code"
loom memory decision "chose approach X" --context "because Y"
loom memory question "why is Z done this way?"
loom memory change "src/foo.rs - Added bar() function"
loom memory list
Memory & knowledge routing by stage type
| Stage type | loom memory | loom knowledge |
|---|
| knowledge (bootstrap) | YES | YES |
| standard (implementation) | YES (ONLY) | FORBIDDEN |
| integration-verify | YES (record findings for distill) | NO |
| knowledge-distill | YES | YES (curate from memory) |
Knowledge curation happens in the LAST stage (knowledge-distill), not in integration-verify. IV records discoveries to memory; distill reads them and writes knowledge.
loom memory note "IV: feature X reachable via CLI dispatch arm, confirmed end-to-end"
loom memory show --all
loom knowledge update mistakes "## Lesson learned about X"
loom knowledge update patterns "## New pattern discovered"
loom review
The .work/ Directory
Understanding .work/ structure is critical for debugging:
.work/
├── config.toml # Plan reference: source_path, base_branch, plan_id
├── stages/
│ └── NN-<stage-id>.md # Stage state (YAML frontmatter + markdown body)
│ # NN = topological depth (01, 02, etc.)
├── sessions/
│ └── <session-id>.md # Session tracking: PID, stage, status, context %
├── signals/
│ └── <session-id>.md # Agent task assignment (self-contained instructions)
├── handoffs/
│ └── <stage-id>-handoff-NNN.md # Context dumps for session continuity
├── memory/
│ └── <stage-id>.md # Stage-scoped memory journal
├── crashes/ # Crash reports for failed sessions
├── pids/
│ └── <stage-id>.pid # PID files for session tracking
├── wrappers/
│ └── <stage-id>-wrapper.sh # Session launcher scripts
├── orchestrator.sock # Unix socket for daemon IPC
├── orchestrator.pid # Daemon PID
└── merge.lock # Exclusive lock for progressive merges
Key rules:
- NEVER edit
.work/ files directly — use loom CLI commands
- Stage files use YAML frontmatter with status, timestamps, merged flag
- Signal files are self-contained — agents read ONLY their signal, not main repo
.work/ is gitignored and symlinked into each worktree
Worktree Model
Each executing stage gets an isolated git worktree:
PROJECT ROOT
├── .worktrees/
│ └── <stage-id>/ # Isolated copy of repo
│ ├── .work -> ../../.work # Symlink to shared state
│ ├── .claude/ # Worktree-specific hooks
│ ├── CLAUDE.md # Project instructions
│ └── <project files> # Full repo copy on loom/<stage-id> branch
├── .work/ # Shared orchestration state
└── <main repo files> # Main branch
Path resolution: EXECUTION_PATH = worktree_root + working_dir
If working_dir: "loom" and worktree is .worktrees/my-stage/, commands
execute from .worktrees/my-stage/loom/.
Daemon Architecture
The daemon (loom run) is a background process that:
- Listens on Unix socket (
.work/orchestrator.sock)
- Polls stage files every 5 seconds
- Creates worktrees for ready stages
- Spawns Claude Code sessions in terminal windows
- Monitors session health via heartbeat files
- Detects crashes via PID liveness checks
- Auto-merges completed stages (progressive merge)
- Handles retries with exponential backoff
IPC commands:
loom status → reads from socket (or files if daemon down)
loom stop → sends Stop message via socket
loom status --live → subscribes to streaming updates
Orchestration Decision Tree
Use this when deciding how to respond to loom state:
Is the plan initialized?
├── NO → loom init doc/plans/PLAN-*.md
└── YES
Is the daemon running?
├── NO → loom run
└── YES
Check loom status
├── All stages Completed → Done! loom clean (optional)
├── Stage Executing → Wait (or check context %)
│ ├── Context < 60% → Healthy, wait
│ ├── Context 60-75% → Watch closely
│ └── Context > 75% → Expect handoff soon
├── Stage Blocked → Investigate
│ ├── Read block reason from status --verbose
│ ├── Fix underlying issue
│ └── loom stage retry <id>
├── Stage MergeConflict → Resolve
│ ├── loom stage merge <id> (if transient)
│ └── Manual resolution in worktree
├── Stage NeedsHandoff → Resume
│ └── loom resume <id>
├── Stage CompletedWithFailures → Review
│ ├── loom check <id> --suggest
│ └── Fix and loom stage retry <id>
├── Stage WaitingForInput → Provide input
│ └── loom stage resume <id>
└── No stages ready, some WaitingForDeps → Wait for deps
Full Workflow Example
Claude orchestrating a complete loom run:
loom repair --fix
loom init doc/plans/PLAN-add-auth.md
loom run
loom status
loom graph
loom status --verbose
loom check failed-stage --suggest
loom stage retry failed-stage
loom stage merge conflicted-stage
loom resume exhausted-stage
loom status
loom clean --worktrees
Recovery Playbook
Corrupted .work/ State
loom repair --fix
loom clean --state
loom init <plan-path>
loom run
Orphaned Worktrees
loom worktree list
loom worktree remove <id>
loom clean --worktrees
Stuck Daemon
loom stop
kill $(cat .work/orchestrator.pid)
rm .work/orchestrator.sock
loom run
All Else Fails
loom clean --all
loom init doc/plans/PLAN-feature.md
loom run
Operator Gotchas
- The daemon loads the plan ONCE at startup. Editing the plan file (or a
.work/stages/*.md) while loom run is live has NO effect on the running graph — no reload mechanism exists. To apply plan changes, loom stop → edit → loom init --clean (or loom clean --state && loom init) → loom run. (Exception: the adjudicator may amend only a single stage's acceptance/wiring in place.)
- Exit code 0 ≠ success. Sandbox blocks, dep-fetch failures, and write denials all exit 0. Read stderr; "blocked / denied / connection refused / failed to download" means investigate, not proceed.
fix_attempts caps at 3 by default. After repeated acceptance failures a stage stops auto-retrying and escalates (Blocked / NeedsHumanReview). Don't loop loom stage retry blindly — read the block reason and fix root cause, or loom stage dispute-criteria if the criteria themselves are wrong.
- All four stage types default to
permission_mode: auto (resolves stage > plan > stage-type default). Loom stages run unattended, so the agent auto-accepts actions its heuristics deem safe; the sandbox deny/allow rules are the real boundary. Override to accept-edits/plan at plan or stage level to tighten.
loom plan verify checks STRUCTURE only — valid YAML/DAG/bookends. It does NOT run acceptance, prove claims, or (currently) catch bypass-permissions. A plan can pass plan verify yet fail loom init or produce a non-working feature.
loom check runs goal-backward layers (artifacts, wiring, wiring_tests, dead_code_check) — NOT acceptance. Use loom stage verify <id> --dry-run to test acceptance without changing state.
Anti-Patterns
| Anti-Pattern | Why It's Wrong | Do This Instead |
|---|
Editing .work/ files directly | Corrupts state machine | Use loom CLI commands |
Using target/debug/loom | Version mismatch | Use loom from PATH |
Running loom run on DONE-PLAN | Won't rename, confusing state | Clean and re-init first |
| Killing daemon with SIGKILL | Leaves orphaned worktrees | Use loom stop |
Skipping loom repair before init | Missing hooks, stale state | Always run repair first |
| Force-completing without investigation | Masks real failures | Use loom check --suggest first |
| Ignoring stderr on exit 0 | Silent failures propagate | Always check stderr output |
Quick Reference: Essential Commands
Lifecycle
loom repair --fix
loom init <plan>
loom run
loom status [--live|--verbose]
loom stop
loom clean [--all|--worktrees]
Stage Management
loom stage retry <id>
loom stage reset <id>
loom stage complete <id>
loom stage merge <id>
loom stage merge <id> --resolved
loom stage hold/release <id>
loom stage skip <id> --reason "..."
Debugging
loom status --verbose
loom check <id> --suggest
loom diagnose <id>
loom stage verify <id> --dry-run
loom graph
Memory & Knowledge
loom memory note "..."
loom memory decision "..." --context "..."
loom memory list
loom memory show --all
loom knowledge check
loom knowledge update <file> "..."
loom map --deep