ralphing-la-vida-locum: Ralphing la Vida Locum: the Rust supervisor that lets Claude Code work alone
A stateful orchestrator that wraps autonomous coding in quality gates, checkpoints, and stagnation detection.

This project is named in memory of my best friend Gareth, who passed away in a mountaineering accident on Ben Nevis.
- Ralph treats autonomous coding as a supervised process, not a free-running prompt loop.
- Its real innovation is the control plane: stagnation detection, gates, checkpoints, and rollback.
- Narsil and the compact code graph shape context before Claude Code ever sees the task.
- The memorial origin turns a technical project into an argument for reclaiming time.
The problem with autonomous coding is not that the model cannot act. It is that it can act without improving. Ralph exists for the ugly middle, the run that keeps editing, keeps moving, and still drifts off target. Instead of treating the agent like a magician, it treats it like a process that needs supervision.
The real story is control, not generation
Most wrappers add convenience. Ralph adds governance. It sits around Claude Code and asks the questions a careful operator would ask: did the plan actually change, did the repo actually improve, and are we just looping because the model likes the shape of the previous answer?
Why this repo has a moral center
The name carries a memorial and a philosophy. Gareth, the friend behind the dedication, lived by working smart enough to buy freedom back. That makes the project feel less like a productivity hack and more like a refusal to turn software into a trap.
That line is the thesis in plain language. Ralph is trying to compress the time you spend babysitting the keyboard so you can spend more of it elsewhere. The technical ambition makes sense once you read it that way.
Inside Ralph's loop
Ralph's center of gravity is a state machine. The loop remembers the iteration number, the plan hash, the last Git HEAD, and a stagnation count. If the agent keeps editing without moving the state, the system stops pretending that motion equals progress.
struct LoopState {
iteration: u32,
stagnation_count: u32,
plan_hash: String,
git_head: String,
mode: Mode,
}
enum Mode {
Build,
Debug,
}
That is a subtle but important design choice. A chat loop can be noisy and still be dead. Ralph treats repetition as a signal, then uses mode switching to force a change in strategy instead of another spin.
The safety net is Git, not wishful thinking
Ralph creates checkpoints around the loop and can roll back when quality drops. That means a bad iteration is not just a failed run. It is a recoverable state with a timestamp, a hash trail, and a way home.
The interesting part is not the rollback alone. It is the fact that rollback sits beside quality metrics and audit logging. In other words, Ralph is built like a system that expects AI to make mistakes and plans for them up front.
Ralph does not feed the model raw repo soup
The context strategy is equally disciplined. Narsil builds a compact code graph, then the prompt assembler feeds Claude Code layered context: manifest, architecture, changed files, and the specific quality signal that matters. If the agent starts oscillating on one file, Ralph can say so. If a gate fails, the remediation prompt gets sharper.
That matters because better prompts are not the same thing as better context. Ralph is trying to shape what the model sees, not just how politely it is asked to work.
Why the comparison is the whole point
A bare Claude Code loop can get you started. A Bash loop can retry. Ralph is what happens when you add state, gates, observability, and recovery to that simple idea.
| Capability | Bare Claude Code | Bash loop | Ralph |
|---|---|---|---|
| State retention | Conversation memory | File state, fragile | Explicit loop state |
| Quality checks | Manual | External script | Built in, weighted gates |
| Rollback | Human driven | Ad hoc | Git checkpoints |
| Stagnation detection | Weak | None | Multi-factor predictor |
| Context shaping | Prompt by prompt | Static files | Compact Code Graph |
| Auditability | Low | Low | Hash-chained logs |
| Polyglot support | Tool dependent | None | Language aware |
The table makes the gap obvious. The cheap versions can execute, but they do not know when they are stuck or when the result is safe enough to keep. Ralph is built to know both.
What Ralph suggests about autonomous development
The broader lesson is not that every agent needs more scaffolding. It is that the next serious wave of autonomous dev tools will compete on supervision. The winners will know how to detect drift, shape context, and recover cleanly when the model does what software often does best: fail in interesting ways.
Ralph makes that argument without much noise. It is a Rust system with a clear bias toward control, but the philosophy is bigger than the code. The future is less about a smarter prompt and more about a better process.