What’s in the box
| A judged loop | state a Goal, get Rounds driven to a settle — from the CLI, a schedule, or the typed API (Loop.define / loop.run / an event stream) |
| A separate judge | a read-only Verify agent judges every Round; only its verdict settles the Loop |
| State on disk | fresh context every Round, memory read back from disk — survives crashes and schedules |
| Declared guards | rounds / usd / timeout — tight by default; every ending is a typed Exit with its own exit code |
| One writer | the Lock (compare-and-set + heartbeat) makes any trigger cadence overlap-safe |
| Real schedulers | loop cron installs into crontab / launchd / Task Scheduler — or Modal in the cloud; no daemon, ever |
One Round, four beats
- Execute — an agent works toward the Goal inside the work tree (
./workspaceby default). - Handoff — the agent leaves a note for the next Round: what it did, what it believes is left.
- Verify — a separate agent, read-only by default, judges the work against the bar. Its
verdict is
ok, or not-ok with a mandatory reason, or a give-up when the Goal can never pass. - Persist — the verdict and the Round’s events land on disk (the Record and journal), so the next Round — or a crash, or next week’s scheduled run — picks up exactly here.
Why writer ≠ grader
An agent grading its own work passes it. loop.js separates the roles structurally: Verify runs with its own prompt, its own (cheaper, if you like) model, and read-only by default — the write tools are denied at the adapter, not by prompt discipline. It reads the Execute agent’s handoff digest first and escalates only when suspicious: inspecting the work tree, running the build, checking the transcript.No daemon
loop.js runs nothing in the background.loop run drives Rounds in the foreground and
exits; loop cron installs Entries into a real scheduler — crontab, launchd,
Task Scheduler, or Modal — and a fired Entry simply runs loop run again. State lives on
disk, so the loop is exactly as durable as your filesystem.
Quickstart
Scaffold a project and drive your first Goal to settled.
What is loop engineering
The practice loop.js is built for — and where it stands in it.