mcpField
R
ralph-loop

ralph-loop

github.com/potetoAgent workflows12951 installsUpdated 21w ago
Repository

About ralph-loop

ralph-loop is a skill for starting an iterative development loop in which an agent receives the same task prompt after each turn. It records loop state and supports an optional iteration limit and completion promise.

Key features

  1. 01Create a loop state file
  2. 02Set an iteration limit
  3. 03Set an optional completion promise
  4. 04Feed the task prompt back after each turn

Use cases

  1. 01Run a task through repeated agent iterations
  2. 02Set a safety limit for iterative work

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/poteto/plugins --skill ralph-loop

After installing, type/ralph-loopin Claude Code to confirm it loaded.

Details

From the project README

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.

Comments

Markdown supported