ralph-loop
Start a Ralph Wiggum autonomous task loop that keeps Claude working until a task is complete. Uses the Stop hook pattern to re-inject prompts when Claude tries to exit before finishing. Supports two completion strategies: promise-based (Claude outputs a completion token) and file-movement-based (task file moves to /Done). Use when a multi-step task requires Claude to iterate until completion, such as processing all items in /Needs_Action or generating a complete audit.
npx skills add majiayu000/claude-skill-registry --skill ralph-loop-gen-ai4-personal-ai-employee --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Ralph Wiggum Autonomous Task Loop Keep Claude working on a task autonomously until it reaches a defined completion state. ## How It Works 1. **Start**: Create a loop state file with the task prompt and completion criteria 2. **Iterate**: Claude works on the task 3. **Check**: At exit, the Stop hook checks if the task is complete 4. **Continue**: If not complete, the prompt is re-injected (up to max iterations) 5. **Done**: When complete (or max iterations hit), Claude is allowed to exit ## Two Completion Strategies ### Strategy 1: Promise-Based (Simple) Claude outputs `<promise>TASK_COMPLETE</promise>` in its response to signal completion. ``` Example task prompt: "Process all files in /Needs_Action. When all items are processed and moved to /Done, output: <promise>TASK_COMPLETE</promise>" ``` ### Strategy 2: File-Movement-Based (Gold Tier) The Stop hook watches for a specific task file to move to `/Done`. More reliable because completion is a natural part of the workflow. ``` Example: Start a loop watching for "TASK_20260223_inbox_sweep" in /Done When the file appears in /Done, the loop exits naturally. ``` ## Usage ### Start a Ralph Loop (Promise Strategy) ```python from ralph_
- How It Works
- Two Completion Strategies
- Strategy 1: Promise-Based (Simple)
- Strategy 2: File-Movement-Based (Gold Tier)
- Usage
- Start a Ralph Loop (Promise Strategy)
- Start a Ralph Loop (File Movement Strategy)
- Check Active Loops
- Stop Hook Configuration
- Security Notes
- Example: Complete Inbox Processing Loop
In Claude Code settings (settings.json or CLAUDE.md): Add stop hook: python src/ralph_loop.py ./vault
What does the ralph-loop skill do?
Start a Ralph Wiggum autonomous task loop that keeps Claude working until a task is complete. Uses the Stop hook pattern to re-inject prompts when Claude tries to exit before finishing. Supports two completion strategies: promise-based (Claude outputs a completion token) and file-movement-based (task file moves to /Done). Use when a multi-step task requires Claude to iterate until completion, such as processing all items in /Needs_Action or generating a complete audit.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill ralph-loop-gen-ai4-personal-ai-employee --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
