ralph-loop
What it does
The skill starts an iterative loop where the agent keeps working on one task across many rounds. It is for people who want steady progress on a larger task without restarting it by hand.
When to use it
- ✓When you want the agent to keep iterating on one task until it reaches a goal.
- ✓When you want to set a maximum number of rounds for an autonomous task.
- ✓When you want the loop to stop once a specific completion phrase appears.
Skill link
https://github.com/cursor/plugins/blob/main/ralph-loop/skills/ralph-loop/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Start a Ralph loop to build a todo API with tests, and stop after 20 rounds.”
5 new skills a week. 1 minute to read.
How it works
The agent saves your task and loop settings in a state file, then works on the task. Each time it tries to stop, the same prompt is fed back, and it continues until the completion phrase or the round limit is reached.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Ralph Loop
Trigger
The user wants to start a Ralph loop. An iterative development loop where the same prompt is fed back after every turn, and the agent sees its own previous work each iteration.
Workflow
Gather the user's task prompt and optional parameters:
max_iterations(number, default 0 for unlimited)completion_promise(text, or "null" if not set)
Create the directory
.cursor/ralph/if it doesn't exist, then write the state file at.cursor/ralph/scratchpad.mdwith this exact format:--- iteration: 1 max_iterations: <N or 0> completion_promise: "<TEXT>" or null --- <the user's task prompt goes here>Example:
--- iteration: 1 max_iterations: 20 completion_promise: "COMPLETE" --- Build a REST API for todos with CRUD operations, input validation, and tests.Confirm to the user that the Ralph loop is active, then begin working on the task.
The stop hook automatically intercepts each turn end and feeds the same prompt back as a followup message. You will see it prefixed with
[Ralph loop iteration N.].
Guardrails
- If a completion promise is set, you may ONLY output
<promise>TEXT</promise>when the statement is completely and genuinely true. - Do not output false promises to escape the loop.
- Always recommend setting
max_iterationsas a safety net. - Quote the
completion_promisevalue in the YAML frontmatter if it contains special characters.
Output
Confirm the loop is active (prompt, iteration limit, promise if set), then start working on the task immediately.
FAQ
What happens if I do not set a maximum?
The default is no round limit, so the skill recommends setting one.
What is a completion phrase?
A phrase the agent outputs only when the task is truly complete, which ends the loop.
Can the agent fake the completion phrase?
No. The skill forbids outputting a false completion phrase just to leave the loop.
Details
Original description by the author
Start a Ralph Loop for iterative self-referential development. Use when the user asks to run a ralph loop, start an iterative loop, or wants repeated autonomous iteration on a task until completion.
repo: cursor/plugins
Popularity
- GitHub stars
- 15k
- Ranking position
- #11010
- License
- —
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
advisor
15kLets your agent consult a stronger second model at key checkpoints, such as before a big decision or when stuck on an error, if you turn it on.
check-agent-compatibility
15kRuns a full check of whether AI coding agents can start, verify and document a repository, and returns one compatibility score with the main issues.
cli-for-agents
15kTeaches your agent to design or review command-line tools so AI agents can run them without prompts, with clear help text and examples.
continual-learning
15kKeeps your AGENTS.md notes up to date by handing the work of reviewing past chats to a dedicated memory updater.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.