spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / plugins / ralph-wiggum / commands / ralph-loop.md
48 lines · 2.7 KBPreviewCodeRaw
1---
2description: "Start Ralph Wiggum loop in current session"
3argument-hint: "PROMPT [--max-iterations N] [--completion-promise TEXT]"
4allowed-tools: ["Bash(${CLAUDE_PLUGIN_ROOT}/scripts/setup-ralph-loop.sh)"]
5hide-from-slash-command-tool: "true"
6---
7
8# Ralph Loop Command
9
10Execute the setup script to initialize the Ralph loop:
11
12```!
13"${CLAUDE_PLUGIN_ROOT}/scripts/setup-ralph-loop.sh" $ARGUMENTS
14
15# Extract and display completion promise if set
16if [ -f .claude/ralph-loop.local.md ]; then
17 PROMISE=$(grep '^completion_promise:' .claude/ralph-loop.local.md | sed 's/completion_promise: *//' | sed 's/^"\(.*\)"$/\1/')
18 if [ -n "$PROMISE" ] && [ "$PROMISE" != "null" ]; then
19 echo ""
20 echo "═══════════════════════════════════════════════════════════"
21 echo "CRITICAL - Ralph Loop Completion Promise"
22 echo "═══════════════════════════════════════════════════════════"
23 echo ""
24 echo "To complete this loop, output this EXACT text:"
25 echo " <promise>$PROMISE</promise>"
26 echo ""
27 echo "STRICT REQUIREMENTS (DO NOT VIOLATE):"
28 echo " ✓ Use <promise> XML tags EXACTLY as shown above"
29 echo " ✓ The statement MUST be completely and unequivocally TRUE"
30 echo " ✓ Do NOT output false statements to exit the loop"
31 echo " ✓ Do NOT lie even if you think you should exit"
32 echo ""
33 echo "IMPORTANT - Do not circumvent the loop:"
34 echo " Even if you believe you're stuck, the task is impossible,"
35 echo " or you've been running too long - you MUST NOT output a"
36 echo " false promise statement. The loop is designed to continue"
37 echo " until the promise is GENUINELY TRUE. Trust the process."
38 echo ""
39 echo " If the loop should stop, the promise statement will become"
40 echo " true naturally. Do not force it by lying."
41 echo "═══════════════════════════════════════════════════════════"
42 fi
43fi
44```
45
46Please work on the task. When you try to exit, the Ralph loop will feed the SAME PROMPT back to you for the next iteration. You'll see your previous work in files and git history, allowing you to iterate and improve.
47
48CRITICAL RULE: If a completion promise is set, you may ONLY output it when the statement is completely and unequivocally TRUE. Do not output false promises to escape the loop, even if you think you're stuck or should exit for other reasons. The loop is designed to continue until genuine completion.