loom run
Execute a Loom workflow and produce structured diagnostic artifacts (receipt + runtime logs). Every run — pass or fail — writes a receipt and a log directory so failures are deterministic to triage.
Synopsis
loom run --local --workflow .loom/workflow.yml
--local is required today. Remote execution is not yet available.
Requirements
--localflag: required for all runs in the current release.- Docker: jobs with an
image:field run inside Docker. The Docker daemon must be installed and reachable. See Docker provider. - Host shell: jobs without
image:run directly on your host shell. See Host provider.
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--local | bool | false | Run locally (required). Jobs with image: use Docker; jobs without use the host shell |
--workflow | string | .loom/workflow.yml | Path to the workflow YAML file |
--stream | bool | false | Stream job stdout/stderr to the terminal while executing |
--verbose, -v | bool | false | Print additional run metadata to the terminal |
--quiet, -q | bool | false | Print only minimal output; rely on receipts and log pointers for details |
--cache-diff | bool | false | Run twice (cache=off then cache=on) and quarantine cache-hit keys on mechanical divergence |
--docker-workspace-mount | string | ephemeral_volume | Docker workspace mount mode: bind_mount or ephemeral_volume. Overrides LOOM_DOCKER_WORKSPACE_MOUNT |
Output verbosity: --quiet, --verbose, --stream
These flags control terminal output only. Structured runtime logs are always written to .loom/.runtime/logs/<run_id>/ regardless of verbosity settings.
| Flag | Behavior |
|---|---|
| (default) | Standard output — job started/finished, status, receipt path |
--quiet | Minimal output — receipt path and final status only |
--verbose | Additional metadata (useful when you don't want to open runtime logs yet) |
--stream | Stream job stdout/stderr in real time (increases console volume substantially) |
Environment variables
| Variable | Values | Description |
|---|---|---|
LOOM_DOCKER_WORKSPACE_MOUNT | bind_mount, ephemeral_volume | Docker workspace mount mode. Overridden by --docker-workspace-mount flag |
Docker workspace mount resolution order
--docker-workspace-mountflag value (if set)LOOM_DOCKER_WORKSPACE_MOUNTenvironment variable (if set)- Default:
ephemeral_volume
Outputs
Every run produces two artifact types:
| Artifact | Location | Description |
|---|---|---|
| Receipt | .loom/.runtime/receipts/loom-run-local-<run_id>.json | Structured run metadata: status, exit code, command, logs pointer |
| Runtime logs | .loom/.runtime/logs/<run_id>/ | Per-job structured logs, manifests, and event streams |
| Job artifacts | .loom/.runtime/logs/<run_id>/jobs/<job_id>/artifacts/ | Files extracted from job workspaces when artifacts: is configured |
Runtime logs directory structure
.loom/.runtime/logs/<run_id>/
├── pipeline/
│ ├── summary.json # Overall pipeline status + exit code
│ └── manifest.json # Job pointers (find failing job here)
├── jobs/<job_id>/
│ ├── summary.json # Job-level status
│ ├── manifest.json # Step pointers (find failing step here)
│ ├── user/script/<NN>/
│ │ ├── summary.json # Step status
│ │ └── events.jsonl # Step event stream
│ ├── system/<section>/
│ │ ├── summary.json # System section status
│ │ └── events.jsonl # System event stream
│ └── artifacts/ # Extracted job artifacts (when configured)
└── events.jsonl # Legacy compatibility
Start at pipeline/summary.json, then follow pointers in pipeline/manifest.json to the failing job and step.
Exit codes
| Code | Meaning |
|---|---|
0 | All jobs succeeded |
1 | One or more jobs failed, or the run failed to start |
When --cache-diff is used, exit code 1 also indicates mechanical divergence between the cache-off and cache-on runs.
Output streams
| Stream | Content |
|---|---|
| stderr | Status messages, receipt path, loom run passed / error summary |
| stdout | (unused in normal operation) |
Example output
Successful run
loom run passed
receipt: .loom/.runtime/receipts/loom-run-local-1772050684042246000.json
Failed run
On failure, the receipt path is printed before the error so you always have a pointer to the full logs:
receipt: .loom/.runtime/receipts/loom-run-local-1772050684042246000.json
loom run: job "build" failed (exit code 2)
Examples
Run the default workflow
loom run --local
Run with streaming output
loom run --local --stream
Run a custom workflow with verbose output
loom run --local --workflow ci/nightly.yml --verbose
Run with bind mount workspace mounting
loom run --local --docker-workspace-mount bind_mount
Cache differential analysis
loom run --local --cache-diff
Runs the workflow twice (first with cache disabled, then with cache enabled) and compares outputs. If the cache-on run produces different results, affected cache keys are quarantined and the run exits non-zero.
Failure triage
When a run fails, distinguish between two failure types:
Provider / environment failure (Docker unavailable, image pull fails, permission errors):
- Open
.loom/.runtime/logs/<run_id>/pipeline/summary.json - Follow pointers in
pipeline/manifest.jsonto the failing job - Check
jobs/<job_id>/system/<section>/events.jsonl
User step failure (your script: returned non-zero):
- Open
.loom/.runtime/logs/<run_id>/pipeline/manifest.json - Find the failing job, open
jobs/<job_id>/manifest.json - Follow
failing_step_events_pathto the step'sevents.jsonl
For the full pointer-first triage flow, see the Diagnostics ladder.
Provider selection
loom run selects a provider per job based on the workflow definition:
Job has image: | Provider | Documentation |
|---|---|---|
| Yes | Docker | Docker provider |
| No | Host shell | Host provider |
Workflow-level caching (when configured) is documented at Cache.
Related commands
loom check— validate the workflow schema before runningloom compile— inspect the compiled job graph without executing