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 Loop | Human Civilization |
|---|---|
| Fresh AI session (no prior memory) | Newborn (no episodic memory from parents) |
AGENTS.md, spec files, git history | Books, oral tradition, institutions, infrastructure |
| File system persists between sessions | Culture persists between generations |
| Handoff document quality â next session quality | Education quality â next generation capability |
while true bash loop | Biological 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