rosneri/writing
all posts
AI EngineeringJul 2026 · 5 min read

Ralphy, as an idea file

Neri Rosner
Neri Rosner
backend-oriented full-stack engineer

An idea file, in the Karpathy sense: in the era of LLM agents there’s less point in sharing the specific code or app — you share the idea, and the other person’s agent customizes and builds it for their needs. Specific enough to be actionable, loose enough that an agent fills in the implementation details.

This is Ralphy as an idea file. Download the raw IDEA.md and hand it to your coding agent, or read on.

The idea

A coding agent working on a large task in one long session degrades: context fills up, it loses the plot, it starts undoing its own work. The fix is the Ralph loop: instead of one long-lived agent, run a fresh agent per iteration against durable state on disk. The state — not the agent’s memory — is the source of truth.

Concretely:

  1. A change is described as a small bundle of markdown files: a proposal (what and why), a design (how), and a task checklist (tasks.md) that decomposes the work into small, independently verifiable items.
  2. A loop spawns a fresh agent with a prompt that says: read the change files, do the first unchecked task, validate it (build, tests, lint), and check it off. Nothing else.
  3. The agent exits. The loop inspects the outcome, updates loop state (iteration count, cost, failure history), and spawns the next fresh agent.
  4. Repeat until the checklist is done or a stop condition fires.

Each iteration starts with a clean context window and full knowledge of where things stand, because “where things stand” lives in files, not in a conversation.

What makes it work

Natural extensions

What to ask your agent for

Build me a Ralph loop for my project: changes as proposal/design/tasks markdown bundles, a runner that spawns a fresh <your agent CLI> per iteration to do exactly one task and validate it, stop conditions for iterations/cost/runtime/repeated failures, and loop state persisted as JSON. Integrate with <your tracker> for intake and status.

That’s the whole file. Grab the raw markdown — it’s also in the repo.

Want the implementation too? Ralphy is the reference build — Bun, XState, Linear, the works.More writing
Keep readingZero any, one year on8 minDDD for people who actually ship12 minAn MCP server in an afternoon9 min