loops!
BrowseSign in
Back to loops
Automation
manual
CursorClaude CodeCodex

Ralph Story Executor

Fresh-context loop: pick one incomplete story from prd.json, implement it, run backpressure checks, commit, and update progress before the next iteration.

1 copies · 1 installs · 16 views

by loops!

Use loop copies the kickoff. Share copies the loop link. Open in Cursor / Claude Code only pre-fill that prompt — they do not install hook files. Click Install files, extract the zip into your repo, then restart your agent. Full install guide

Sign in to save
Guardrails
Hardened
Anti-gaming rules
Rules the agent must follow so it cannot cheat the exit condition.
  • Do not modify the check command or exit criteria to force success
  • Do not skip, disable, or bypass checks to pass the exit condition
  • If stuck after several iterations, stop and report blockers instead of gaming metrics
How to run this loop
Includes install files
Run “Ralph Story Executor” in your agent
Deeplinks and “Open in Cursor” only paste the kickoff prompt. They do not install hook files — your agent cannot tell whether files are on disk until you add them yourself.

Two separate pieces

  • Kickoff prompt — tells the agent the goal, check command, exit condition, and how to self-pace between passes.
  • Install files — optional hooks under .cursor/ or .claude/ that fire on events (save, commit, etc.). You must download and extract these into your repo.
  1. 1

    Download and extract install files

    Click Install files on this loop, unzip, and merge into your project root so paths like .ralph/prd.json exist on disk.

    Restart Cursor or reload the Claude Code session so hooks are picked up. Until then, nothing is “installed” — the browser cannot write into your repo.

  2. 2

    Copy or open the kickoff prompt

    Use Use loop to copy the kickoff, or Open in Cursor / Open in Claude Code to pre-fill the prompt in that app. Those links only carry text, not hook files.

  3. 3

    Paste and let the agent self-pace

    Paste the kickoff into agent chat. The agent should run your check command between iterations and stop when the exit condition passes.

Full guide with Cursor /loop notes: How to install loops

manual trigger
Automation
Manual start
Read state
Implement one story
Run backpressure
Commit and record
All stories in prd.json have passes: true
Rendering diagram…
Steps
What the agent does on each pass.

1. Read state

Read .ralph/prd.json and .ralph/progress.md. Resume any story marked inProgress, else pick the lowest-priority story with passes: false.

2. Implement one story

Implement exactly one user story with minimal scope. Mark it inProgress in prd.json before coding.

3. Run backpressure

Run the project's test, lint, and build commands from AGENTS.md. Fix failures before committing.

npm test && npm run lint && npm run build

4. Commit and record

Commit with a story-scoped message. Set passes: true in prd.json and append learnings to progress.md.

Kickoff prompt
Copy this into your coding agent to start the loop.
Start the "Ralph Story Executor" loop.

Goal: every story in .ralph/prd.json has passes: true
Max iterations: 20
Between iterations run: npm test && npm run lint && npm run build
Exit when: no stories remain with passes: false (respond "ALL STORIES ARE COMPLETE")

Step 1: Read .ralph/prd.json and .ralph/progress.md. Pick one incomplete story, implement it, run backpressure checks, commit, update prd.json and progress.md, then stop this iteration.

Self-pace this loop. Each iteration does exactly one story. State lives on disk, not in chat history.

Related loops

Automation
manual
5 copies · 0 installs
When a check fails twice the same way, append a guardrail sign to .ralph/guardrails.md so the next iteration avoids repeating it.

Start the "Guardrails Learning Loop" loop. Goal: tests and lint pass without repeating prior failure patterns Max iterations: 12 Between iterations run: npm test && npm run lint Exit when: all checks pass Step 1: Read .ralph/guardrails.md, run checks, and if a failure repeats, add a sign before fixing. Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.

CursorClaude CodeCodex
ralph
guardrails
learning
by loops!
View