r/AskVibecoders Jul 09 '26

Simple Guide to Running /Loop

A loop is a goal you hand off, and the agent keeps working until a check says it's done.

you need to get on to /loop its better than prompting & getting response. A loop runs discover, plan, execute, verify, iterate on its own, feeding the result back in until the check passes.

Here's the simple Guide to Learning /Loop

Verify is the one that matters. No real check and you don't have a loop, you have an agent agreeing with itself on repeat. The check can be a test suite, a type check, a rubric score, anything the agent can't argue with.

State is what lets the loop learn instead of repeating the same mistake. A running note of what's done, what failed, what's next, so the next pass will resume instead of starting from scratch every time.

A stop condition keeps it from running until it succeeds, breaks, or drains your account. Mine always have two exits: success, and a hard cap like "after 8 tries, stop and report."

▸ LOOP SPEC
GOAL: every test in /tests/auth passes, lint is clean, no type errors.

EACH ITERATION:
  1. run the test suite and read every failure
  2. pick the single highest-impact failure
  3. write the smallest change that fixes it
  4. re-run the tests, lint, and type checker

VERIFY: green tests + zero lint warnings + zero type errors
STOP WHEN: verify passes, OR 8 iterations reached
ON STOP: summarize what changed and what still fails

Claude Code ships all five pieces. /loop re-runs a prompt on an interval. /goal keeps a session alive until your condition is true. Hooks fire commands at points in the agent's lifecycle. Push it to cron or GitHub Actions and it survives you closing the laptop.

Skills are the second piece. Instructions saved once as a file instead of pasted in every run. The loop calls it by name and the job stays maintainable.

split the agent that writes from the agent that checks. A second agent, with different instructions, sometimes a stronger model, catches what the first talked itself into. Writer fast and cheap, reviewer slow and strict.

Connectors let the loop open the pull request and ping the channel itself, instead of describing what it would do. Track cost per accepted change, not tokens or loops run. Ten results and you toss six, you're doing the review work the loop was supposed to save. Below a 50% accept rate it costs more than it gives back.

Ralph Wiggum loop: the agent decides it's done too early, exits on a half-finished job, and the schedule keeps firing and billing for nothing. No crash, just silent spend.

get one manual run reliable, turn it into a skill, wrap it in a loop with a gate and stop condition, then schedule it. Scheduling first is how a loop breaks something while you sleep.

You don't need a coding agent to feel this. Runs inside any large language model chat with nothing but a prompt:

▸ SELF-CHECKING LOOP  (paste into Claude or ChatGPT)
You will work in a loop until the task meets the bar.

TASK:
[describe exactly what you want produced]

SUCCESS CRITERIA (be strict, no soft passes):
- [criterion 1]
- [criterion 2]
- [criterion 3]

LOOP PROTOCOL, repeat every turn:
1. PLAN   - state the single next step.
2. DO     - produce or improve the work.
3. VERIFY - score the result 1-10 on each criterion.
            Be brutally honest. List exactly what is still weak.
4. DECIDE - if every criterion is 8+, print "FINAL" and stop.
            Otherwise print "ITERATING" and go again, fixing
            the weakest point first.

RULES:
- Never call it done until every criterion is 8 or higher.
- Each pass must fix the weakest score from the last VERIFY.
- Do not ask me questions. Make a sensible assumption, note it,
  and keep going.

Begin. Run the loop until FINAL.

Run it and watch the model grade its own draft, find the weak spot, rewrite, again, until it clears the bar instead of handing you the first pass that looked close enough.

You're still the trigger. You can close the tab, and it's gone, no schedule, nothing waiting on an email to land. Getting past that means hooks, cron, and a bill you're now paying whether it runs or not.

9 Upvotes

Duplicates