by Th0rgal
Type `ralph "prompt"` to start open code in a ralph loop. Also supports a prompt file & status check.
# Add to your Claude Code skills
git clone https://github.com/Th0rgal/opencode-ralph-wiggumRalph is a development methodology where an AI agent receives the same prompt repeatedly until it completes a task. Each iteration, the AI sees its previous work in files and git history, enabling self-correction and incremental progress.
This package provides a CLI-only implementation (no OpenCode/Claude Code/Codex plugin).
# The essence of Ralph (agent CLI varies):
while true; do
opencode run "Build feature X. Output <promise>DONE</promise> when complete."
done
Use --agent claude-code or to run the loop with Claude Code or Codex instead of OpenCode.
--agent codexThe AI doesn't talk to itself. It sees the same prompt each time, but the files have changed from previous iterations. This creates a feedback loop where the AI iteratively improves its work until success.
| Benefit | How it works |
|---------|--------------|
| Self-Correction | AI sees test failures from previous runs, fixes them |
| Persistence | Walk away, come back to completed work |
| Iteration | Complex tasks broken into incremental progress |
| Automation | No babysitting—loop handles retries |
| Observability | Monitor progress with --status, see history and struggle indicators |
| Mid-Loop Guidance | Inject hints with --add-context without stopping the loop |
Prerequisites: Bun and at least one supported agent CLI: OpenCode, Claude Code, or Codex