loop-init, loop-audit, loop-cost CLI patterns

Three starter CLI tools that turn loop design into a repeatable workflow: scaffold a loop with a goal, budget, and verify step; audit an existing loop design; and estimate cost before you run.

prompt
→ Claude Code
Starter CLI tools: `loop-init` scaffolds a loop (goal, budget, verify step), `loop-audit` reviews an existing loop design, `loop-cost` estimates spend before running. Cap the run at 25 iterations; leave remaining work for the next session.
claude-code

Implementation note

When to use: you or your team are designing loops often enough that ad-hoc prompt-writing is producing inconsistent quality, and you want loop design to be a repeatable workflow with a checklist. How it works: three starter CLI tools cover the lifecycle. loop-init scaffolds a new loop with the three elements every good one needs — a goal, a budget, and a verify step — so none get forgotten. loop-audit reviews an existing loop design against those same criteria. loop-cost estimates spend before you run, turning the budget conversation into a pre-flight check rather than a post-mortem. Safety: the value is process discipline rather than runtime enforcement — scaffolded budgets and pre-run cost estimates only protect you if the loop that actually runs honors them. Use these tools to design the loop, then carry the caps into the runner (turn limits, budget ceilings) where they are actually enforced.

Source: cobusgreyling/loop-engineering ↗graded C · 70/100 — how grades work →

More planning loops

Implement feature X autonomously

Loop/ralphGitHubB

Ralph runs until it outputs DONE, implementing the feature end-to-end over up to 20 iterations.

prompt
→ Claude Code
/ralph-loop "Implement feature X. Output DONE when complete." --completion-promise "DONE" --max-iterations 20
planningmedium risk

Ship GOALS.md phases 1-13

Loop/goalGitHubB

Implement each GOALS.md phase with tests and validation, committing and pushing after stable milestones until unblocked.

prompt
→ Claude Code
/goal Complete GOALS.md phases 1-13 in order. For each phase, implement the deliverables, add/update tests, run the common validation plus that phase's Automated QA, commit after the phase passes, and push after stable milestones. Preserve unrelated user changes. Stop only if blocked by missing credentials, external service access, or an explicit product decision that cannot be safely inferred Cap the run at 20 turns.
planninghigh risk

Execute roadmap phases to completion

Loop/goalGitHubB

Work through each phase in your roadmap, verify each one, run the final audit, and stop when all phases pass.

prompt
→ Claude Code
/goal "Execute all phases of <run-root /ROADMAP.md sequentially. Read <run-root /phases/phase-N.md for each phase; do the work; run mandatory commands; print SUPERGOAL PHASE VERIFY then SUPERGOAL PHASE DONE for each phase; follow the failure-recovery protocol in <run-root /PROTOCOL.md if any criterion fails. After the last phase, run the FINAL AUDIT in <run-root /PROTOCOL.md (re-verify against <run-root /ROADMAP.md; re-run aggregated mandatory commands; spot-check criteria; on gaps, write <run-root /phases/audit-fix-<round .md and execute inline). Only after AUDIT COMPLETE, print SUPERGOAL RUN COMPLETE. Done when SUPERGOAL RUN COMPLETE appears in the transcript with one SUPERGOAL PHASE DONE per phase, AUDIT COMPLETE printed before SUPERGOAL RUN COMPLETE, and no FAILURE HANDOFF or AUDIT HANDOFF this run