Skip to content
Skillpedia
Agents15k · #11010

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.md

Copy 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

Use this skill to help me: https://github.com/cursor/plugins/blob/main/ralph-loop/skills/ralph-loop/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

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

  1. Gather the user's task prompt and optional parameters:

    • max_iterations (number, default 0 for unlimited)
    • completion_promise (text, or "null" if not set)
  2. 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.
    
  3. Confirm to the user that the Ralph loop is active, then begin working on the task.

  4. 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_iterations as a safety net.
  • Quote the completion_promise value 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

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills