AI Engineer World's Fair 2026

Recursive Coding Agents

Loading slides…

Read the talk

Recursive Coding Agents

Reliable coding agents need more than intelligence: they need ways to decompose work, preserve state, verify delegated results, and reuse successful workflows.

From a talk by Raymond Weitekamp

Before you start: Familiarity with LLM context windows, tool calling, and coding-agent subagents will help; the article introduces the RLM execution model.

An app one day, an empty wallet the next

One day, a long prompt produces an almost working SaaS application. The next day, according to Raymond Weitekamp, Claude Code empties his Solana wallet. The contrast captures the problem with delegating consequential work: an impressive result does not establish that the next result will be safe or useful.

Slide contrasting agents building a SaaS app with emptying a Solana wallet, above four seated-person illustrations; presenter inset at lower right.Open full source frame
“We all want outcomes”: reliability and trust are the bottleneck.

The opening slide borrows a progression from the AI Engineer Code November 2025 T-shirt: eventually, the human is simply meditating while outcomes arrive. Getting there requires trust. Weitekamp’s thesis is that today’s agents are mismanaged geniuses: the missing layer is how we specify, manage, reuse, and verify their work.

He attributes that framing to Alex Zhang, Zed Li, and Omar Khattab at MIT. The related Recursive Language Models paper is by Alex L. Zhang, Tim Kraska, and Omar Khattab. Weitekamp develops the connection to coding agents in his interactive presentation and Turing Post companion article.

1:071:16
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

1:07 · section reference included

Make context an object of computation

In a recursive language model, or RLM, the full prompt is not necessarily text placed inside a model’s context window. It can be a variable, a file, or a collection of files in an executable environment. The model interacts with that environment through a read-evaluate-print loop, or REPL; the original paper uses Python. Instead of reading everything at once, the model writes operations that inspect and manipulate the externalized input.

For example, a Python REPL can hold a corpus while exposing only a selected passage to the model. Here, prompt remains available for subsequent operations, while the printed result contains a location and a bounded excerpt:

python

from pathlib import Path

prompt = Path("corpus.txt").read_text(encoding="utf-8")
needle = "authentication"
position = prompt.casefold().find(needle)

if position == -1:
    print({"found": False, "characters": len(prompt)})
else:
    start = max(0, position - 200)
    end = min(len(prompt), position + 800)
    print({"start": start, "end": end, "excerpt": prompt[start:end]})

This illustrates the symbolic-access step: the model can reason about offsets and selected content without copying the entire corpus into its context.

The recursive step delegates parts of that investigation to other models. A child can be an ordinary LLM, or another RLM when the allowed recursion depth extends beyond one level. Children examine their assigned material and return intermediate answers; those answers propagate upward through the call tree until the parent can produce a final answer. The context is something the system computes over, not merely something the model reads.

Slide listing Externalize, Operate, and Recurse beside the Recursive Language Models paper, with a branching RLM and LLM call tree below.Open full source frame
Context as computation: externalize, operate, and recurse.
2:402:54
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

2:40 · section reference included

Reasoning through execution

Weitekamp sees this as a new form of inference-time compute. Chain-of-thought prompting first encouraged models to spell out intermediate reasoning; reasoning models then made extended reasoning an explicit part of inference. Function calling and parallel tool calling developed alongside that progression. RLMs combine the two: executing code becomes part of the reasoning process, and a model call can itself be an operation inside that code.

He introduces Oolong from the original paper as an example of working beyond a context window, then describes RLMs processing tens of millions of tokens. The paper’s abstract supports inputs up to two orders of magnitude beyond model context windows; the talk’s tens-of-millions figure should not be read as a specifically established Oolong input size. The architectural point is that external storage and selective computation remove the requirement that all input fit in one model call.

The same structure can serve as memory: keep information outside the immediate context and let the agent compute over it when needed. Weitekamp describes an unmodified RLM harness as roughly a top-ten memory system in his contemporary comparison. His February 11, 2026 memory report gives that claim a concrete setting: baseline dspy.RLM with Gemini 3 Flash scored 87.2% on LongMemEval, while the structured observational-memory variant reached 89.8%. These are results from his reported experiment, rather than a standing rank for every RLM harness.

4:204:33
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

4:20 · section reference included

Long reasoning changes the benchmark question

LongCoT stresses a different limit: sustaining a long sequence of reasoning steps. A model may understand the individual operations yet lose the thread before completing the problem. Weitekamp reports state-of-the-art results using DSPy’s RLM implementation, combining code execution with recursive subagent calls instead of relying on one uninterrupted analysis sequence.

In the recording, Weitekamp says Qwen3.5-9B in an RLM harness beats Opus and GPT-5.4 as ordinary LLMs on these long-reasoning tasks. The available April 19 companion report documents a different comparison: Qwen3.5-9B with DSPy.RLM scored 15.69%, versus GPT-5.2 at 9.83%, on the same full-benchmark slice. That report does not establish the spoken Opus/GPT-5.4 comparison. Its inference was hosted through Together AI via OpenRouter; the observation that a nine-billion-parameter model could run on a laptop describes model size, not the hardware used for that experiment.

Harnesses also change what a benchmark score measures. Weitekamp points to Symbolica’s Agentica RLM harness and reports an ARC-AGI-3 score in the thirty-something-percent range within hours of release, against frontier-model scores around 2–3%. The exact evaluation split and action budget are not established here. He interprets ARC Prize’s response as a consolation acknowledgment accompanied by a refusal to conduct the full private evaluation; that account of the dispute is his interpretation.

For LongCoT, he credits his results and Alex Zhang’s with encouraging a separate open-harness leaderboard. The benchmark now distinguishes Raw LLM, Restricted Harness, and Open Harness tracks, while its primary setting excludes tools; the track structure does not itself establish who caused its creation. This separation makes the comparison legible: a model sustaining unaided reasoning and a program coordinating models and execution are different evaluated systems. Weitekamp’s practical preference is to optimize for outcomes, whether the computation happens internally, in reasoning tokens, or through code.

5:576:04
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

5:57 · section reference included

Who chooses the decomposition?

The companion repository includes a rubric for distinguishing RLMs from nearby architectures. It asks for five properties:

PropertyArchitectural role
Executable environmentRun operations over the input
Externalized promptKeep the full input outside immediate context
Code-driven model callsInvoke models from the computation
Model-selected decompositionLet the model choose the subproblems
Symbolic statePreserve variables and references between operations

Together, these describe a system in which the model can decide how to investigate a problem and use execution to carry out that decision.

A plain LLM call or a retrieval-augmented generation pipeline does not, by itself, satisfy the rubric. Coding agents with subagents and loops get closer, but their existence alone does not establish model-directed decomposition. Hard-coded MapReduce is the useful counterexample: a programmer fixes the split, then model calls process the predetermined pieces.

Weitekamp places LambdaRLM in that category, describing it as lambda-calculus-based MapReduce containing LLM calls. His distinguishing question is not whether models appear somewhere in the computation. It is whether the model decides how to break the problem apart. That choice allows the decomposition to respond to what the agent discovers.

9:089:19
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

9:08 · section reference included

From an RLM tool to a harness that calls itself

Replacing “LLM” with “coding agent” in the call tree sounds almost trivial. An RLM already writes code, and it already recurses. The useful engineering question is what these principles enable inside a coding-agent harness. Weitekamp dates his experiments to the October 2025 RLM blog post.

His first experiment wrapped Alex Zhang’s RLM package in a CLI, making an RLM available as a coding-agent tool. If the agent needed to sift through a hundred-million-token corpus, it could delegate that investigation to the tool. That is an illustrative workload, but it exposes the boundary clearly: the coding agent remains the outer controller, and the RLM handles a particular operation. The stronger goal was to make the coding-agent harness invoke the exact same version of itself.

That led to Y-Pi, named for the lambda-calculus Y combinator and the Pi coding agent. Pi has a deliberately minimal core; its creator, Mario, encourages extensions instead of adding every proposed feature to the main agent. Initially, Pi’s extension interface could not support Weitekamp’s recursive design, so he forked it. Revisiting the project for this talk, he found that the evolved extension system could support the implementation directly.

The resulting pieces are the Pi recursive extension package and Y-Pi as a convenience wrapper. Pi calls Pi, which can call Pi again, with configurable recursion depth. The progression matters: an RLM exposed as a tool delegates one kind of computation; a recursive coding harness delegates to another instance of the same agent environment. Alex Zhang’s original RLM implementation remains the starting reference for the broader ecosystem.

10:3210:43
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

10:32 · section reference included

The executable environment need not be Python

The same architecture can take several forms:

  • DSPy: dspy.RLM is Weitekamp’s preferred implementation for benchmarking and the harness behind the results he discusses.
  • Ax: Originally a TypeScript variation on DSPy, Ax lets an agent write a TypeScript interface to another Ax agent, extending the pattern recursively.
  • Unix RLM: Dan at OpenProse built an implementation using pure Bash, with the Linux filesystem as its environment.

The Unix example makes the generalization concrete: a REPL need not mean Python variables. Files and shell operations can provide the external state and executable access.

OpenProse approaches the problem at the language level, expressing workflows that can give coding agents RLM behavior. Its repository also includes a coding-agent harness that, as described in the talk, executes Prose programs over either the Codex SDK or Claude Code. The language for declaring the work and the backend performing it are separate concerns.

13:5414:12
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

13:54 · section reference included

When Claude Code becomes an RLM

