| name | ralph-wiggum |
| description | Use the Ralph Wiggum CLI for autonomous AI coding loops. Use when running ralph commands, setting up autonomous coding workflows, or managing AI agent loops for planning and building features. |
Ralph CLI
Ralph runs AI agents (Claude Code, Amp, Droid, OpenCode, Cursor, Codex, Gemini, Pi) in continuous loops until tasks are complete.
Task-first approach: Instead of giving agents autonomy to work through specs, Ralph decomposes specs into small tasks during planning, then feeds tasks to agents one at a time during building. Smaller tasks keep agents focused and out of the "dumb zone."
Installation
bun install -g ralph-wiggum-cli
Or with npm:
npm install -g ralph-wiggum-cli
Core Commands
ralph-wiggum-cli init
ralph-wiggum-cli plan
ralph-wiggum-cli build
ralph-wiggum-cli stop
ralph-wiggum-cli status
ralph-wiggum-cli agents
Project Structure
After ralph-wiggum-cli init, a .ralph-wiggum/ directory is created:
.ralph-wiggum/
├── config.json # Project config (agents, notifications, sessions)
├── PROMPT_plan.md # Instructions for planning mode (customizable)
├── GUARDRAILS.md # Compliance rules (before/after checks)
├── PROGRESS.md # Audit trail of completed work
├── implementation.json # Structured task list (generated by plan mode)
├── specs/ # Specification files you write
└── logs/ # Session logs (gitignored)
Note: Build prompts are dynamically generated per task (no PROMPT_build.md file).
Workflow
- Write specifications in
.ralph-wiggum/specs/ describing what to build
- Run
ralph-wiggum-cli plan — AI analyzes specs and breaks them into small, actionable tasks in implementation.json
- Run
ralph-wiggum-cli build — AI implements tasks one at a time, each with a reference to its parent spec
- Plan mode exits when AI outputs
<TASK_DONE>
- Build mode loops through tasks, marking each done/blocked/failed, until all complete
Why task-first?
- Smaller context = smarter agent (avoids the "dumb zone")
- Deterministic execution (you control task order via priority)
- Better progress tracking (each task is a checkpoint)
Command Options
ralph-wiggum-cli init -a <agent>
ralph-wiggum-cli init --plan-agent claude --build-agent droid
ralph-wiggum-cli init --plan-model opus --build-model sonnet
ralph-wiggum-cli init -f
ralph-wiggum-cli plan -v
ralph-wiggum-cli plan -a amp
ralph-wiggum-cli plan -m <model>
ralph-wiggum-cli build -v
ralph-wiggum-cli build -a droid
ralph-wiggum-cli build -m <model>
Supported Agents
- claude: Claude Code (
claude CLI)
- amp: Amp Code (
amp CLI)
- droid: Factory Droid (
droid CLI)
- opencode: OpenCode (
opencode CLI)
- cursor: Cursor Agent (
cursor CLI)
- codex: OpenAI Codex (
codex CLI)
- gemini: Gemini CLI (
gemini CLI)
- pi: Pi coding agent (
pi CLI)
Completion Signals
Plan mode: Exits when AI outputs <TASK_DONE>
Build mode (task-level):
<TASK_DONE> — task completed successfully, moves to next task
<TASK_BLOCKED reason="..."> — task is blocked, logged and skipped
The loop also stops when:
- User presses Ctrl+C
- All tasks are completed
Notifications
Ralph supports Telegram notifications for loop events (start, task complete, blocked, done). Configure during init or in .ralph-wiggum/config.json:
{
"notifications": {
"telegram": {
"enabled": true,
"botToken": "your-bot-token",
"chatId": "your-chat-id"
}
}
}