Humans Are a Ralph Loop

Stateless sessions, external persistence, and the handoff problem that connects AI agents to human civilization


Every person is born knowing nothing. No episodic memory from prior generations. No direct access to what their parents learned, struggled with, or figured out. Each human life is a fresh session with a clean context window.

And yet, somehow, civilization advances. A medieval farmer’s grandchild can read. A Victorian engineer’s great-grandchild lands on the moon. The knowledge compounds across generations despite each individual starting from zero.

I build AI agent systems for a living. I spend my days solving a specific problem: how to make autonomous AI sessions productive when each session starts with no memory of what came before. The mechanism I use — structured files, handoff documents, persistent external state — is called a Ralph Loop. The moment I understood how it worked, I couldn’t unsee the same architecture running underneath human civilization.

The Ralph Loop

Geoffrey Huntley created the Ralph Loop in late 2025. The concept is almost offensively simple: run an AI coding agent in a while true bash loop. Each iteration starts a fresh session. The agent reads a specification, does work, commits to git, and exits. The next iteration starts clean — no memory of the previous run — but picks up where the last one left off because the file system persists between sessions.

Huntley used this to build CURSED, an entire programming language with an LLVM backend, for $297 in API costs. At a Y Combinator hackathon, teams using the technique shipped six repositories overnight (Huntley, 2025).

The key insight is the separation between session state and persistent state. The agent’s context window is ephemeral — it gets wiped every iteration. But the git repository, the specification files, the AGENTS.md that accumulates learnings — these survive across sessions. Progress lives in the external state, not in any single agent’s memory.

I run a version of this daily. My system uses a CLAUDE.md file (the equivalent of a textbook’s table of contents), structured handoff documents (the equivalent of lecture notes), and a memory layer that persists across sessions. Each new Claude session boots up, reads these artifacts, and continues from where the last session stopped. The session is stateless. The file system is the memory.

Humans Run the Same Architecture

Tomasello called it the “ratchet effect.” Each generation inherits the accumulated cultural knowledge of all previous generations, adds its own modifications, and passes the updated package forward. No individual needs to reinvent fire, agriculture, or calculus. The cultural ratchet prevents backsliding — what’s learned stays learned, because it’s encoded in external state that outlasts any individual (Tomasello, 1999).

This is structurally identical to a Ralph Loop.

Ralph LoopHuman Civilization
Fresh AI session (no prior memory)Newborn (no episodic memory from parents)
AGENTS.md, spec files, git historyBooks, oral tradition, institutions, infrastructure
File system persists between sessionsCulture persists between generations
Handoff document quality → next session qualityEducation quality → next generation capability
while true bash loopBiological reproduction

The mapping isn’t a loose metaphor. It’s a structural isomorphism. Both systems solve the same problem — continuity of progress across stateless sessions — with the same solution: externalize state into a persistent medium that the next session can read.

Henrich’s The Secret of Our Success makes the case that this externalization is what separates humans from other primates (Henrich, 2015). Chimpanzees are individually impressive problem-solvers, but their cultural accumulation is minimal. They don’t have a file system. Each chimp largely starts from scratch, learning through individual trial and error and limited social observation. Humans offloaded knowledge into artifacts — stories, tools, rituals, and eventually text — creating a persistent layer that any new “session” can bootstrap from.

Handoff Quality Determines Civilization Speed

In my agent system, the single highest-leverage investment is handoff quality. A well-structured handoff document — clear decisions, context for why, pointers to relevant files — lets the next session hit the ground running. A bad handoff — vague notes, missing context, contradictory instructions — means the next session wastes half its budget just figuring out where things stand.

The history of human knowledge transfer is a series of handoff bandwidth upgrades.

Oral tradition was the first handoff protocol. High-fidelity for simple knowledge (songs, recipes, origin stories), but low bandwidth and lossy over long chains. Lewis and Laland (2012) demonstrated through simulation that transmission fidelity is the key bottleneck for cumulative culture — even small improvements in fidelity produce outsized gains in cultural complexity.

Writing was the first major upgrade. Knowledge could persist without a living carrier. But manuscripts were expensive to copy, so distribution remained narrow. The handoff layer existed, but bandwidth was low.

The printing press was the upgrade that broke things open. Eisenstein (1980) argued that print didn’t just speed up the spread of existing knowledge — it changed the kind of knowledge that could accumulate. Error correction became possible at scale: multiple readers could compare editions, spot mistakes, and feed corrections back. The Scientific Revolution wasn’t just about new ideas. It was about a handoff protocol that supported error correction.

The internet is the latest bandwidth upgrade. And now we’re watching AI systems develop their own handoff protocols in compressed time — my system went from unstructured text files to structured YAML handoffs in about three months, recapitulating a transition that took human education centuries.

Education Is Handoff Protocol Design

Once you see the isomorphism, education stops looking like a separate domain and starts looking like applied handoff engineering.

A curriculum is a CLAUDE.md file. It doesn’t contain all the knowledge — it’s a structured pointer system that tells the new session what to read, in what order, and why each piece matters. A good curriculum, like a good CLAUDE.md, is opinionated: it makes choices about what’s essential and what’s supplementary. A bad one tries to include everything and overwhelms the reader with context they can’t absorb.

A textbook is a handoff document. The best ones don’t just present information — they present it in the order a new session needs to encounter it, with worked examples that build the right mental models. The worst ones are reference manuals: complete but unnavigable for a newcomer.

Context degradation — the thing I measure and fight daily in AI sessions — has a direct analog in education: cognitive overload. Cramming too much into a single session doesn’t produce learning. It produces the educational equivalent of a 200K-token context window where the system prompt gets drowned out. Mesoudi and Thornton (2018) define cumulative culture as requiring faithful transmission, and that requires selective transmission — compressing knowledge into what the next generation can actually absorb.

