Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cursor avatar

Ralph Loop

  • 288 installs
  • 2.5k repo stars
  • Updated August 5, 2026
  • cursor/plugins

Run a persistent Ralph-style agent loop that keeps working a task until completion criteria are met, with checkpoints instead of one-shot codegen.

About

Cursor plugin skill implementing the Ralph loop pattern for autonomous coding: the agent re-enters work, re-reads context, and continues until acceptance checks pass—aimed at multi-step builds that fail with one-shot prompts.

  • Iterates until explicit done signals
  • Structures agent state across turns
  • Reduces partial implementations
  • Encourages verify-then-continue cycles
  • Fits long-horizon Cursor tasks

Ralph Loop by the numbers

  • 288 all-time installs (skills.sh)
  • Ranked #2,309 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cursor/plugins --skill ralph-loop

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs288
repo stars2.5k
Last updatedAugust 5, 2026
Repositorycursor/plugins

What it does

Run a persistent Ralph-style agent loop that keeps working a task until completion criteria are met, with checkpoints instead of one-shot codegen.

Files

SKILL.mdMarkdownGitHub ↗

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.

Related skills

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.