Loading...
Loading...
Run a task in a loop until an exit condition is met. Use when the user says "loop", "loop this", "keep trying until", "babysit", "poll", or wants iterative autonomous execution.
npx skill4agent add getpaseo/paseo paseo-loop{ done: boolean, reason: string }done{ done: boolean, reason: string }donereason<previous-iteration-result>~/.paseo/loops/<loop-id>/
worker-prompt.md # worker prompt (live-editable)
verifier-prompt.md # verifier prompt (live-editable, only when verifier is used)
last_reason.md # latest iteration result
history.log # per-iteration records$ARGUMENTS/loop babysit PR #42 until CI is green, check every 5 minutes
→ worker-prompt: "Check the CI status of PR #42 using `gh pr checks 42`. Report done when ALL checks
have passed (no pending, no failures). If any checks are still running or have failed, report not
done and list which checks are pending or failing."
No verifier (self-terminating: the worker inspects CI and reports done when green)
sleep: 5m
archive: yes
name: babysit-pr-42
/loop implement the auth refactor from the plan in /tmp/plan.md
→ worker-prompt-file: /tmp/plan.md
verifier-prompt: "Verify every step of the plan was implemented. Check file changes, types, and
run `npm run typecheck` and `npm test`. Report each criterion individually with evidence."
name: auth-refactor
worktree: auth-refactor
/loop run the test suite until it passes
→ worker-prompt: "Run `npm test`. If any tests fail, read the failure output, investigate the root
cause in the source code, and fix it. Report done when `npm test` exits with code 0 and all
tests pass. Report not done if any test still fails, and explain which tests failed and why."
No verifier (self-terminating: worker reports done when tests pass)
name: fix-tests
/loop watch error rates after deploy, check every 10 minutes
→ worker-prompt: "Check the error rate for the canary deployment by running `./scripts/check-canary.sh`.
Report done when the error rate has been below 0.1% for at least 2 consecutive checks. Report not
done with the current error rate and trend."
No verifier (self-terminating: worker reports done when error rate is stable)
sleep: 10m
max-iterations: 30
archive: yes
name: canary-watch~/.claude/skills/paseo-loop/bin/loop.sh# Self-terminating: worker checks PR CI and reports done when all checks pass
~/.claude/skills/paseo-loop/bin/loop.sh \
--worker-prompt "Check CI status of PR #42 using gh pr checks 42. Report done when ALL checks pass. Report not done with a list of pending/failing checks." \
--name "babysit-pr" \
--sleep 5m \
--archive
# Worker + verifier: worker implements, verifier independently checks
~/.claude/skills/paseo-loop/bin/loop.sh \
--worker-prompt "Implement the auth refactor: ..." \
--verifier-prompt "Verify the auth refactor is complete. Run npm run typecheck and npm test. Check that all file changes match the plan. Report each criterion with evidence." \
--name "auth-refactor" \
--worktree "auth-refactor"| Flag | Required | Default | Description |
|---|---|---|---|
| Yes* | — | Prompt given to the worker each iteration |
| Yes* | — | Read the worker prompt from a file |
| No | | Worker agent ( |
| No* | — | Verification prompt for a separate verifier agent |
| No* | — | Read the verifier prompt from a file |
| No | | Verifier agent ( |
| Yes | — | Name prefix for agents |
| No | — | Delay between iterations (e.g. |
| No | unlimited | Safety cap on iterations |
| No | off | Archive agents after each iteration |
| No | — | Worktree name. Created on first use, reused after. |
| No | | Thinking level for worker |
--worker-prompt--worker-prompt-file--verifier-prompt--verifier-prompt-file| Parameters | Mode | Use case |
|---|---|---|
| Self-terminating worker | Worker does work and decides when done |
| Worker + verifier | Worker implements, verifier independently checks |
| Polling with self-termination | Periodic check until a condition is met |
| Periodic work + verifier | Periodic work with independent verification |
{name}-{N}babysit-1 # First iteration
babysit-2 # Second iteration{name}-{N}{name}-verify-{N}feat-1 # First worker
feat-verify-1 # First verifier
feat-2 # Second worker (with previous result context)
feat-verify-2 # Second verifier--worktree~/.claude/skills/paseo-loop/bin/loop.sh \
--worker-prompt "Implement the feature..." \
--verifier-prompt "Verify the feature works and typecheck passes" \
--name "feature-x" \
--worktree "feature-x"$ARGUMENTS--archivecodexclaude/sonnetloop.sh--verifier-promptnpm testnpm run typecheckGET /healthanynpm run typechecknpm test~/.claude/skills/paseo-loop/bin/loop.sh \
--worker-prompt "Use /committee to plan, then fix the provider list bug. The bug is..." \
--verifier-prompt "The provider list renders correctly and npm run typecheck passes" \
--name "provider-fix"/handoff a loop in a worktree to babysit PR #42