Runs autonomous iterative AI loops for requirements, planning, or building phases using structured prompts and fresh context per iteration.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install ralph-loops或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install ralph-loops⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/ralph-loops/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
> First time? Read SETUP.md first to install dependencies and verify your setup.
Autonomous AI agent loops for iterative development. Based on Geoffrey Huntley's Ralph Wiggum technique, as documented by Clayton Farr.
Script: skills/ralph-loops/scripts/ralph-loop.mjs Dashboard: skills/ralph-loops/dashboard/ (run with node server.mjs) Templates: skills/ralph-loops/templates/ Archive: ~/clawd/logs/ralph-archive/
---
Claude Code 2.1.29 has a critical bug that spawns orphaned sub-agents consuming 99% CPU. Iterations fail with "exit code null" on first run.
Fix: Downgrade to 2.1.25:
npm install -g @anthropic-ai/[email protected]
Verify:
claude --version # Should show 2.1.25
This was discovered 2026-02-01. Check if newer versions fix the issue before upgrading.
---
When running a Ralph loop, don't monitor it synchronously. The loop runs as a separate Claude CLI process — you can keep chatting.
❌ Wrong (blocks conversation):
Start loop → sleep 60 → poll → sleep 60 → poll → ... (6 minutes of silence)
✅ Right (stays responsive):
Start loop → "It's running, I'll check periodically" → keep chatting → check on heartbeats
How to monitor without blocking:
node ralph-loop.mjs ... (runs in background)process poll when asked or during heartbeatsThe loop is autonomous — that's the whole point. Don't babysit it at the cost of ignoring your human.
---
When human says:
| Phrase | Action | |--------|--------| | "Interview me about system X" | Start Phase 1 requirements interview | | "Start planning system X" | Run ./loop.sh plan (needs specs first) | | "Start building system X" | Run ./loop.sh build (needs plan first) | | "Ralph loop over X" | ASK which phase (see below) |
Don't assume which phase. Ask:
> "Which type of Ralph loop are we doing? > > 1️⃣ Interview — I'll ask you questions to build specs (Phase 1) > 2️⃣ Planning — I'll iterate on an implementation plan (Phase 2) > 3️⃣ Building — I'll implement from a plan, one task per iteration (Phase 3) > 4️⃣ Generic — Simple iterative refinement on a single topic"
Then proceed based on their answer:
| Choice | Action | |--------|--------| | Interview | Use templates/requirements-interview.md protocol | | Planning | Need specs first → run planning loop with PROMPT_plan.md | | Building | Need plan first → run build loop with PROMPT_build.md | | Generic | Create prompt file, run ralph-loop.mjs directly |
For simple iterative refinement (not full system builds):
/tmp/ralph-prompt-.md ```bash node skills/ralph-loops/scripts/ralph-loop.mjs \ --prompt "/tmp/ralph-prompt-
---
> "Human roles shift from 'telling the agent what to do' to 'engineering conditions where good outcomes emerge naturally through iteration." > — Clayton Farr
Three principles drive everything:
---
┌─────────────────────────────────────────────────────────────────────┐
│ Phase 1: REQUIREMENTS │
│ Human + LLM conversation → JTBD → Topics → specs/*.md │
├─────────────────────────────────────────────────────────────────────┤
│ Phase 2: PLANNING │
│ Gap analysis (specs vs code) → IMPLEMENTATION_PLAN.md │
├─────────────────────────────────────────────────────────────────────┤
│ Phase 3: BUILDING │
│ One task per iteration → fresh context → backpressure → commit │
└─────────────────────────────────────────────────────────────────────┘
Goal: Understand what to build BEFORE building it.
This is the most important phase. Use structured conversation to:
- What user need or outcome are we solving? - Not features — outcomes
- Each topic = one distinct aspect/component - Use the "one sentence without 'and'" test - ✓ "The color extraction system analyzes images to identify dominant colors" - ✗ "The user system handles authentication, profiles, and billing" → 3 topics
- One markdown file per topic in specs/ - Capture requirements, acceptance criteria, edge cases
Template: templates/requirements-interview.md
Goal: Create a prioritized task list without implementing anything.
Uses PROMPT_plan.md in the loop:
IMPLEMENTATION_PLAN.md with prioritized tasksUsually completes in 1-2 iterations.
Goal: Implement tasks one at a time with fresh context.
Uses PROMPT_build.md in the loop:
IMPLEMENTATION_PLAN.mdKey insight: One task per iteration keeps context lean. The agent stays in the "smart zone" instead of accumulating cruft.
Why fresh context matters:
---
project/
├── loop.sh # Ralph loop script
├── PROMPT_plan.md # Planning mode instructions
├── PROMPT_build.md # Building mode instructions
├── AGENTS.md # Operational guide (~60 lines max)
├── IMPLEMENTATION_PLAN.md # Prioritized task list (generated)
└── specs/ # Requirement specs
├── topic-a.md
├── topic-b.md
└── ...
| File | Purpose | Who Creates | |------|---------|-------------| | specs/*.md | Source of truth for requirements | Human + Phase 1 | | PROMPT_plan.md | Instructions for planning mode | Copy from template | | PROMPT_build.md | Instructions for building mode | Copy from template | | AGENTS.md | Build/test/lint commands | Human + Ralph | | IMPLEMENTATION_PLAN.md | Task list with priorities | Ralph (Phase 2) |
For Clawdbot systems, each Ralph project lives in :
...
安装 Ralph Loops 后,可以对 AI 说这些话来触发它
Help me get started with Ralph Loops
Explains what Ralph Loops does, walks through the setup, and runs a quick demo based on your current project
Use Ralph Loops to runs autonomous iterative AI loops for requirements, planning, or b...
Invokes Ralph Loops with the right parameters and returns the result directly in the conversation
What can I do with Ralph Loops in my product manager workflow?
Lists the top use cases for Ralph Loops, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/ralph-loops/ 目录(个人级,所有项目可用),或 .claude/skills/ralph-loops/(项目级)。重启 AI 客户端后,用 /ralph-loops 主动调用,或让 AI 根据上下文自动发现并使用。
Ralph Loops 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Ralph Loops 可免费安装使用。请查阅仓库了解许可证信息。
Runs autonomous iterative AI loops for requirements, planning, or building phases using structured prompts and fresh context per iteration.
Ralph Loops 属于「Product Manager」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my product manager tasks using Ralph Loops
Identifies repetitive steps in your workflow and sets up Ralph Loops to handle them automatically