Set up and configure Geoffrey Huntley's original Ralph Wiggum autonomous coding loop in any directory with proper structure, prompts, and backpressure.
A Claude Code skill that sets up Ralph Wiggum loops - Geoffrey Huntley's autonomous AI coding technique.
Ralph is an autonomous coding methodology where Claude runs in a loop:
while :; do cat PROMPT.md | claude -p --dangerously-skip-permissions; done
Each iteration:
The key insight: fresh context every iteration prevents hallucination accumulation and context poisoning.
tail -f ralph.log to watch progressIn Claude Code, run:
/setup-ralph
Then follow the prompts to configure:
your-project/
├── loop.sh # Main loop script
├── loop-docker.sh # Docker-wrapped loop (if selected)
├── Dockerfile # Container definition (if selected)
├── PROMPT_plan.md # Planning mode instructions
├── PROMPT_build.md # Building mode instructions
├── AGENTS.md # Operational learnings (you update this)
├── IMPLEMENTATION_PLAN.md # Task list (generated by planning)
├── specs/ # Your requirement docs go here
└── src/ # Code goes here
Direct mode:
./loop.sh plan # Generate implementation plan
./loop.sh # Build until complete
./loop.sh 20 # Build max 20 iterations
Docker mode (isolated):
./loop-docker.sh --build-image # First time only
./loop-docker.sh plan # Generate plan
./loop-docker.sh # Build in container
After each iteration, you'll see:
━━━ Iteration 5 Complete (2m 34s) ━━━
✅ Commit: abc1234 [city] Add procedural building generation
📁 Files: +2 new, ~3 modified
🆕 src/CityGenerator.ts
🆕 src/Building.ts
✏️ src/Game.ts
✏️ src/World.ts
📊 Progress: 5/22 tasks (23%)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Sit on the loop, not in it.
You:
specs/ (one file per topic)AGENTS.md with learningsYou don't:
When Ralph struggles repeatedly, update the environment (specs, AGENTS.md, prompts) rather than fixing code directly.
# Generate token
claude setup-token
# Save it
echo "sk-ant-oat01-YOUR-TOKEN" > ~/.claude-oauth-token
chmod 600 ~/.claude-oauth-token
The loop scripts automatically load this token.
Docker mode runs Claude in an isolated container:
--dangerously-skip-permissions)First time setup:
./loop-docker.sh --build-image
Then just run ./loop-docker.sh - switches seamlessly between Docker and direct mode.
Each spec file should pass the "one sentence without 'and'" test:
specs/authentication.md - "User login with credentials"specs/session-management.md - "Session lifecycle and validation"specs/user-system.md - "Auth AND profiles AND billing" (too broad)Include:
Based on Geoffrey Huntley's Ralph Wiggum technique.
MIT
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer