Coding assistants · Research feature

Tracing the Thoughts of a Coding Agent Playing ARC-AGI-3: Lessons for Continual Learning

A coding agent learns continuously by rewriting scripts and discarding level-specific knowledge when moving to new tasks in ARC-AGI-3.

Adapted from research by Chen Wu, Josh Passenger, Yin Song.

arXiv preprint revision · 2026-10-08 · Attribution & reuse
In this article
Editorial illustration of developer workstation.

Editor’s introduction

The study tracks how a coding agent learns through abstract reasoning tasks in ARC-AGI-3 by analyzing the scripts and notes it writes. Scripts written for one level are rarely reused in later tasks, with only 33 of 630 references crossing task boundaries. Most scripts are rewritten, retaining general rules while discarding level-specific details. This behavior aligns with the isolation strategy in continual learning, where the agent discards beliefs but retains evidence.

Introduction

Continual learning is usually framed as updating a parametric model over a sequence of tasks without catastrophic forgetting of earlier competence, and the difficulty is attributed to a tension between stability and plasticity. An agent built on a frozen foundation model, on the other hand, tackles the same continual learning problem without weight updates: it must decide where knowledge is kept and what happens to that knowledge when the task changes.

To study that question, we develop a coding agent whose knowledge resides entirely in a directory, building on the programmatic-memory design of PRO-LONG. The harness appends every interaction to logs.txt and provides the agent only the path to that file. Any fact about the environment must therefore be established by a script the agent writes. The memory of the agent consists of these scripts and its notes, and both are directly readable.

We evaluate the agent on ARC-AGI-3, the interactive benchmark designed to test general intelligence as the efficiency of acquiring skills on novel tasks. The rules of every game must be discovered by playing it. Each game is a sequence of levels that share one interface yet differ enough that a solution to one can fail outright on the next (Section 3.1). A level boundary is therefore a task boundary inside a single episode, and it arrives unannounced. At each one the agent must decide what to carry, what to rebuild and what to abandon.

Our contribution is a measurement protocol. Every script is assigned to the task that was open when it was written, which yields 4,786 scripts across 689 boundaries (Section 3.4). The protocol needs no access to the model that produced the memory, so it applies to any agent that writes its knowledge to a file system. It makes retention and transfer directly countable where both were previously inferable only from task performance.

Applying the protocol to seven deliberately varied runs across three backbones from two model families, which clear between 34 and 183 of the 183 available levels, we report two findings. The first is an empirical characterization of cross-task update (Sections 4.1–4.3). Transfer occurs by re-derivation rather than by reference: an agent carries the rule it has learned and discards the script that established it. The moment it writes the rule out again is the moment it separates what the environment always does from what belonged to the task it has just left. All backbones respond to a boundary by partitioning memory rather than by reconciling it and differ only in the partition key.

Surveys of continual learning group methods by the mechanism that protects earlier tasks while a new one is learned: regularization of parameters, replay of stored data, and parameter isolation. The field asks how much a learner retains, how much it can still acquire, and whether earlier learning helps later. Task-free formulations drop the assumption that boundaries are announced. Regularization methods protect the parameters that earlier tasks depend on, and replay methods make the question of what to keep explicit, fixing a budget and selecting into it by the gradients a sample constrains. Our setting inherits the question but removes the budget, because a file system imposes none, so what to discard is decided free of the pressure of a full buffer.

Studies of continual learning in agents differ in what changes during learning. In-context learning changes nothing persistently and is bounded by the context window. Even so, CL-Bench finds that keeping the full context outperforms several purpose-built memory systems, a baseline any memory architecture must beat. Memory systems change an external record, eliminating parametric forgetting but replacing it with a retrieval bottleneck and with consolidation error. Skill libraries change a set of reusable procedures, on the premise that the collection only grows, the premise our boundary counts contradict. Harness and loop engineering change the scaffold around a fixed model. These approaches require a predefined space of admissible edits and a corpus of prior trajectories, and neither exists on first contact with a single unseen environment. Test-time training changes weights transiently, and memory written as code is its non-parametric counterpart: the state is a directory of scripts and the update rule is the agent writing code.

