goal-loop
Helps your agent create and explain ongoing instructions for long tasks. Clearly defines when to stop working.
What it does
The `/goal` command turns a task into a continuous process that the agent handles on its own. It follows a cycle of plan, act, test, and review until the task is finished, the user pauses, or time/resources run out.
When to use it
- ✓When a task is expected to take over 30 minutes to complete.
- ✓When there's a clear way to verify if the task is done (e.g., tests pass).
- ✓When the project is already set up for automation (with tests and documentation).
Example of what to ask your AI
“Create a plan to migrate our project from Python 2 to Python 3, ensuring all tests pass and the public API remains unchanged.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The agent receives clear instructions on the objective, what not to change, how to check progress, and when to stop. It works in stages, reporting its actions, until the goal is met or human input is needed.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill goal-loopOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/goal-loop/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
/goalfeature — 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.mdpresent).
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 (
pytest -q,pnpm test, etc.). - Stop condition — verifiable: "Stop when X passes" OR "when further changes need human/product input."
- Documentation — one sentence instructing the agent to write concise, targeted docs for every change, either creating new
.mdfiles or updating existing ones.
Plus: tell the agent what to read first, ask it to work in checkpoints with a short progress log.
Writing a goal (the core deliverable)
When the user wants a quick /goal instruction, produce a structured markdown block with one line per contract item (proper newlines, not flowing prose). Do not prefix the output with /goal — the user adds the slash command themselves in the composer. Emit only the contract body. Template:
**Objective:** <one-sentence objective>
**Read first:** <files/PLAN.md/issue>
**Constraints:** <what not to change, libs, conventions>
**Validate:** `<exact command>` after each change
**Document:** Write concise, targeted documentation for all changes — create new `.md` files or update existing docs as needed.
**Checkpoints:** work in checkpoints and log progress briefly
**Stop when:** <verifiable condition>, OR when further changes require human/product input
Example (migration)
**Objective:** Migrate this project from Pydantic v1 to v2.
**Read first:** pyproject.toml, src/, tests/
**Constraints:** no public API changes; keep imports backwards-compatible via shims if needed; no new dependencies
**Validate:** `pytest -q` after each change
**Checkpoints:** work in checkpoints; log progress briefly
**Stop when:** full suite passes with zero deprecation warnings, OR when a change requires architecture decisions
Example (coverage lift)
**Objective:** Raise coverage in src/auth/ from ~38% to ≥75%.
**Read first:** src/auth/, tests/auth/, AGENTS.md
**Constraints:** no new deps; mirror existing test style; do not modify production code unless strictly required for testability
**Validate:** `pytest --cov=src/auth --cov-report=term-missing`
**Checkpoints:** work in checkpoints; log coverage delta each one
**Stop when:** coverage ≥75% AND all tests pass, OR when uncovered code needs design changes
Writing rules
- One objective, one stop condition. Not a backlog.
- Documentation is mandatory. Every
/goalprompt must include a single sentence committing the agent to concise, targeted docs — new.mdfiles or focused updates to existing docs.
…
FAQ
What is the 'Ralph loop'?
It's the internal name for the process `/goal` uses: plan, act, test, review, and repeat until the objective is achieved.
Can I use `/goal` for any task?
No, it's best for long, well-defined tasks with a clear 'done' criterion. It's not suitable for exploratory work or tasks without a defined endpoint.
What is a 'verifiable stop condition'?
It's a clear, objective rule that signals the end of the task, such as 'all tests have passed' or 'code coverage has reached X%'. Something measurable.
Details
Original description by the author
Draft and explain persistent goal-loop prompts for long-running agent work with clear stop conditions.
Popularity
- GitHub stars
- 48k
- Ranking position
- #3151
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
agent-architecture-audit
Makes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
affaan-m/ECC
agent-eval
Helps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
affaan-m/ECC
agent-harness-construction
Makes your agent better understand how to perform tasks. It optimizes the tools and instructions the agent uses to increase its chances of success.
affaan-m/ECC