**11 Tips For AI Coding With Ralph Wiggum**

If you're using AI coding CLIs like Claude Code, Copilot CLI, OpenCode, and Codex, this article is for you. Most developers use these tools interactively, giving it a task, watching it work, and intervening when it goes off-track. This is "human-in-the-loop" (HITL) coding. But there's a new approach called Ralph Wiggum that lets your AI coding CLI run autonomously in the background.

**What is Ralph Wiggum?**

Ralph runs your AI coding CLI in a loop, letting it work on a list of tasks without human intervention. You define what needs to be done, and Ralph figures out how to get there. This approach is called AFK (away-from-keyboard) coding. Instead of writing a new prompt for each phase, you run the same prompt in a loop. The agent chooses the task, not you.

**Getting Started with Ralph**

This article assumes you're already familiar with AI coding CLIs and want to learn how to use Ralph Wiggum. If you're new to AI coding, start with our "Getting Started With Ralph" guide.

**11 Tips for Successful AI Coding with Ralph**

1. **Start with HITL, then go AFK**: Run Ralph in a loop, watching everything it does and stepping in when needed. Once your prompt is solid, switch to AFK mode. 2. **Define what 'done' looks like**: Instead of specifying each step, describe the desired end state and let the agent figure out how to get there. 3. **Use plan mode and create a prd.json file**: Plan your next feature in Claude Code's plan mode, then use the generated PRD items as input for Ralph. 4. **Run Ralph in a loop with 5-10 iterations**: For small tasks, run 5-10 iterations; for larger ones, run 30-50. 5. **Use progress files to track Ralph's progress**: Commit a progress.txt file after each feature to help Ralph understand the current state of your codebase. 6. **Add feedback loops to your Ralph prompt**: Request explicit feedback from Ralph on the quality of its work. 7. **Guide Ralph with small steps**: Bias small steps, especially when running AFK Ralph, to ensure the agent produces high-quality code. 8. **Prioritize tasks with spikes and integrations first**: Focus on early architectural decisions, then let Ralph run unsupervised on lower-risk tasks. 9. **Configure Ralph's permissions carefully**: Use Docker sandboxes to restrict Ralph's access to your system files and SSH keys. 10. **Monitor costs and adjust accordingly**: Configure Ralph to use the right amount of computational resources for your needs. 11. **Experiment with alternative loop prompts**: Try Test Coverage Loop, Duplication Loop, Linting Loop, or Entropy Loop to automate code improvement tasks.

**Join the AI Coding Revolution**

Ralph Wiggum is a powerful tool that can accelerate your coding process. Join our community of developers using Ralph to ship high-quality code faster than ever before.

---

**Additional Resources:**

* Learn more about Ralph Wiggum and autonomous AI coding on my newsletter. * Subscribe to get notified when new articles drop. * Join over 50,000 Developers Becoming AI Heroes by signing up for our newsletter.