Common to these families is that the representation in which knowledge is held is chosen in advance rather than by the agent, and that retention and transfer are estimated from task performance rather than read from the stored knowledge itself. Interpretability research answers opacity inside the model with instruments: circuit tracing recovers a graph of the internal computation at substantial cost per prompt. In this work, by contrast, the agent holds its state in files, which provide a complete trace of what it keeps, revises and discards across tasks.

ARC-AGI-3 and the level as a task

The public demo dataset has 25 such games. A game is a sequence of levels, and clearing one loads the next inside the same episode. The grid size, the action names and the scoring are constant across a boundary. The layout, the objects present and the winning condition change, often enough to invalidate the rules the agent learned on the previous level. Our first agent cleared level 1 (L1) of wa30 on a theory of “pushable boxes” and then failed L2 by exploiting the same theory. ARC Prize gives the same warning: without a check on why a level was won, a model carries its misconception forward.

Memory as executable code

The runs studied here keep the remainder of their memory as executable code, the scripts, whose outcomes at a task boundary are reported in Sections 4.1 and 4.2. A rule written as a script can be run against the recorded history, and a mismatch tells the agent that its model needs revision. The memory then accumulates as a set of artifacts (parsers, state reconstructions and simulators) that persist in a directory and can be read from outside, which is the trace this paper follows.

A turn is one call to the analyzer. The model is called once, works, and emits a plan of up to the action cap, after which the runner executes the plan and calls the analyzer again. Each turn runs the analyzer as a Strands agent, a ReAct loop of roughly ten tool calls that searches the log, writes a parser, runs it, inspects the output, revises and emits the plan. Six tools run inside a sandbox with no network and writes confined to the workspace of that game, so the agent can neither consult outside information nor see the files of another game. The system prompt describes only the interface, naming the actions without saying what they do and asserting no structure, not even that a controlled entity or an objective exists. One prompt serves all 25 games.

Only the actions sent to the game are counted, while reasoning, tool calls and retries are not. Every action spent probing a mechanic therefore costs score, and every script run against the log is free, so the agent is rewarded for running its scripts on logs.txt, the record of every action already taken, rather than probing again. The setting is also close to task-free, since the agent is told nothing about task identity and receives no reward during the episode, so it alone decides when to change its model.

Measurement at a task boundary

Boundaries are recovered from the run log, which timestamps every level completion, and each script is assigned to the task open at its write time. The console logs of the Qwen runs were not retained, so their boundaries come from the level number stored with every action in the interaction record. Three Qwen games write no such record and are excluded, so 94% of Qwen scripts and all Anthropic scripts are assigned.

Rewritten scripts

Rewriting is frequent and its unit is a single script. In R4, 230 of the 734 scripts are a new version of an earlier one, 101 scripts reach two or more versions and one reaches twelve. The three Opus 5 runs write each new version as a separate script and never call the file-editing tool. Across the seven runs, 2,319 scripts were written before a boundary, and 523 of them were rewritten after it. In R4 the figures are 565 and 117.

New versions are largely retyped rather than extended. When a script is rewritten, the new version drops 56% of the functions of the old one in R4, 62% and 61% in R2 and R3, 38% in R1, and 73%, 74% and 52% in R5, R6 and R7.

What survives a rewrite is the part that does not depend on the level. The game su15 splits cleanly. The L6 simulator keeps five functions of the L5 simulator unaltered and replaces four, the disc the player moves, the pieces on the board, the chasing units and the winning condition. The five kept functions encode the rules of the game, the four replaced ones the layout of L5. Writing a new version is the moment the agent must separate the rules of the game from the contents of a level.

Scripts reused by reference, reused by copying, or abandoned

Reuse by reference stays inside a level and almost never crosses one. Across the seven runs a script imports or execs another 630 times. In 597 of these cases both scripts belong to the same level, so the reuse is within a task and is not a boundary outcome. In the remaining 33 the imported script belongs to an earlier level.

