This is an autonomous iteration system that feeds Claude its own output after each turn until a task is complete. You set a task prompt, an optional iteration limit, and a completion phrase (like "COMPLETE"), and Claude works on it in a loop, seeing its previous work each time. It writes state to a scratchpad file and won't exit until it honestly outputs the completion promise or hits the iteration cap. The workflow is clever but you'll want that max_iterations safety net because there's real risk of burning through tokens if the task is vague or the promise condition is poorly defined. Good for scaffolding projects or refactoring passes where you want hands-off iteration.
npx -y skills add cursor/plugins --skill ralph-loop --agent claude-codeInstalls into .claude/skills of the current project.
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.
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.md with 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.].
<promise>TEXT</promise> when the statement is completely and genuinely true.max_iterations as a safety net.completion_promise value in the YAML frontmatter if it contains special characters.Confirm the loop is active (prompt, iteration limit, promise if set), then start working on the task immediately.
juliusbrussee/caveman
mattpocock/skills
obra/superpowers
forrestchang/andrej-karpathy-skills
vercel-labs/skills