loop-zero is a small command-line toolkit that takes a coding change from "start" to "merged" in six explicit steps: worktree, sandboxed checks, draft PR, one model review (independent by default), readiness, merge. Git, GitHub and CI are the delivery authority. Local task context, check receipts and saved review output are disposable working artifacts; the PR remains the delivery record.
It exists for people and coding agents who ship many small PRs and want the same discipline on every one of them: checks run in a sandbox with read-only Git metadata and no network by default, a reviewer reads the exact head (from a different family by default, subject to the contract's bounded owner-approved contributor-review exception), and a PR needs an eligible review, resolved blocking findings and green required CI to merge. The full rules fit in core/CONTRACT.md.
The architecture guide explains current boundaries, ownership and the contributor routine that keeps documentation current.
| Command | What it does |
|---|---|
loopzero start <slug> |
Create a worktree and branch from base; write the Context/Problem/Goal task template. |
loopzero check |
Run trusted-base checks with local bwrap or the configured runner. |
loopzero pr |
Push and open a draft PR from the task file, with its Validation section rendered. |
loopzero review |
Run one Claude or Codex review on the exact head; post it and append its summary under Review. Exits 0 on approval, 5 on changes requested. |
loopzero ready [--wait[=SECONDS]] |
Verify head, findings and CI; optionally wait for required checks on that head. |
loopzero merge [--wait[=SECONDS]] |
Recheck readiness and merge; optionally wait for required checks and landing before cleanup. |
For a picture of the whole flow, see the workflow diagrams.
loopzero status reports the branch stage and can exit 0 with ready: no.
It requires authenticated GitHub access even before a PR exists.
loopzero resolve lists the open blocking findings with their ids;
loopzero resolve <id> "<what changed>" replies in that thread and resolves it.
For agent delegation, follow model selection using the task repository's models.toml.
PR narrative and generated evidence follow the contract.
Check timings stay in terminal output; duration changes alone do not rewrite the
PR or retrigger policy CI. Keep human evidence outside the generated checks markers.
pr leaves the PR title unchanged. After creation, edit validation evidence on
GitHub; keep acceptance changes in both task.md and the PR by rerunning pr.
Review publication records duration and distinguishes requested model/effort from
CLI-reported claims, which are not backend attestation; saved artifacts preserve
them in .loopzero/review-<head12>-<kind>.json. loopzero review --repost uses
the saved review without a model call and rejects --model and --effort.
Waits observe immediately, then use 30/60/120-second intervals with up to 10%
earlier jitter, bounded by the timeout. Each readiness observation rechecks
reviews and findings. Mergify waits use REST for source-head guards, merge
observation, queue comments, PR lookup/detail and draft creation; native GitHub
queue membership and review threads use GraphQL. With ready --wait, a failed or
cancelled required Actions check may trigger a lookup for a newer active run on
that head; fine-grained tokens need Actions read permission.
Quota handling follows the contract's failure rules:
a GitHub rate-limit error stops the command without retry. REST and GraphQL have
separate primary budgets, shared by all sessions of one user. For an explicit
primary GraphQL limit, loopzero may make one bounded diagnostic query for a
verified reset time; it does not preflight requests or infer GraphQL capacity
from REST /rate_limit. See GitHub's rate-limit guidance.
- Set
shato the pinned commit SHA and runuv tool install "git+https://github.com/feder-positronics/loop-zero@$sha". - Copy workflow.example.toml to
workflow.tomlat your repo root and setrepo.name,checks.commandsandrequired_ci. Commit and pushworkflow.tomlto the configured remote base (origin/mainby default) before starting your first task. - Verify
git,gh auth status, and yourclaudeorcodexCLI. Run fresh local reviews and default checks on Linux withbwraponPATH. See SETUP.md. - Install the core/skills once per machine from a source
checkout at the same pinned revision as the CLI
(agent setup). Entry skills are
plan,implement,work-issueandwrite-design-doc; use the catalog's other methods as needed. Repositories keep no skill copies and customise throughAGENTS.mdand the docs it links. Optional TypeSafe guidance lives in integrations/typesafe-ai. - For integrations that need API keys, follow
credential setup. TypeSafe uses
TYPESAFE_API_KEYor~/.config/typesafe/api-key; no key is needed for loop-zero's ordinary checks. - Run
loopzero start first-taskandcdinto the worktree path it prints. Edit, commit, and run the remaining delivery commands from that worktree.
Delivery configuration lives in one file, workflow.toml, at the repository
root. The annotated workflow.example.toml documents its
keys; this repository's own workflow.toml is a working example.
Keep secret values out of it; API keys follow the
credential convention and setup.
Settings and semantics the example does not spell out:
| Key | Meaning |
|---|---|
checks.required_ci |
Names may be check runs or commit statuses; for each required name, the newest check run and the newest commit status, whichever exist, must succeed. |
checks.writable |
The forbidden-path rules from checks.ro_paths apply. |
checks.limits |
Local per-check resource limits applied with prlimit: memory_mb = 4096 (address space) and file_mb = 2048 (file size), capped at inherited hard limits. Overrides must be positive integers and require local execution without checks.runner. |
checks.env_allowlist |
Host environment variables passed into the sandbox. To forward a launcher-provided variable, append its name to [checks].env_allowlist in the base branch’s workflow.toml. An explicit list replaces the defaults (PATH HOME LANG LC_ALL TERM). |
delivery.review_chunk_bytes |
Diff chunk budget in UTF-8 bytes, at least 4096; default 200000. Oversized file patches split by lines; large deleted files are summarized. |
- No ledger, evidence store or run log. The PR is the record.
- No scheduler or daemon. Every command is invoked by you or your agent.
- No dashboard.
loopzero statusand GitHub are the UI. - No compatibility mode. There is one procedure, the current one.
- No signed evidence or attestations. Checks exit zero or they do not.
- No waivers or override files. Fix the finding or resolve the thread with a reason.
- Reviews run with network access because the model CLIs require it. The sandbox limits what they can read, but cannot limit what allowed data they send.
- core/CONTRACT.md — the delivery rules.
- core/HANDOFF.md — the task file and PR body template.
- core/skills/ — core agent skills and their routing.
- integrations/ — optional vendor integration skills.
- SETUP.md — install, configure, first run.
- docs/REWRITE-SPEC.md — contributor module map.
- docs/BACKLOG.md — a readable backlog: problems, goals, ongoing duties and one pinned "Work still to do" summary.
- docs/CODE-HEALTH.md — keeping a repository lean: recurring audits that report only new findings and never delete on their own.
MIT.
Third-party notices: THIRD_PARTY_NOTICES.md.