A referenced script is not a library, because it runs code the moment it is imported. Of the 273 referenced scripts, 263 do this and 229 embed five or more numbers in that code, such as the dimensions of the current level. The L5 simulator in the R4 game sp80 opens with ROWS=19 and COLS=19, fixing the board size as it loads. All four scripts that import it were written during L5. L6 has a different board, so on L6 the script is invalid on import, before any of its functions is called.

Only the three Opus 5 runs (R2–R4) reuse any script across a level change. R1 and the three Qwen runs (R5–R7) reuse none, neither by reference nor by copying. R1 does copy 137 bodies within levels, more than any other run, so it reuses scripts but never across a level. What the Opus 5 runs move into a later level is a copied function rather than a retained artifact. These runs accumulate versions rather than the growing library of reusable procedures that skill-library designs assume.

Abandonment is the remainder and the most common outcome. Of the 2,319 scripts written before a boundary, 1,726, or 74%, are neither rewritten nor reused after it. Per run, the abandoned share is 60% in R3, 73% in R2, 74% in R4 and 88% in R1, and 84% in R5, 93% in R6 and 100% in R7. In R1, R5 and R6, which reuse nothing across a level, every script that is not abandoned was rewritten. R7 passed few levels, so only 17 of its 169 scripts were written in a level the agent later passed, and none of the 17 was rewritten.

Updates to the notes

The notes have a single outcome, growth. The two parts of the memory have different readers. Scripts are written to compute facts from the record, and 1,979 of the 4,907 open logs.txt. The notes are written for the model and have no other reader. A claim in the notes is therefore not checked by execution directly, and a correction is appended rather than applied, so it takes effect only when the model re-reads the file.

A corrected claim is never removed. In the R4 game wa30 the notes first describe a two-cell model of the player. A later section titled KEY MECHANIC CORRECTION declares it wrong and replaces it with a one-cell model. Eighty actions later a section titled MAJOR REVISION restores the two-cell model. The first model was right and the correction wrong, yet both remain in the file 65 lines apart, and neither is marked as withdrawn. In sb26, R2 and R3 each add a section titled CORRECTION and leave the false sentence standing above it. The agent works around a contradiction rather than settling it, which is workable because logs.txt lies outside the memory and decides between the claims the memory cannot reconcile. The notes are a dated record of past beliefs rather than a statement of current ones, which is what makes them traceable. Every thought the agent held about a game, including the ones it later abandoned, is still there in the order it was formed.

Negative transfer from stale memory

The failure that recurs in both model families is negative transfer from stale memory, a belief that is true in one task and false in the next. The log of the first task cannot expose it, because it is true there. Both kinds of memory carry it into the next task, each rewrite by retyping the constant into the new version (Section 4.1) and the notes by restating it (Section 4.3).

The same failure appears in the Qwen runs, and in R6 the repair runs backwards. In the game tu93 the L2 simulator takes the step size as an argument, def move(r, c, mv, n=2,…). The L3 rewrite replaces the function with a table of fixed offsets, DIRS={’ACTION1’:(-2,0), ’ACTION2’:(2,0),…}, so the value that L2 had left open is closed again. The pattern holds across R6, whose scripts hold almost one hard-coded number per line of code. The cases in both families share one structure. A value that changes from level to level is written into the script as a constant, and the repair, where one was made, turns that constant into a parameter.

Conclusion

We traced how a coding agent learns across the abstract reasoning tasks of ARC-AGI-3 by reading the scripts and notes it writes and the log the harness keeps, and the same outcomes appeared, in different proportions, in all three backbones. The agent reuses scripts within a task, and across tasks it rewrites a few, copies a function from fewer, and abandons most, keeping the general rules and dropping the level-specific details. The notes only grow, and the log settles what they cannot. In the taxonomy of continual learning this is the isolation strategy, adopted without instruction. The agent discards only beliefs, never evidence, so a wrong disposal costs a re-derivation rather than a competence, and forgetting is selective rather than catastrophic. The most costly error is a hard-coded value carried into a task where it no longer holds, and the fix the agent found, turning the constant into a parameter, is as visible in the trace as the error. Learning in this agent takes place in its memory, proceeds by selecting what to keep and what to discard, and every step of it leaves thoughts that can be traced, making the continual learning of a coding agent transparent from the first task to the last.