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
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.
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

More planning loops

Ralph the PRD backlog

The canonical Ralph loop: each iteration starts fresh, reads the PRD and guardrails, ships exactly one backlog item end-to-end, and records what it learned.

prompt
→ Claude
/loop start each iteration with fresh context: read PROMPT.md, prd.json, and .ralph/guardrails.md; pick the single highest-priority item in prd.json not marked done, implement it with tests, run the full check suite, commit and mark it done only if green; if blocked or a check fails twice the same way, append the lesson to .ralph/guardrails.md and move on; stop when every item is done or after 30 turns
planninghigh risk

Draft a sprint plan from the backlog

/goalloopreponew

Turn the open issue backlog into a proposed two-week sprint plan with estimates, a dependency ordering, and an explicit cut line, written as a document for the team to edit.

prompt
→ Claude
/goal SPRINT-PLAN.md contains a proposed 2-week plan — read all open issues labeled `ready`, estimate each as S/M/L based on the code it touches, order them by dependency and value, draw a cut line at a realistic capacity, and list what falls below it with reasons; make no changes to the issues themselves; stop after 6 turns
planninglow risk
1

Set agent continuation budget

/goalnew

Configure max turns before agent stops, preventing runaway loops and controlling execution cost.

prompt
→ Claude
/goal budget <n Set max continuation turns
planninglow risk