Ralph Loop
Execution Playbook
A one-stop technical guide to running your AI agents safely and efficiently
📋 Table of Contents
Workflow Automation Logic
Complete flow from SPEC.md to auto-commit
1. SPEC.md
Define task goals and success criteria
SPEC.md2. PLAN.md
AI generates implementation plan (Plan Mode)
PLAN.md3. Auto-Execute
Ralph Loop cycles until success
4. Verified
Tests passed, code automatically committed
1. SPEC.md
Define task goals and success criteria
SPEC.md2. PLAN.md
AI generates implementation plan (Plan Mode)
PLAN.md3. Auto-Execute
Ralph Loop cycles until success
4. Verified
Tests passed, code automatically committed
while true; do
cat SPEC.md | claude --plan # Generate plan
claude --execute # Execute code
if npm test && npm run build; then
git commit -am "✅ Task complete"
break
fi
# Continue loop on failure, Ralph never gives up
doneTechnical Isolation Guide
Ensure AI runs safely in controlled environments
Pros
- Full isolation
- High reproducibility
- Resource limits supported
Cons
- Requires Docker
- Higher startup overhead
# Ralph Wiggum Docker Isolation Script
FROM node:20-alpine
WORKDIR /app
COPY . .
# Install dependencies
RUN npm install -g @anthropic-ai/claude-code
# Security limits
RUN adduser -D ralph
USER ralph
# Start Ralph Loop
CMD ["sh", "-c", "while :; do cat PROMPT.md | claude; done"]
# Build and run
# docker build -t ralph-loop .
# docker run --rm -it --cpus=2 --memory=4g ralph-loopCompare Ralph Loop vs. traditional human development costs
AI Configuration
Human Comparison
Monthly Cost Comparison
$14,813
Monthly Savings
99%
Cost Reduction
$4
Cost per Task
13M
Monthly Token Usage
💡 Conclusion: Using Ralph Loop, you save $14,813 per month, a 99% cost reduction. Even if AI wastes 90% of tokens on failed loops, it's still more economical than human development.
Start Implementing Now
Download the Starter Kit containing Docker configs, script templates, and CLAUDE.md examples