Running in Circles

Extra lightweight agent “orchestration“. A variation on the Ralph Wiggum theme

964 words

v1

Originally published on eighttrigrams.substack.com on February 18th, 2026

A few hype cycles ago, the “Ralph Wiggum” loop for agentic coding made the rounds and became such a strong meme — I believe because it gave interested coders a simple idea to work with, in stark contrast to all the complex orchestration frameworks floating around at the time. It certainly inspired me to finally “do it” and say, “well, now it’s time for me to look into agent orchestration.”

To recap, “Ralph” prescribes LLM agent invocations inside a Bash loop. Every round, the agent gets fed — importantly — a small task from a backlog, one that could comfortably be done in a single context window. On top of that, at the end of each invocation, static checks like unit tests can run, and if those fail, the step gets repeated. Something like that.

simple-outerloop.png

Now, I am very interested in “automating myself away” — insofar as the chores go, in any case — but I’d also be okay if the LLM did all of the coding, to be honest. So I was curious to think through, with the help of some experiments, how far this approach can be pushed with respect to delivering high-quality code — code of the quality I myself would be personally satisfied with.

In the following, I describe something built the way developers so often do things: take something simple — here the Ralph loop as a whole, as well as parts of it — and compose something more complex out of it. So here are the things I think are worth highlighting:

Now, how does that help me produce high-quality code? Well, many of the steps in the pipeline are review steps, or steps where agents check and judge previous agents’ work. They produce artefacts that agents further down the line then take as prescriptions. I feel this is very much in line with the Ralph loop in the sense that it brings the right amount of determinism into the mix. In the Ralph loop, that’s the ever-same simple loop structure; here, it’s the ever-same sequence of steps.

I believe this works reasonably well, and I have it working to build a side project of mine (literally). That it would was based on the following assumptions:

So, basically what I’m doing is going in circles, each time looking at the code from a fresh perspective, for every new task. And then I apply things like the Boy Scout rule. I mean, my agents do. Whatever they find, they complain about or fix before “the actual” work begins, for example. This all spares me conditional logic (a more complex state machine), which would make it necessary for agents to determine when something is done, or what needs to be done, or when something is good enough, and so on. I don’t want any of that. Instead, whatever is left over, whatever imperfections remain, gets left for the next round. As far as the work to do now is concerned, it was tightly scoped anyway, and I make sure I see reports of done work at the end, before I merge.

Here is the simplified version of what happens inside a single interation:

simplified.png
Each box is a step and each rounded box an artefact. Note that Revert and Code Review steps are not running in parallel.


Code is here for reference. Beware it’s not as simple as depicted above; not in the sense that it’s fancy complex, rather messy, and - I fear - a little overengineered. Classic beginners mistake! But good for learning.

# Comments

Leave a comment