Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Super Ralph Wiggum - autonomous iteration loops with templates, PRD support, progress tracking, and browser testing. This skill should be used when running Claude Code in autonomous loops for test coverage improvement, PRD-based feature development, documentation generation, dataset creation, lint fixing, code cleanup, or framework migrations. Combines the plugin's in-session loop mechanism with specialized templates and best practices from Geoffrey Huntley, Ryan Carson, and AI Hero.
.claude/skills/majiayu000-super-ralph-wiggum/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 103% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 184% | 0% |
| case-13 | ✗→✓ | ▲ Improved | -16% | 0% |
Autonomous iteration loops for Claude Code. Run the same prompt repeatedly until task completion, with context persisting through files and git history.
> The agent chooses the task, not you.
You define the end state. Ralph figures out how to get there.
With multi-phase plans, a human writes a new prompt at the start of each phase. With Ralph, the agent picks what to work on next from your PRD. You describe the destination. Ralph navigates.
Based on AI Hero's definitive guide:
| # | Tip | Key Insight | |---|-----|-------------| | 1 | Ralph Is A Loop | Same prompt, multiple iterations | | 2 | Start HITL, Then AFK | Learn → Trust → Let go | | 3 | Define The Scope | Explicit stop conditions prevent infinite loops | | 4 | Track Progress | progress.txt bridges context windows | | 5 | Use Feedback Loops | Types, tests, linting as guardrails | | 6 | Take Small Steps | One logical change per commit | | 7 | Prioritize Risky Tasks | Architecture first, quick wins last | | 8 | Define Software Quality | Tell Ralph what kind of repo this is | | 9 | Use Docker Sandboxes | Essential for AFK safety | | 10 | Pay To Play | HITL still valuable without AFK | | 11 | Make It Your Own | Alternative loop types, task sources |
See @references/tips-and-tricks.md for detailed guidance on each tip.
To start a Ralph loop with a template:
Run the super-ralph-wiggum skill with the test-coverage template, max 20 iterationsTo start with a PRD file:
Run super-ralph-wiggum with feature-prd template using ./prd.json| Template | Use Case | Default Iterations | |----------|----------|-------------------| | test-coverage | Improve test coverage to target % | 30 | | feature-prd | Implement features from PRD file | 20 | | lint-fix | Fix all lint errors incrementally | 30 | | docs-generation | Generate documentation for modules | 25 | | dataset-generation | Generate training data samples | 50 | | migration | Migrate to new framework/version | 40 | | entropy-loop | Reverse software entropy (dead code, smells) | 30 | | duplication-loop | Eliminate duplicate code | 25 |
Use a pre-built template for common tasks:
Use super-ralph-wiggum with [template-name] template
Options: --max-iterations N, --browser (for UI verification)For structured feature development with task tracking:
Use super-ralph-wiggum with feature-prd template
PRD file: ./prd.jsonThe PRD file tracks features with passes: true/false. Loop completes when all features pass.
For interactive learning and pair programming:
Use super-ralph-wiggum with --once flag to [task description]Runs ONE iteration without looping. Great for learning how Ralph works.
For tasks not covered by templates:
Use super-ralph-wiggum with custom prompt:
[Your detailed task description with completion criteria]
Completion: Output <promise>COMPLETE</promise> when done
Max iterations: 15| Mode | How It Works | Best For | |------|--------------|----------| | HITL (human-in-the-loop) | Run once, watch, intervene | Learning, prompt refinement, risky tasks | | AFK (away from keyboard) | Run in a loop with max iterations | Bulk work, low-risk tasks, overnight runs |
The progression is simple:
For AFK, always cap iterations:
Ralph doesn't know if this is a throwaway prototype or production code. Tell it.
| Repo Type | What To Say | Expected Behavior | |-----------|-------------|-------------------| | Prototype | "Speed over perfection. Skip edge cases." | Takes shortcuts | | Production | "Must be maintainable. Follow best practices." | Adds tests, docs | | Library | "Public API. Backward compatibility matters." | Careful about breaking changes |
If the loop should maintain high code quality, specify it factually:
> Maintain existing code conventions and quality standards. > Each change should leave test coverage equal to or better than before. > Prefer incremental improvements over large rewrites.
Avoid motivational framing ("fight entropy", "be thorough")—Claude 4.6 already tends toward thoroughness and these amplify it into over-planning. Factual quality criteria are more effective.
Your instructions compete with your codebase. When Ralph explores your repo, it sees two sources of truth: what you told it to do and what you actually did.
If you write "never use any types" but Ralph sees any throughout your existing code, it will follow the codebase, not your instructions.
Claude learns patterns from the existing codebase. If the codebase uses any types throughout, the loop will follow that pattern regardless of instructions. Clean up the specific patterns you care about before running the loop.
When choosing the next task, Ralph should prioritize:
Fail fast on risky work. Save easy wins for later.
Use HITL Ralph for early architectural decisions—the code from these tasks stays forever. Save AFK Ralph for when the foundation is solid.
Loop runs inside your current Claude Code session using stop hooks:
Use super-ralph-wiggum with test-coverage template, max 20 iterationsLoop runs externally via bash script with Docker sandbox:
bash# Generate external script ./scripts/setup-ralph-loop.sh --template test-coverage --docker > run-ralph.sh chmod +x run-ralph.sh # Run in background ./run-ralph.sh 20 &
Essential for AFK safety: Docker sandboxes let Ralph edit project files and commit—but can't touch your home directory, SSH keys, or system files.
.claude/ralph-loop.local.mdprogress.txt in project root<promise>COMPLETE</promise> or PRD all-pass| Option | Description | Default | |--------|-------------|---------| | --template <name> | Use pre-built template | (required or custom prompt) | | --prd <file> | PRD file for task tracking | none | | --max-iterations <n> | Iteration limit | varies by template | | --completion-promise <text> | Custom completion phrase | COMPLETE | | --progress <file> | Progress file location | ./progress.txt | | --browser | Enable browser testing prompts | false | | --once | Single iteration (HITL mode) | false |
Tasks must fit in one context window. Break large features into atomic stories.
Always run typecheck + tests before committing. Templates enforce this.
For AFK (unattended) Ralph, always set --max-iterations. Infinite loops are dangerous with stochastic systems.
Vague tasks risk infinite loops. Be explicit about when to stop.
Previous iteration learnings persist in progress.txt. Templates auto-inject this.
Keep changes small and focused. Prefer multiple small commits over one large commit.
Use JSON for structured progress data (coverage percentages, feature pass/fail, migration counts). Use freeform text in progress.txt for observations and session learnings. Use git commits as checkpoints between iterations so each new context window can discover state from the filesystem.
For detailed guidance, read the reference files:
@references/tips-and-tricks.md - The 11 Tips expanded with AI Hero insights@references/prompt-patterns.md - 10 patterns for convergent prompts@references/prd-schema.md - PRD file structure and usage@references/cost-estimation.md - API cost guidelines@references/browser-testing.md - Dev-browser integrationImproves test coverage by:
/* v8 ignore */ for non-essential codeRead full template: @templates/test-coverage.md
Implements features from a PRD file by:
prd.json for highest-priority incomplete featurepasses: trueRead full template: @templates/feature-prd.md
Fixes lint errors by:
Read full template: @templates/lint-fix.md
Reverses software entropy by:
Read full template: @templates/entropy-loop.md
Eliminates duplicate code by:
Read full template: @templates/duplication-loop.md
Generates documentation by:
Read full template: @templates/docs-generation.md
Generates training data by:
Read full template: @templates/dataset-generation.md
Migrates codebase by:
Read full template: @templates/migration.md
To stop an active Ralph loop, delete the state file:
bashrm .claude/ralph-loop.local.md
Or wait for max iterations to be reached.
Based on the Ralph Wiggum technique by Geoffrey Huntley. Enhanced with learnings from Ryan Carson, Matt Pocock, and AI Hero.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 24,019 | 10,185 | -58% | 1 | 1 | 0% | 4,306 | 3,292 | -24% | 0 | 0 | — |
case-02 | fail→fail | 14,036 | 11,407 | -19% | 1 | 1 | 0% | 164 | 3,184 | +1841% | 0 | 0 | — |
case-03 | fail→fail | 11,471 | 14,704 | +28% | 1 | 1 | 0% | 963 | 3,187 | +231% | 0 | 0 | — |
case-04 | fail→pass | 29,626 | 8,018 | -73% | 1 | 1 | 0% | 3,645 | 3,401 | -7% | 0 | 0 | — |
case-05 | fail→fail | 23,349 | 19,296 | -17% | 1 | 1 | 0% | 2,927 | 6,005 | +105% | 0 | 0 | — |
case-06 | pass→pass | 10,898 | 8,492 | -22% | 1 | 1 | 0% | 878 | 3,473 | +296% | 0 | 0 | — |
case-07 | pass→pass | 14,400 | 17,549 | +22% | 1 | 1 | 0% | 2,133 | 4,784 | +124% | 0 | 0 | — |
case-08 | fail→pass | 43,824 | 3,015 | -93% | 1 | 1 | 0% | 2,207 | 3,291 | +49% | 0 | 0 | — |
case-09 | pass→pass | 25,139 | 16,216 | -35% | 1 | 1 | 0% | 2,499 | 4,660 | +86% | 0 | 0 | — |
case-10 | fail→pass | 42,020 | 23,712 | -44% | 1 | 1 | 0% | 2,916 | 5,931 | +103% | 0 | 0 | — |
case-11 | pass→pass | 24,772 | 7,564 | -69% | 1 | 1 | 0% | 4,104 | 3,407 | -17% | 0 | 0 | — |
case-12 | fail→pass | 66,794 | 12,386 | -81% | 1 | 1 | 0% | 1,449 | 4,116 | +184% | 0 | 0 | — |
case-13 | fail→pass | 25,002 | 2,481 | -90% | 1 | 1 | 0% | 3,945 | 3,316 | -16% | 0 | 0 | — |
case-14 | fail→fail | 19,725 | 16,819 | -15% | 1 | 1 | 0% | 2,197 | 4,218 | +92% | 0 | 0 | — |
case-15 | pass→pass | 16,724 | 7,965 | -52% | 1 | 1 | 0% | 1,852 | 3,257 | +76% | 0 | 0 | — |
case-16 | fail→pass | 23,650 | 17,184 | -27% | 1 | 1 | 0% | 3,137 | 5,000 | +59% | 0 | 0 | — |
case-17 | fail→pass | 21,243 | 11,708 | -45% | 1 | 1 | 0% | 2,457 | 4,047 | +65% | 0 | 0 | — |
case-18 | fail→pass | 32,401 | 7,074 | -78% | 1 | 1 | 0% | 5,194 | 3,209 | -38% | 0 | 0 | — |
case-19 | fail→pass | 31,280 | 7,325 | -77% | 1 | 1 | 0% | 4,067 | 3,321 | -18% | 0 | 0 | — |
case-20 | pass→fail | 11,831 | 12,337 | +4% | 1 | 1 | 0% | 1,981 | 4,434 | +124% | 0 | 0 | — |
case-21 | pass→pass | 16,461 | 18,803 | +14% | 1 | 1 | 0% | 2,910 | 5,396 | +85% | 0 | 0 | — |
case-22 | pass→pass | 15,555 | 7,326 | -53% | 1 | 1 | 0% | 1,958 | 4,300 | +120% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 17 counted toward the lift figure. The other 5 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +36 percentage points is the difference between those two pass rates over the 17 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.