Skip to content
cursor avatar

Ralph Loop

Starts an iterative Ralph Loop that feeds the same task prompt back each turn until completion.

CCM score
58 of 100
skills.sh installs
1.1K
GitHub stars
20.2K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers setting up a self-referential development loop where the agent sees its own prior work on every iteration
  • Gathers the task prompt, an optional max_iterations cap (default unlimited), and an optional completion_promise string
  • Writes the loop state to .cursor/ralph/scratchpad.md with YAML frontmatter tracking the current iteration count
  • Enforces that a <promise> tag is emitted only when the stated completion is genuinely true, and recommends a max iteration limit

Install

$ npx -y skills add cursor/plugins --skill ralph-loop -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

Details

Repository
github.com/cursor/plugins
Category
Agent Workflow & Planning
First seen
Jun 23, 2026

Questions

What does the ralph-loop skill do?

The ralph-loop skill starts an iterative development loop where the same task prompt is fed back after every turn, so the agent sees its own previous work on each iteration. It writes a state file at .cursor/ralph/scratchpad.md that tracks the iteration count, an optional iteration limit, and an optional completion promise.

How do I install the ralph-loop skill?

Run npx -y skills add cursor/plugins --skill ralph-loop -y in your project. Once installed, asking the agent to run a ralph loop or start an iterative loop activates it.

Which other skills are in the same category as ralph-loop?

Ralph-loop sits in the Agent Workflow & Planning category, alongside grill-me, grill-with-docs, setup-matt-pocock-skills, grilling and prototype. It is specific to repeated autonomous iteration on one task until a completion condition is met.

Should I set a maximum number of iterations for ralph-loop?

Yes, the skill recommends setting max_iterations as a safety net. The default is 0, which means unlimited iterations, so a cap keeps the loop from running indefinitely.

More from cursor/plugins

All 93

Similar to Ralph Loop

More Agent Workflow & Planning