Goal And Loop
# `/goal` and `/loop` prompts (Claude Code)
Two related primitives, and the difference is the whole lesson:
- **`/loop`** re-runs a prompt on a **cadence** (close to cron).
- **`/goal`** runs until a **verifiable condition** is true, with a *separate*
model checking each turn whether you're done.
These are Claude Code's commands and syntax. Codex has a `/goal` command too, but
it's a standing target rather than a per-turn verifier, and it has no `/loop` —
its cadence comes from the Automations tab.
→ Background: [docs/05 — Stop Conditions & Verification](../docs/05-stop-conditions-and-verification.md).
> Every prompt here is written to copy and paste. Primary sources are linked
> inline where a specific claim or primitive depends on one.
---
## `/goal` — run until a condition is true
### The textbook stop conditionwhen to use it
Community prompt sourced from the open-source GitHub repo invincible04/awesome-loop-engineering (MIT). A "Goal And Loop" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
roleplaycommunitygeneral
source
invincible04/awesome-loop-engineering · MIT