The question “Isn’t this just Claude Code subagents?” appeared immediately around the original RLM announcement. Weitekamp describes the initial answer as no, then points to Omar Khattab’s later acknowledgment of Claude Code’s dynamic workflows. The relevant change is the ability to construct recursive workflows, not a change in the label attached to every Claude Code session.

Anthropic’s A harness for every task describes six workflow patterns. Weitekamp contrasts two companion examples to isolate the architectural difference:

WorkflowHow work is dividedClassification in the talk
Fixed MapReduceScript chooses the splitNot an RLM
Filesystem deep researchModel chooses what to investigateRLM-style workflow

In the research example, the controller selects a handle to some material, assigns an agent to analyze it, and receives findings back. The choice of what to investigate is part of the model’s work. Dynamic workflows make that behavior possible; a fixed script using the same capability can still fall outside the rubric.

Slide titled “Dynamic workflows made Claude Code recursive,” with six workflow diagrams and two example cards contrasting model-chosen and script-fixed splits.Open full source frame
Dynamic workflows distinguish model-chosen decomposition from a fixed script.
15:2815:41
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

15:28 · section reference included

Declare the work, verification, and dependencies

Dynamic workflows provide a Claude Code-specific route. OpenProse offers another route for users of Claude Code, Codex, Pi, or other coding agents. It is a programming language expressed as a Markdown specification in logical English. In Weitekamp’s description, the coding agent compiles it: the agent interprets the declared work and carries it out.

The prose write command asks the coding agent to generate a .prose.md workflow. Weitekamp compares this with Claude Code’s ultracode trigger word, which prompts workflow construction; it is not a separately established slash command here. The prerequisites he gives for applying Prose’s RLM pattern are filesystem access and subagents.

The workflow makes delegated work explicit. In the two companion .prose.md examples, a parent can break a problem into smaller tasks, assign them to subagents, and verify the returned work in the parent session. Delegation therefore does not end at collecting answers: the contract includes checking them before accepting the result.

Skills and tools can also be declared as dependencies, two language features Weitekamp added. A worker may need a particular skill to perform its role, or a specific CLI without which the task cannot run. Wiring those requirements into the workflow is intended to configure the worker with the capabilities its contract assumes. This makes the assignment more precise than simply asking an unspecified subagent to solve a problem.

17:1617:26
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

17:16 · section reference included

Repository work and the golden session

Across the Claude dynamic-workflow and OpenProse examples, the useful workloads extend beyond answering questions:

  • Repository migrations: Split a large refactor across parallel workers, then merge the work into a combined result.
  • Recursive directory analysis: Start from a directory and investigate, analyze, or process its contents recursively.
  • Audits and bug sweeps: Delegate searches for defects across the system.
  • Adversarial review: Use skeptical or red-team agents to challenge proposed work and improve it through independent scrutiny.

These tasks use decomposition for different purposes: distributing implementation, exploring a hierarchy, or obtaining a deliberately contrary assessment.

The final application returns to the opening reliability problem. Weitekamp adds that the cryptocurrency amount was fortunately small, but the contrast remains: one session produces an excellent outcome, while another goes badly wrong. A successful “golden session” contains a process worth recovering, rather than merely an answer worth saving.

His session-to-Prose system uses a Prose program to direct an agent through that recovery:

  1. Take a successful session from Claude Code, Codex, Pi, or another supported agent.
  2. Have the agent deconstruct how the session achieved its result.
  3. Turn that process into a reusable Prose workflow, potentially including recursive delegation.

The intended result is a repeatable way to approach the same quality of outcome. Reusing the workflow does not make LLM execution deterministic, as the companion article explicitly cautions; it captures a useful process that can be run and evaluated again.

19:5420:15
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

19:54 · section reference included

Reliability is an orchestration problem

Trust depends on reliable behavior. Weitekamp’s proposed next step is to improve orchestration: how an agent chooses work, executes it, delegates it, and incorporates the result. RLMs make tool calling part of reasoning itself, with another agent available as one of those tools. Coding agents can be RLMs, but they are not automatically RLMs. Claude Code dynamic workflows and OpenProse offer concrete ways to build the missing behavior.

“Recursive Coding Agents FTW” panel beside three takeaways: trust is reliability, a new paradigm of inference-time compute, and coding agents can be RLMs.Open full source frame
Closing synthesis: trust is reliability, and coding agents can be RLMs.

The invitation is to explore those implementations through the interactive presentation, while treating their expanded capabilities as a responsibility. A harness that can recursively create more work needs deliberate management of that work. Weitekamp closes with the fitting instruction: “please recurse responsibly.”

21:5022:08
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

21:50 · section reference included

Resources

From the talk

  • RLMs are SOTA on LongCoTArticle

    April 2026 experiments using DSPy.RLM with small Qwen models on long reasoning problems.

Transcript download
Full transcript

Loading transcript…