The elements of a loop
Every serious agent loop answers five questions:Where loop.js stands in the practice
The simplest loops — shell scripts and minimal runners in the ralph-loop tradition — re-prompt an agent with fresh context until a script check passes or a human stops it. That shape is powerful, and loop.js keeps its core insight (fresh context per iteration, state on disk). What loop.js adds is the verdict:- Writer ≠ grader. A self-grading agent passes its own work; the better the model, the more confidently it does so. Verify runs as a separate agent, read-only by permission — not by prompt discipline.
- Digest-first, escalate when suspicious. The judge reads the worker’s handoff digest and can escalate — inspect the work tree, run the build, read the transcript — instead of rubber-stamping a summary.
- A “not yet” must say why. The verdict’s
reasonis mandatory and feeds the next Round, so iteration converges instead of retrying blind. - Impossible is an answer. A Goal that can never pass settles as a give-up instead of burning budget to the cap.
- Guards, declared. Rounds, dollars, and per-Round wall clock bound the loop; a
schedule Entry declares its own lifetime (
--until settled | forever, capped).
Try it
Quickstart
From empty directory to a settled Goal.