The Ralph Wiggum Technique
Join me as I perform a deep-dive into the agentic looping technique known as "Ralph Wiggum." In this series, we’re not just building a script, we’re building the surrounding system that makes an agent reliable enough to collaborate with. We’ll work through permissions, sandbox rules, hooks, and safer ways to run in more autonomous modes.
By the end, we’ll have something much bigger than a typical demo: a working approach for spec-driven agent development that can run locally, in the background, or on a remote machine over SSH. Let's go!

Progress
Series Info
- Episodes
- 16
- Run Time
- 1h 56m
- Difficulty
- Intermediate
- Last Updated
- May 18, 2026
- Version
- Latest
Series Episodes
- Episodes (16)
What Is Ralph?
Let’s kick things off by building a simpleRalph.shloop and seeing how this agentic workflow actually works in practice. We’re not trying to make it fancy yet, just to understand why restarting the model with lightweight memory files likeproject.mdandprogress.mdcan be such a powerful way to ship work.Improving Our First Ralph Loop
Now that we have our basicralphloop in place, let's make it feel a lot less blind by surfacing what the model is doing in real time. We'll move from the old shell script to a smallNode.jswrapper that can parsestream-jsonoutput into something actually readable while keeping the same overall loop architecture.What Is A PRD?
Now that we have a feel for the onboarding problem, we’re going to step back and shape an agent-ready PRD that gives the model the right context, constraints, and success criteria before it writes a single line ofcode. The goal here is to front load the important decisions so our loop can execute with far less guesswork and a much better shot at shipping the right thing.Creating A PRD With Our PRD Skill
Now that we have ourPRDskill in place, we are going to put it to work and see how a well scoped spec can drive an agent through a real feature build. Along the way, we will refine the generated plan a bit, feed it into ourrel.jsloop, and check whether the end result actually holds up in the app.Running Ralph In The Background
Let's take a minute to make our terminal setup a lot more resilient so we do not lose long running work every time we accidentally close a window. We will get comfortable withscreenandtmux, with extra attention on a simpletmuxworkflow that lets us keep multiple loops and tools running in the background.Permissions And Sandboxing
Now that we have the basic permission flow in place, we’re going to tighten things up and make the CLI a lot less noisy by configuring what can run automatically. We’ll look atallowanddenyrules, then move into the nativesandboxso we can give the model some freedom without giving up safety.Configuring Hooks
Now that we have the sandbox handling the basics, we need to tighten up how permission checks work formcptools that live outside that flow. We’ll usepre-tool-usehooks to intercept requests, allow or deny them more intelligently, and even explore how a model driven reviewer can act as a second set of eyes.A Word On Auto Mode
Before we jump into bypass permission mode, we should pause for a quick look at Anthropic's newAuto mode, since it overlaps a lot with the hook based approach we just set up in the previous lesson. We'll check out what it does well, where it still feels shaky in practice, and why we're still moving on to a safer way to bypass the permission system ourselves.Bypassing Permissions Safely
Now that we have played it safe with permissions, we are going to flip that around and explore what happens when we run inbypass permissionsmode. The real focus is figuring out how to keep that power from becoming dangerous by leaning on sandboxes and eventually moving into a more isolated setup likeYolo box.Turning Our Ralph Script Into a Flexible CLI
In this lesson, we're taking our simpleRalph.jsscript and turning it into a polished CLI that feels much more flexible and pleasant to use. We'll lean onBun,OpenTUI, and a PRD driven workflow to sketch, generate, and test a tabbed terminal interface with support for things likeYoloBox.Agent Workspaces
Up to this point, we have been letting Ralph run directly on our main branch, and that gets awkward fast once we want to keep coding without stepping on the agent's work. In this lesson, we will give Ralph a proper workspace of its own with approaches likegit worktreeand copy on write so our loops stay isolated, easier to test, and a lot less disruptive.Tracking PRDs With Linear
Up to this point, we’ve been managing PRDs in flat files, but now it’s time to move that workflow intoLinearso we can get better hierarchy, richer issue context, and a smoother handoff toRelo. We’ll wire up the integration, generate parent and child issues from a PRD, and watch the whole flow run from tracking to automated pull request creation.Human In The Loop
In this lesson, we're going to put some guardrails aroundRalphby introducing a human in the loop workflow for the moments when the model is making important architectural calls. We'll let it propose a data shape for menu customizations, step in to review and nudge it, and then watch how that small bit of feedback keeps the rest of the feature on track.Offloading Loops To A Remote Machine
Now that we've seenRalphrunning locally, let's move it onto a remote machine so we can keep our workflow available across devices and out of our laptop's orbit. We'll set up a remote worker overSSH, lean ontmuxfor persistence, and then use the built in remote mode to dispatch loops while still keeping a nice local control pane.Experimenting With A Perpetual Loop
Now that we've let this autonomous loop run wild, we're going to step back and look at what it actually produced and how far this experiment really got us. Then we'll start zooming out beyondRalphitself and head toward the bigger idea of agent orchestration.Beyond Ralph Orchestration
Now that we have all the core pieces in place, let's zoom out and see what this can look like as a real orchestration system by wiring Linear, multipleworkflow.mdstyle files, and our own agent loops together. We'll build a more flexible take on Symphony that supports Claude and routing, so we can watch these ideas move from isolated experiments into something we could actually use day to day.