# goal-loop

> Claude/Codex skill by [@davidondrej](https://omgskills.com/library/davidondrej/index.md) · 4.2k stars · Updated 2026-10-28

Draft /goal prompts and explain persistent agent loops. Use for goal or Ralph loops, autonomous run setup, monitoring, and troubleshooting.

## Install

```sh
git clone https://github.com/davidondrej/skills /tmp/skills && ln -s /tmp/skills/skills/agent-orchestration/goal-loop ~/.claude/skills/goal-loop
```

## From README

Agent /goal Loop What /goal is /goal makes an agent persist through plan → act → test → review → iterate. If a turn ends before the goal is met, it auto-continues instead of waiting for input. The loop ends at its stop condition, a user pause, or the token budget limit. It is also called the “Ralph loop”. Before giving runtime instructions, check goal support in the installed agent and interface through its help, exposed tools, or current official documentation. Verify feature flags, authentication, and limits; do not transfer one agent's requirements to another. Lifecycle states, budgets, and pause/resume vary by runtime. A goal enforces a contract through verification. It is not a budget command, a safety boundary, “run forever”, or a replacement for /plan. When to use it Use for repeated autonomous work with a verifiable stop condition: passing tests, target coverage, eval ≥ X, or a green build. For code work, establish a working build and relevant checks first.

## Links

- HTML page: https://omgskills.com/library/davidondrej/skills/goal-loop/
- GitHub: https://github.com/davidondrej/skills
- Author: [@davidondrej](https://omgskills.com/library/davidondrej/index.md)

## More from this repo

- [anti-sleep](https://omgskills.com/library/davidondrej/skills/anti-sleep/index.md) — Keep a Mac awake for a set duration or while a process runs.
   - [@davidondrej](https://omgskills.com/library/davidondrej/index.md) · 4.2k stars
- [adr-verbatim](https://omgskills.com/library/davidondrej/skills/skills/thinking-and-docs/adr-verbatim/index.md) — Record concise ADRs that preserve the user's decisions without conversational noise.
   - [@davidondrej](https://omgskills.com/library/davidondrej/index.md) · 4.2k stars
- [ask-then-build](https://omgskills.com/library/davidondrej/skills/skills/thinking-and-docs/ask-then-build/index.md) — Clarify a feature, change, or refactor through questions, then write a build prompt for another agent.
   - [@davidondrej](https://omgskills.com/library/davidondrej/index.md) · 4.2k stars
