Goal Loop

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

4,336 stars 628 forksAI, LLMs & Agents

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add davidondrej/skills --skill goal-loop
Manual install
git clone --depth 1 https://github.com/davidondrej/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/skills/goal-loop ~/.claude/skills/goal-loop

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 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. No minimum task duration applies.

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 4-part contract (every goal needs this)

1. **Objective** — one sentence, one concrete outcome.
Read the full skill on GitHub

Details

Skill name
goal-loop
Path
skills/goal-loop/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Goal Loop skill do?

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

How do I install the Goal Loop skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add davidondrej/skills --skill goal-loop. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Goal Loop popular?

It lives in davidondrej/skills, which has 4,336 GitHub stars and 628 forks.

Related skills

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.