| name | goal-loop |
| description | Draft and explain persistent goal-loop prompts for long-running agent work with clear stop conditions. |
| category | agent-orchestration |
| risk | safe |
| source | community |
| source_repo | davidondrej/skills |
| source_type | community |
| date_added | 2026-07-07 |
| author | davidondrej |
| tags | ["goals","autonomy","planning"] |
| tools | ["claude","codex"] |
| license | MIT |
| license_source | https://github.com/davidondrej/skills/blob/main/LICENSE |
Agent /goal Loop
What /goal is
/goal is a slash command that turns an agent prompt into a persistent agent looping plan → act → test → review → iterate until a stop condition is met, the user pauses, or the token budget runs out. Internally called the "Ralph loop."
Agents with the /goal feature right now: Codex, Claude Code, and Hermes Agent.
Key difference from a normal prompt: when a turn ends but the goal isn't met, the agent auto-continues instead of waiting for input.
Lifecycle states: pursuing, paused, achieved, unmet, budget-limited.
When monitoring a running /goal, every check should include a one-line update to the user: what the agent is doing and whether it is on track. Keep it extremely concise.
Not: a budget command, a safety boundary, "run forever", or a replacement for /plan. It's a contract enforcer with a verification loop.
Requirements
- An agent with the
/goal feature — right now: Codex, Claude Code, or Hermes Agent
- The goals feature enabled in the agent's config
- Subscription auth — API-key auth does not work. A pro-tier plan is the realistic minimum for long runs.
When to Use it
Use only when all three are true:
- Task is >30 min of mechanical work.
- There's a verifiable stop condition (tests pass, coverage hit, eval ≥ X, build green).
- Repo is agent-ready (working build, decent tests,
AGENTS.md present).
Fits: migrations, coverage lifts, TDD feature builds, refactors with contract tests, prompt/eval optimization, deploy retry loops, bug-repro-then-fix.
Bad fits: exploratory work, vague "improve this", anything without a "done" definition, prod credentials, destructive shared-infra ops.
The 5-part contract (every goal needs this)
- Objective — one sentence, one concrete outcome.
- Constraints — what must NOT change (public API, files, libs, conventions).
- Validation command — the exact shell command that proves progress (, , etc.).