ralph-wiggum
Skill1 starsChanged 6 months agoMITView on GitHub
Iterative feedback loop commands
8 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- myths-labs/museedited, first seen Nov 6, 2026
- pfeff/claude-skillstheir own version, first seen Nov 1, 2026
- jkitchin/knowhowtheir own version, first seen Nov 1, 2026
- fstandhartinger/ralph-wiggumtheir own version, first seen Oct 8, 2026
- agrimsingh/ralph-wiggum-cursortheir own version, first seen Oct 8, 2026
- talgacapri/pm-ostheir own version, first seen May 23, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- myths-labs/muse★ 3898% same
Wrote their own version · 7
- agrimsingh/ralph-wiggum-cursor★ 496same name
- fstandhartinger/ralph-wiggum★ 301same name
- jkitchin/knowhow★ 45same name
- pfeff/claude-skills★ 4same name
- ai4brands-design/claude-skills★ 2same name
- nbirkner/digital-brain★ 0same name
- talgacapri/pm-os★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-developmentSkill
- agent-sdk-devSkill
- claude-opus-4-5-migrationSkill
- code-reviewSkill
- command-developmentSkill
- commit-commandsSkill
- explanatory-output-styleSkill
- feature-devSkill
- frontend-designSkill
- github-managementSkill
- hook-developmentSkill
- hookifySkill
- learning-output-styleSkill
- mcp-integrationSkill
- plugin-devSkill
- plugin-settingsSkill
- plugin-structureSkill
- pr-review-toolkitSkill
- security-guidanceSkill
- skill-developmentSkill
- writing-rulesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 7 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 52
Run tests and see failures
- Distinctive: line 61
Start a Ralph loop in your current session.
- Very specific: line 130
Always use --max-iterations as a safety net to prevent infinite loops on impossible tasks:
- Distinctive: line 150
Don't aim for perfect on first try.
- Distinctive: line 159
Keep trying until success.
- Very specific: line 188
Run help in coding assistant for detailed command reference and examples.
- Very specific: line 199
Check if .agent/ralph-loop.local.md exists using Bash: test -f .agent/ralph-loop.local.md && echo "EXISTS" || echo "NOT_FOUND"
- Very specific: line 204
Read .agent/ralph-loop.local.md to get the current iteration number from the iteration: field
- Very specific: line 205
Remove the file using Bash: rm .agent/ralph-loop.local.md
- Distinctive: line 234
Stop hook intercepts and feeds the same prompt again
- Distinctive: line 259
When you try to exit, stop hook intercepts
- Very specific: line 360
Read the loop state file .agent/ralph-loop.local.md to extract current iteration, max_iterations, and completion_promise.
- Very specific: line 361
If the task is finished, output the exact promise tag: <promise>COMPLETION_PROMISE</promise> and delete the state file using your bash tool.
- Very specific: line 362
If max_iterations > 0 and iteration >= max_iterations, output a completion/termination message and delete the state file.
- Distinctive: line 363
If the task is incomplete and iterations remain:
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ralph Feedback Loop
Overview
Ralph Wiggum Plugin
Implementation of the Ralph Wiggum technique for iterative, self-referential AI development loops in coding assistant.
What is Ralph?
Ralph is a development methodology based on continuous AI agent loops. As Geoffrey Huntley describes it: "Ralph is a Bash loop" - a simple while true that repeatedly feeds an AI agent a prompt file, allowing it to iteratively improve its work until completion.
The technique is named after Ralph Wiggum from The Simpsons, embodying the philosophy of persistent iteration despite setbacks.
Core Concept
This plugin implements Ralph using a Stop hook that intercepts Claude's exit attempts:
# You run ONCE:
/ralph-loop "Your task description" --completion-promise "DONE"
# Then coding assistant automatically:
# 1. Works on the task
# 2. Tries to exit
# 3. Stop hook blocks exit
# 4. Stop hook feeds the SAME prompt back
# 5. Repeat until completionThe loop happens inside your current session - you don't need external bash loops. The Stop hook in hooks/stop-hook.sh creates the self-referential feedback loop by blocking normal session exit.
This creates a self-referential feedback loop where:
- The prompt never changes between iterations
- Claude's previous work persists in files
- Each iteration sees modified files and git history
- Claude autonomously improves by reading its own past work in files
Quick Start
/ralph-loop "Build a REST API for todos. Requirements: CRUD operations, input validation, tests. Output <promise>COMPLETE</promise> when done." --completion-promise "COMPLETE" --max-iterations 50Claude will:
- Implement the API iteratively
- Run tests and see failures
- Fix bugs based on test output
- Iterate until all requirements met
- Output the completion promise when done
Commands
/ralph-loop
Start a Ralph loop in your current session.
Usage:
/ralph-loop "<prompt>" --max-iterations <n> --completion-promise "<text>"Options:
--max-iterations <n>- Stop after N iterations (default: unlimited)--completion-promise <text>- Phrase that signals completion
/cancel-ralph
Cancel the active Ralph loop.
Usage:
/cancel-ralphPrompt Writing Best Practices
1. Clear Completion Criteria
❌ Bad: "Build a todo API and make it good."
✅ Good:
Build a REST API for todos.
When complete:
- All CRUD endpoints working
- Input validation in place
- Tests passing (coverage > 80%)
- README with API docs
- Output: <promise>COMPLETE</promise>2. Incremental Goals
❌ Bad: "Create a complete e-commerce platform."
✅ Good:
Phase 1: User authentication (JWT, tests)
Phase 2: Product catalog (list/search, tests)
Phase 3: Shopping cart (add/remove, tests)
Output <promise>COMPLETE</promise> when all phases done.3. Self-Correction
❌ Bad: "Write code for feature X."
✅ Good:
Implement feature X following TDD:
1. Write failing tests
2. Implement feature
3. Run tests
4. If any fail, debug and fix
5. Refactor if needed
6. Repeat until all green
7. Output: <promise>COMPLETE</promise>4. Escape Hatches
Always use --max-iterations as a safety net to prevent infinite loops on impossible tasks:
# Recommended: Always set a reasonable iteration limit
/ralph-loop "Try to implement feature X" --max-iterations 20
# In your prompt, include what to do if stuck:
# "After 15 iterations, if not complete:
# - Document what's blocking progress
# - List what was attempted
# - Suggest alternative approaches"Note: The --completion-promise uses exact string matching, so you cannot use it for multiple completion conditions (like "SUCCESS" vs "BLOCKED"). Always rely on --max-iterations as your primary safety mechanism.
Philosophy
Ralph embodies several key principles:
1. Iteration > Perfection
Don't aim for perfect on first try. Let the loop refine the work.
2. Failures Are Data
"Deterministically bad" means failures are predictable and informative. Use them to tune prompts.
3. Operator Skill Matters
Success depends on writing good prompts, not just having a good model.
4. Persistence Wins
Keep trying until success. The loop handles retry logic automatically.
When to Use Ralph
Good for:
- Well-defined tasks with clear success criteria
- Tasks requiring iteration and refinement (e.g., getting tests to pass)
- Greenfield projects where you can walk away
- Tasks with automatic verification (tests, linters)
Not good for:
- Tasks requiring human judgment or design decisions
- One-shot operations
- Tasks with unclear success criteria
- Production debugging (use targeted debugging instead)
Real-World Results
- Successfully generated 6 repositories overnight in Y Combinator hackathon testing
- One $50k contract completed for $297 in API costs
- Created entire programming language ("cursed") over 3 months using this approach
Learn More
- Original technique: https://ghuntley.com/ralph/
- Ralph Orchestrator: https://github.com/mikeyobrien/ralph-orchestrator
For Help
Run help in coding assistant for detailed command reference and examples.
Commands / Workflows
Command: cancel-ralph
Description: Cancel active Ralph Wiggum loop
Cancel Ralph
To cancel the Ralph loop:
- Check if
.agent/ralph-loop.local.mdexists using Bash:test -f .agent/ralph-loop.local.md && echo "EXISTS" || echo "NOT_FOUND" - If NOT_FOUND: Say "No active Ralph loop found."
- If EXISTS:
- Read
.agent/ralph-loop.local.mdto get the current iteration number from theiteration:field - Remove the file using Bash:
rm .agent/ralph-loop.local.md - Report: "Cancelled Ralph loop (was at iteration N)" where N is the iteration value
- Read
Command: help
Description: Explain Ralph Wiggum technique and available commands
Ralph Wiggum Plugin Help
Please explain the following to the user:
What is the Ralph Wiggum Technique?
The Ralph Wiggum technique is an iterative development methodology based on continuous AI loops, pioneered by Geoffrey Huntley.
Core concept:
while :; do
cat PROMPT.md | coding-assistant --continue
doneThe same prompt is fed to Claude repeatedly. The "self-referential" aspect comes from Claude seeing its own previous work in the files and git history, not from feeding output back as input.
Each iteration:
- Claude receives the SAME prompt
- Works on the task, modifying files
- Tries to exit
- Stop hook intercepts and feeds the same prompt again
- Claude sees its previous work in the files
- Iteratively improves until completion
The technique is described as "deterministically bad in an undeterministic world" - failures are predictable, enabling systematic improvement through prompt tuning.
Available Commands
/ralph-loop <PROMPT> [OPTIONS]
Start a Ralph loop in your current session.
Usage:
/ralph-loop "Refactor the cache layer" --max-iterations 20
/ralph-loop "Add tests" --completion-promise "TESTS COMPLETE"Options:
--max-iterations <n>- Max iterations before auto-stop--completion-promise <text>- Promise phrase to signal completion
How it works:
- Creates
.agent/.ralph-loop.local.mdstate file - You work on the task
- When you try to exit, stop hook intercepts
- Same prompt fed back
- You see your previous work
- Continues until promise detected or max iterations
/cancel-ralph
Cancel an active Ralph loop (removes the loop state file).
Usage:
/cancel-ralphHow it works:
- Checks for active loop state file
- Removes
.agent/.ralph-loop.local.md - Reports cancellation with iteration count
Key Concepts
Completion Promises
To signal completion, Claude must output a <promise> tag:
<promise>TASK COMPLETE</promise>The stop hook looks for this specific tag. Without it (or --max-iterations), Ralph runs infinitely.
Self-Reference Mechanism
The "loop" doesn't mean Claude talks to itself. It means:
- Same prompt repeated
- Claude's work persists in files
- Each iteration sees previous attempts
- Builds incrementally toward goal
Example
Interactive Bug Fix
/ralph-loop "Fix the token refresh logic in auth.ts. Output <promise>FIXED</promise> when all tests pass." --completion-promise "FIXED" --max-iterations 10You'll see Ralph:
- Attempt fixes
- Run tests
- See failures
- Iterate on solution
- In your current session
When to Use Ralph
Good for:
- Well-defined tasks with clear success criteria
- Tasks requiring iteration and refinement
- Iterative development with self-correction
- Greenfield projects
Not good for:
- Tasks requiring human judgment or design decisions
- One-shot operations
- Tasks with unclear success criteria
- Debugging production issues (use targeted debugging instead)
Learn More
- Original technique: https://ghuntley.com/ralph/
- Ralph Orchestrator: https://github.com/mikeyobrien/ralph-orchestrator
Command: ralph-loop
Description: Start Ralph Wiggum loop in current session
Ralph Loop Command
Execute the setup script to initialize the Ralph loop:
"PLUGIN_ROOT/scripts/setup-ralph-loop.sh" $ARGUMENTSPlease work on the task. When you try to exit, the Ralph loop will feed the SAME PROMPT back to you for the next iteration. You'll see your previous work in files and git history, allowing you to iterate and improve.
CRITICAL RULE: If a completion promise is set, you may ONLY output it when the statement is completely and unequivocally TRUE. Do not output false promises to escape the loop, even if you think you're stuck or should exit for other reasons. The loop is designed to continue until genuine completion.
🔒 Ralph Self-Enforced Cognitive Loop
You are responsible for self-enforcing the Ralph feedback loop within this session:
- Read the loop state file
.agent/ralph-loop.local.mdto extract currentiteration,max_iterations, andcompletion_promise. - If the task is finished, output the exact promise tag:
<promise>COMPLETION_PROMISE</promise>and delete the state file using your bash tool. - If
max_iterations> 0 anditeration>=max_iterations, output a completion/termination message and delete the state file. - If the task is incomplete and iterations remain:
- Increment the
iterationcount in the state file using your bash tool or file edits. - Output a summary of progress and ask the user to reply to continue the loop (self-blocking exit pattern). Do NOT exit or close the task until complete.
- Increment the
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