In my system, I learned the hard way that handoff format matters more than handoff volume. Early on, my handoff was a plain text file — a brain dump of everything the session had done. The next session would read it, miss the key decisions buried in paragraph four, and repeat work that had already been done. I burned through seven sessions on one feature before realizing the handoff was the bottleneck, not the model. Switching to structured handoffs with explicit decision logs, context sections, and pointers to relevant files cut wasted sessions in half. Education reformers have been discovering the same thing for centuries: rote memorization (unstructured dump) loses to structured pedagogy (organized, selective transfer) every time.

Same-Generation Parallelism

A Ralph Loop runs sequentially — one session after another. But human civilization runs many sessions in parallel within each generation. Billions of people, alive simultaneously, each exploring different parts of the problem space.

This isn’t Monte Carlo sampling — independent random trials. People interact. They compete, cooperate, copy, and recombine each other’s ideas. It’s closer to evolutionary search: each individual explores a direction (specialization), successful explorations get copied by others (imitation and teaching), and the best results pass to the next generation through the handoff layer (selection and inheritance).

Tennie, Call, and Tomasello (2009) formalized this distinction: cumulative culture requires not just innovation but selective social transmission. You don’t need every individual to be brilliant. You need a few to innovate and a good enough handoff protocol for those innovations to spread and stick.

My agent system does this too, in miniature. I run parallel builder agents, each tackling an independent module. Their outputs converge in the file system. No single agent sees the whole picture. But the persistent state — the shared repository — integrates their work. The architecture is the same at both scales.

The Bellman Equation of Generations

There’s a clean mathematical framing for why handoff quality matters so much. The Bellman equation from dynamic programming (Bellman, 1957) expresses the value of a state as the immediate reward plus the discounted value of all future states:

V(s) = R(s) + γ · V(s')

Apply this to generations:

V(generation) = own contribution + γ · V(next generation)

If the discount factor γ is high — meaning we care about future generations — then the value of the current generation is dominated by the second term. The own contribution of any single generation is small compared to the compounding value of all future generations building on what you leave behind.

This means investing in handoff quality (education, institutions, knowledge preservation) has exponential returns. It doesn’t just help the next generation — it helps every generation after that, because each inherits a higher baseline.

Heckman’s research on early childhood education (Cunha et al., 2005) provides empirical evidence: early educational investment yields 7-10% annual returns, higher than most capital investments. Psacharopoulos and Patrinos’ global meta-analysis (2018) confirmed that the social rate of return to education averages around 10% across countries and decades. These aren’t surprising numbers once you see education as compounding handoff improvement — you’d expect it to be the highest-ROI public investment.

What This Means for AI Memory Research

If the isomorphism holds, then AI memory research and education theory should be mining each other’s literature. A few specific translations:

Spaced repetition → session priming. Education research has decades of evidence on how to sequence information for retention. AI memory systems are rediscovering the same constraints: what you put in the system prompt, and in what order, dramatically affects session quality.

Curriculum theory → context curation. Not everything belongs in the context window, just as not everything belongs in a semester’s syllabus. The art is knowing what to include and what to leave as a pointer.

Standardized testing → handoff validation. How do you know the handoff worked? Education uses tests. My system uses structured checklists that the next session runs before doing work. Same function: verify that the critical knowledge actually transferred.

The problems are the same. The solution space is the same. The timescales are different — AI systems iterate in minutes, human generations in decades — but the architecture is identical.


Every person is a fresh session. Every generation is a loop iteration. The books on your shelf, the schools in your city, the institutions that structure your society — these are the file system. Education is handoff protocol design. And the quality of that handoff determines whether the next iteration starts from a higher baseline or spins in place.

We’ve been running Ralph Loops for ten thousand years. We just didn’t have a name for it.


References:

  • Bellman, R. & Kalaba, R. (1957). “On the role of dynamic programming in statistical communication theory.” IRE Transactions on Information Theory, 3(3). doi:10.1109/tit.1957.1057416
  • Cunha, F., Heckman, J., Lochner, L. & Masterov, D. (2005). “Interpreting the Evidence on Life Cycle Skill Formation.” NBER Working Paper 11331. doi:10.3386/w11331
  • Eisenstein, E. L. (1980). The Printing Press as an Agent of Change. Cambridge University Press. doi:10.1017/cbo9781107049963
  • Henrich, J. (2015). The Secret of Our Success: How Culture Is Driving Human Evolution, Domesticating Our Species, and Making Us Smarter. Princeton University Press. doi:10.2307/j.ctvc77f0d
  • Huntley, G. (2025). “Everything is a Ralph Loop.” ghuntley.com/loop
  • Lewis, H. M. & Laland, K. N. (2012). “Transmission fidelity is the key to the build-up of cumulative culture.” Philosophical Transactions of the Royal Society B, 367(1599). doi:10.1098/rstb.2012.0119
  • Mesoudi, A. & Thornton, A. (2018). “What is cumulative cultural evolution?” Proceedings of the Royal Society B, 285(1880). doi:10.1098/rspb.2018.0712
  • Psacharopoulos, G. & Patrinos, H. A. (2018). “Returns to Investment in Education: A Decennial Review of the Global Literature.” World Bank Policy Research Working Paper 8402. doi:10.1596/1813-9450-8402
  • Tennie, C., Call, J. & Tomasello, M. (2009). “Ratcheting up the ratchet: on the evolution of cumulative culture.” Philosophical Transactions of the Royal Society B, 364(1528). doi:10.1098/rstb.2009.0052
  • Tomasello, M. (1999). The Cultural Origins of Human Cognition. Harvard University Press. doi:10.4159/9780674044371