The guide · paste into Claude Code
The overnight AI coding starter kit.
A complete guide to setting up autonomous AI coding — where you give AI a task before bed and wake up to shipped code. Claude Code reads your codebase, writes code, runs tests and handles git. The Ralph plugin keeps it in a loop until the job is actually done: no early exits, no "good enough". Define a task plus success criteria, and the AI works for hours while you sleep.
Paste into Claude Code
🔒 Drop your email to reveal the full kit
Get the full kit, free.
Drop your email and the kit unlocks instantly, plus every other guide and resource in the library. One email a week, unsubscribe anytime.
The concept (60-second explainer)
Claude Code = Anthropic's AI coding tool that runs in your terminal. It reads your codebase, writes code, runs tests and handles git — all through natural language. It's not a chatbot. It actually builds.
Ralph plugin (aka Ralph Wiggum / Ralph Loop) = a plugin that keeps Claude in a loop until the job is actually done. No early exits. No "good enough". It keeps iterating until your success criteria are met.
The combo = you define a task + success criteria → AI works on it for hours → you wake up to finished, tested, committed code. The name comes from the Simpsons character's persistence — it just keeps going no matter what.
What you need
| Requirement | Details |
|---|---|
| Anthropic account | Free tier or API key. |
| Terminal | Mac/Linux terminal or Windows WSL. |
| Node.js or Python | For installation. |
| A code project | Something to work on (ideally with Git). |
Installation (step-by-step)
Step 1: Sign up for Anthropic & get an API key
Go to anthropic.com and create an account. Generate an API key in your dashboard (under API Keys). Copy it — you'll need it for authentication.
Step 2: Install Claude Code
Open your terminal and run:
Verify the installation:
Authenticate:
Paste your API key when prompted, or set it as an environment variable:
Step 3: Install the Ralph plugin
Option A: Official plugin (easiest). Inside the Claude Code terminal, run:
Verify it's installed:
Option B: Bash loop (more control). For better context management, some devs prefer a simple bash script. Create a file called loop.sh:
Make it executable:
Then create a PROMPT.md file with your task and run ./loop.sh.
Step 4: IDE integration (optional but recommended)
For VS Code or Cursor: install the "Claude Code" extension from the marketplace, open your project folder, run claude in your repo folder, and link GitHub for repo access.
How to use Ralph
| Command | What it does |
|---|---|
/ralph-loop "task" | Start an autonomous loop. |
--max-iterations 20 | Set max loops (safety limit). |
--completion-promise "DONE" | The word that signals completion. |
/cancel-ralph | Stop the loop. |
Basic example:
Best prompts for overnight sessions
1. Feature build
2. Hello World API (good first test)
3. Bug fix
4. Code migration
Best practices
Do
- Set clear exit conditions — Ralph needs to know when it's "done" (e.g. "Output 'DONE' only when all tests pass").
- Always set max-iterations — prevents infinite loops and runaway costs (start with 10–20).
- Keep context under 50% — avoids drift; use
/clearfor fresh starts between iterations. - Use files as memory — better than accumulated context.
- Start with smaller tasks — test the workflow before big overnight runs.
- Use version control — so you can review/revert changes.
- Include "if stuck" instructions — tell it what to do if blocked.
- Use TDD (test-driven development) — makes verifiable exit conditions easier.
Don't
- Don't use Ralph until manual Claude sessions work for you.
- Don't leave it running with no iteration limit.
- Don't expect perfect on the first try (that's the point of the loop).
- Don't use it for tasks without clear completion criteria.
- Don't deploy directly to production without review.
Recommended workflow (3 phases)
Plan mode
Chat with Claude manually first. Define the task, break it down, agree on the approach.Auto-loop mode
Run Ralph overnight with clear success criteria.Review mode
Wake up, review commits, test manually, deploy.Think of yourself as a manager reviewing an employee's overnight work — not doing the work yourself.
Permission tip (use carefully)
If you trust the setup, you can skip permission prompts:
⚠️ Only use this in version-controlled projects where you can review/undo changes.
Cost awareness
Ralph loops use API calls. Monitor your usage: set reasonable --max-iterations (start with 10–20), use /clear between sessions to save tokens, start small to estimate costs before big runs, and consider rate limits (e.g. 100 calls/hr). Typical costs: ~$0.50–$5 per overnight run depending on complexity.
Advanced: useful plugins to add
| Plugin | What it does |
|---|---|
| Firecrawl | Pull web data into your project. |
| Playwright | Automated browser testing. |
| MCP Servers | Notifications when tasks complete. |
Resources & links
Official & core guides
- Anthropic Claude Code Docs — official setup.
- Ralph Wiggum Guide (GitHub) — plugin vs. bash comparison.
- Awesome Claude – Ralph Technique — quick-start snippets.
Videos & tutorials
- Ralph Wiggum Plugin Makes Claude Code 100x More Powerful — install + demo.
- Claude Code Ralph Loop: Run For Hours Autonomously — build-anything demo.
- How to Set Up Claude Code (Beginner Tutorial) — OS-specific setup.
Blogs & articles
- The Ralph Wiggum Playbook (paddo.dev) — 3-phase workflow breakdown.
- Ralph Wiggum Explained (Dev Genius) — plain-English guide.
- Top 10 Claude Code Plugins (Firecrawl) — includes Ralph tips.
Communities
- Reddit: Ralph Wiggum With Claude Code — user stories & help.
- X/Twitter: #ClaudeCode — latest tips from devs.
Your first overnight session (checklist)
- Anthropic account created & API key ready.
- Claude Code installed & authenticated.
- Ralph plugin installed (or bash loop created).
- Project has version control (
git init). - Small test task defined with a clear exit condition.
- Max iterations set (start with 15–20).
- Run the command.
- Go to sleep. 😴
- Wake up, review the commits. ☕
- Celebrate. 🎉
Start here (recommended first task)
If this works, you're ready for bigger overnight builds.
Original guide by Artem Novitckii. More from him on Instagram, in the Skool community, and across his resource library.