Agent trajectories as programs: fingerprinting and programming coding-agent behavior Hamidah Oderinwale∗
arXiv:2606.16988v1 [cs.SE] 15 Jun 2026
May 2026
Abstract Benchmark scores tell you what an agent got right; they do not tell you how it got there. In this work, we introduce methods for comparing agents procedurally in different contexts, where the model, tasks, and approaches vary. We compare ten agents and find that they are identifiable by their behavioral habits, which we define as fingerprints: a probe over these procedural signatures attributes an unseen trajectory to the correct agent at 85.7% accuracy. We develop procedural representations for agent problem-solving procedures with an emergent vocabulary induction technique which is meant to be maximally compressive to avoid surface-level variation while being expressive enough to unveil the quirks of the models’ patterns. We apply our framework to the software engineering evaluation dataset SWE-Bench to study the structural distinctness of agent trajectories and find that behavior is most similar between models from similar release periods and those that are distilled from one another (e.g., a distilled student model and its teacher have a Jensen-Shannon divergence of 0.25, about half the distance between other model pairs). As more models saturate evaluations, we believe that it will be important to probe model behavior along more holistic dimensions than success rates alone. We introduce ProcGrep, a library for auditing and evaluating agents for how they approach tasks at a procedural level given their traces in a top-down fashion. One application of ProcGrep is searching over past events. We show that ProcGrep outperforms LLMs on episodic search in both efficiency and accuracy, offering a deterministic, programmable approach to searching over traces. We believe this work has a range of applications to help developers work with and program coding agents, such as task-aware model routing, agent monitoring, and finer-grained cost analysis.1
1
Background
As agent-style programming becomes more accessible, engineers will spend less time writing code directly and more time shaping how their agents frame and solve problems in the form of scaffolds— the wrappers around models that determine which tools they can employ, how they acquire context, and how they react to feedback. That said, traditional program analysis methods are too static to support this reliably and at scale [Austin et al. 2021, Chen et al. 2021, Jimenez et al. 2024, Yang et al. 2024]. In this work, we introduce a suite of procedural programming tools and analyses on agent traces from software engineering evaluations to address this problem. We motivate this work by showing how variation in agent behavior affects outcomes. While traces can be interpreted in isolation, there is much to gain from studying them in aggregate—tapping into collective wisdom [Alizadeh et al. 2015, Surowiecki 2004]—yet there is a lack of tools for doing so, as meaningful comparison calls for shared representations. ∗ 1
Email: [email protected], Work done with support from Taste Labs ProcGrep is available at https://github.com/hamidahoderinwale/procgrep.
1
While chain-of-thought has proven itself (eliciting rationale from the agent) useful for post-hoc rationalizing—it cannot be taken as grounded accounts of action [Guan et al. 2025, Ross et al. 2025, Wei et al. 2023]. Given this, in this work we explore representations from traces to turn them into structured objects and motivate the need for doing so, and we employ our suite of analytical tools to study the different trajectories that agents take outside controlled settings (in an area of work we call behavioral fingerprinting). The goal is to expand the evaluation of agents beyond whether they simply pass or fail a task by venturing into the analysis of their procedural habits or “style” [Bisztray et al. 2025]. Additionally, we propose a number of interfaces and measurement frameworks to make these kinds of studies more accessible. This is our motivation for building ProcGrep which is a framework for setting up agent studies and studying their procedural variation. Previous work has explored solution variation at scale for MOOCs (massively online open courses) to observe behavior with clustering [Glassman et al. 2015]. Platforms like LMArena compare agent outputs by evaluating preferred outputs in a pairwise fashion [Chiang et al. 2024]. Prior work has investigated using LLMs to generate plans from formal specifications [Silver et al. 2024]; with procedural representations it is possible to do the inverse, where queries can be written as procedural specs to ‘grep’ traces. [Yin and Neubig 2017b]. Observational studies of LLM chats have been performed at scale to understand trends in model use [Chatterji et al. 2025, Tamkin et al. 2024]. Frameworks have also been introduced for configuring models as agents to perform multi-step tasks with their own feedback loops given a goal specified upfront with ‘discovered’ end states [Yao et al. 2023]. And past work has also shown that coding style can be derived from source code using ASTs and decision trees in the form of random forest classifiers [Caliskan-Islam et al. 2015]. Existing frameworks have been built for code alone in siloed environments where context is missing, looking at patches [Falleri et al. 2014, Yin and Neubig 2017a] with ASTs (abstract syntax trees) which generalizes across languages. We make use of established parsing methods and extend them to work in multi-modal free-form environments where prompts, for example, are written in natural language [Cruz et al. 2026] demonstrating that a rich set of features can be observed and made sense of. Next, given one’s ability to audit procedures, there is an avenue for work which involves seeing what processes yield the best outputs. A new kind of model routing adapted to preferences could blossom by extending on our explorations [Hu et al. 2024].
2
A theory of procedural understanding
Framing agent coding traces as procedures lets us comparatively study and interact with them in ways that are useful for benchmarking, evaluating the difficulty of evals themselves, differentiating models by their behavioral fingerprints, and performing procedural search. We release a library called ProcGrep to support these use cases. For example, ProcGrep supports queries such as the following. “All Claude-4 trajectories from the past two weeks on Python repositories where search repo was followed by three or more read file calls within the first 8 steps, the agent then made at least one edit, and no run test occurred before the final submit—on instances with difficulty score above 3.”
In this work, we use traces for a number of popular software engineering benchmarks and test a number of SOTA model families (GPT, Claude, DeepSeek, and Qwen). We use public archives of model traces for SWE-Bench (princeton-nlp/SWE-bench-experiments) and do the same for Agentless logs. Table 1 lists the full set of agents studied: ten agents across four scaffolds (SWE-agent, Agentless, DARS, Moatless) with models from the GPT, Claude, DeepSeek, and Qwen families.
2
Scaffold
Model
Paradigm
SWE-agent SWE-agent SWE-agent SWE-agent SWE-agent SWE-agent DARS Agentless Moatless SWE-agent
Claude-3 Opus Claude-3.5 Claude-3.7 (thinking) Claude-4 GPT-4 GPT-4o DeepSeek-R1 Claude-3.5 DeepSeek-V3 SWE-agent-LM-32B†
RLHF dense RLHF dense Extended thinking Extended thinking RLHF dense RLHF dense RL reasoning RLHF dense MoE pretrain SFT-distilled (Qwen2.5-32B)
n 300 289 284 288 300 278 300 300 300 499
Table 1: Models and scaffolds studied with the number of task instances per agent (ten agents). † Distilled from the Claude-3.7 teacher (row 3); analysed in §6. We define what is the appropriate language to describe and program their behavior. What we call a “procedural fingerprint” is recovered from what an agent actually did (its trajectory) rather than its components or what it states. A fingerprint is a distinguishable feature of an agent from other agents and is consistent over time. Firstly, we demonstrate that these fingerprints do in fact exist, and different models are differentiable by their architectural types. We find that models are distinguishable by their fingerprints alone at 85.7% accuracy compared to a random baseline of 11.1% when selecting a model by chance. We attribute this to problem solving style [Bisztray et al. 2025]. Furthermore, we extend this to deterministic scaffolds such as Agentless and Moatless to see if they affect procedural behavior and they also imprint unique fingerprints that are identifiable with near perfect accuracy. We performed the comparisons in pairwise settings, to understand distinguishability and we find that Claude-4 and SWE-agent-LM-32B are the most identifiable, whereas GPT-4 and Claude-3 Opus are the most confusable (F1 0.20–0.30). We show the discriminating action pairs for each agent and demonstrate how much signal for differentiability they offer–in other words, how discriminative they are. We find that deterministic agents have the most discriminating pairs. For example, DARS over-uses search repo→create file by 31.6× and Moatless edit→submit by 15.7×. Interestingly, looking at distilled models that are taught via the rollouts of their teacher (Claude-3.7 Sonnet), we see some semblance of learned behavior where procedural habits are passed down to student (SWE-agent-LM-32B) models. 2.1
Inducing action vocabularies
Given a set of procedures that we might want to compare, which we can call a procedural space, we need a vocabulary or a set of actions that we can use to describe all of them. The contributions of this framework comes from being able to define this vocabulary bottom-up instead of with a more hard-coded or classifier based approach. We benchmark our methods against prompt-based classifiers, finding that across four judge models, prompt-based classifiers have near-zero agreement across model families and struggle to identify compositional trajectories. This affirms our motivations for having representations that can be shared across models and instances to allow for comparative analysis (Table 12). This means that there are features of the full vocabulary or alphabet which we can study in itself and can form the basis of insights. To define our vocabulary, we need to be able to extract these procedures and label them to understand what they are. Each procedure should be composable and collapse into one another because steps are taken in sequence for specific tasks and to avoid redundancy—where each procedure of the trajectory should be meaningfully unique or composed of unique sub-procedures. We find that procedural diversity does not correspond with capabilities, 3
Agent
Signature transition
DARS+R1 Moatless+V3 Agentless+Claude-3.5 Claude-3.7-thinking SWE-agent-LM-32B Claude-4 Claude-3 GPT-4 GPT-4o Claude-3.5
search repo→create file edit→submit run test→run test create file→run test create file→run test read file→read file create file→edit create file→edit run test→edit run test→edit
Discrim. factor (×)
Share
31.6 15.7 12.5 9.7 6.0 5.0 4.7 3.3 3.3 2.5
0.022 0.064 0.111 0.029 0.023 0.603 0.117 0.092 0.141 0.115
Table 2: This table ranks the action pairs that distinguish agents. We put the discrimination factor in the third column which shows the amount of signal that can be derived from the action pair compared to the random baseline. Share represents the frequency of the transition with respect to the total number of action transitions. where stronger and newer extended-thinking models do better with fewer procedures (Claude-3.7 = 32, Claude-4 = 35) compared to older Claude-3/3.5 models, which have repertoires of 42–44 procedures—which is relatively counter-intuitive. 2.2
An information theory of procedures
Because of this, we do not rely on a stopping point defined by behavior as in library learning, and instead determine it intrinsically. Metrics such as compression ratio, entropy, and vocabulary size characterize a vocabulary but do not on their own mark where to stop. We therefore treat the induction of a vocabulary as a similar class of problem to a clustering one, and draw on how clustering algorithms are evaluated to form the basis of an emergent stopping criterion [Rosenberg and Hirschberg 2007]: the V-measure. We consider a vocabulary stable when it maximizes two measures: completeness, meaning the sub-actions of each procedure are correctly aligned with an intent, and homogeneity, meaning a procedure contains only actions that belong to it. In our sweep, the V-measure rises, plateaus across vocabulary sizes K = 128–256, and then degrades; we take our stopping point at the plateau’s peak, K = 192 (V-measure 0.644).
4
Figure 1: V-measure of BPE vocabulary clustering against agent labels as a function of vocabulary size. BPE or Byte-Pair Encoding is a useful analog for this process and we employ it to induce our vocabulary. While BPE chunks natural language tokens by merging those that frequently appear together to compress the data for pre-training LLMs, we chunk actions from generated code [Sennrich et al. 2016]. The idea of learning action vocabularies bottom-up is drawn from library learning and program synthesis [Ellis et al. 2020], where recurring procedural subsequences are abstracted from longer programs. While they are typically tied to specific tasks to improve performance, we do so largely for the emergent representations they offer. Additionally, BPE is just one algorithm for accomplishing this chunking, we evaluate BPE and PrefixSpan along the metrics that we care about in this work, but acknowledge that certain methods might favor different goals and find that BPE offers better separability (Figure 9). h·c h+c where homogeneity h and completeness c are defined as V =2·
h=1−
H(actions | procedure) H(actions)
c=1−
H(procedure | actions) H(procedure)
H(actions | procedure) measures the confidence of belonging of an action to a procedure, and H(procedure | actions) measures the reverse. A vocabulary is stable when V is maximized. To extract the actions themselves, we take code hunks—solution patches—from these evaluation datasets and then parse them with an AST that gives a node tree and a syntactical and semantic representation of the code. Given the structural representation of the solution patches, we then apply an embedding stage to encode the change in plain language and the underlying intent by contextualizing the structured patch with the surrounding code and a behavioral description from the model. We investigate entropy, and use Jensen–Shannon Divergence (JSD) to study how models diverge from the norm. This is important for detecting out-of-distribution behavior which may be useful in 5
Figure 2: Illustrative figure of the process of vocabulary induction given an agent trace. observational settings. Entropy (H), a measure of uncertainty in a distribution (where a distribution here is the probability over all the possible actions in our vocabulary), is a property that can be applied to a single agent’s distribution of actions, where it is defined as: H(pa ) = −
X
pa (v) log2 pa (v)
v∈V
JSD allows us to build on entropy and measure how different two distributions are. We denote the agent distributions a and b, where pa and pb denote the action distributions of agents a and b. JSD(pa , pb ) = H
pa + pb 2
1 1 − H(pa ) − H(pb ) 2 2
Across all models, passing behavior includes a higher ratio of browsing to other actions. Extended thinking Claude models spend the largest proportion of their time in the shell compared to older models with more even task breakdowns. Models in the GPT family have more consistent behavior, but newer ones spend more time editing. Agent harnesses have less task diversity, potentially due to their programmed behavior and have more distinct breakdowns, the Agentless agent spends a disproportionate amount of time browsing and the Moatless scaffold leads to a large proportion of testing. An interesting application of this is forecasting the costs of an agent, as it is not only a product of the cost per tool call, but a function of the action types needed to complete it and the procedural tendencies of the model being orchestrated.
6
Figure 3: Cost breakdown of agents by action type and tokens. Scaffold
Model
Paradigm
SWE-agent SWE-agent SWE-agent SWE-agent
Claude-3 Opus Claude-3.5 Claude-3.7-thinking Claude-4
RLHF dense RLHF dense Extended thinking Extended thinking
300 289 284 288
11.7% 23.9% 50.7% 59.0%
17.1 32.7 33.6 64.8
44 42 32 35
0.537 0.559 0.471 0.417
5.58 5.56 5.14 5.26
$3.42 $1.62 $0.78 $1.19
$0.200 $0.050 $0.023 $0.018
$29.31 $7.06 $1.53 $2.02
SWE-agent GPT-4 SWE-agent GPT-4o
RLHF dense RLHF dense
300 278
18.0% 19.8%
21.4 39.1
40 49
0.443 0.425
5.47 5.76
$2.51 $2.53
$0.117 $0.065
$13.93 $13.82
DARS Agentless Moatless
RL reasoning RLHF dense MoE pretrain
300 300 300
47.0% 40.7% 30.7%
24.0 13.0 13.1
19 1 12
0.572 0.077 0.417
4.44 0.00 3.71
$2.43∗ $0.50∗ $0.02
— — ≈0
$5.17∗ $1.23∗ $0.06
DeepSeek-R1 Claude-3.5 DeepSeek-V3
n Resolve Steps Repertoire Compr. Entropy Cost/task $/step Cost/resolved /traj @90% ratio (bits)
Cost estimated. $/step = cost per inference call. Extended thinking models reduce cost per step by routing calls through the shell and orchestrating them before invoking the more expensive inference calls (Claude-4: $0.018/step vs. Claude-3: $0.200/step). ∗
Table 3: Per-agent procedural fingerprint and cost efficiency on SWE-bench Verified (n = 2,639).
3
Why procedural representations matter
Given theoretical grounding, we put foundations to work in a number of ways. In this section we look at top-down analyses given agent traces. Firstly, we show that these approaches offer a more grounded representation of process than what can be elicited from models in natural language alone. We ask two questions: given what a model says it will do, what does it actually do (forward followthrough)? Then, given what a model says it did, what did it actually do (reverse follow-through)? Lastly, we show how procedural representations allow for structural search over traces. We find that both model families have high reverse follow-through rates, where every action they take is mentioned somewhere in their reasoning. For GPT-4 and GPT-4o the reverse follow-through rate is 1.0, and for DARS+R1 and the Claude family (Claude-3 / 3.5 / 3.7 / 4) it is high but not complete (0.875 / 0.857 / 0.833 / 0.800 / 0.750, respectively).
7
Figure 4: Average number of steps per resolved tasks across agents. Representation Structural pattern overlap Action sequence distance Edit action overlap Narrative description Agent plan description Divergence classifier (LLM) Random retrieval
n
F1 (k=1)
Source
289 289 289 289 289 87–286
0.347 0.274 0.256 0.177 0.155 0.000–0.363
Deterministic Deterministic Deterministic Varies by model Varies by model κ < 0.05 (cross-family)
289
0.13–0.24
Baseline
Table 4: Comparison of different procedural representations by their ability to signal whether the agent succeeded or failed, scored with F1 on single nearest-neighbor prediction. We find that representations derived directly from the trace beat the random baseline (0.13–0.24), and that natural-language accounts barely improve on it.
Figure 5: Follow-through for behavioral accounts from the Claude and GPT model families. We also assess precision in the behavioral descriptions themselves as a proxy for ‘groundedness’ from a representation. We find that models are generally verbose in their accounts, which might 8
be a signal of performative chain-of-thought [Boppana et al. 2026]. For example, the GPT family are trained with heavy RLHF and instruction-tuning. Whereas the Claude family of models are presumably trained to follow more sprawling reasoning patterns before coalescing them into some preferred approach. Extended thinking models are the most verbose and have similar behavior to our baseline of shuffled rationales. Model
n
Verbosity
Precision
Baseline
Recall
Claude-3 Claude-3.5 Claude-3.7-thinking Claude-4
300 289 284 288
1.07 1.00 1.35 1.32
0.833 0.857 0.625 0.500
0.678 0.732 0.623 0.536
0.857 0.833 0.800 0.750
GPT-4 GPT-4o
300 278
1.17 1.18
0.800 0.750
0.713 0.679
1.000 1.000
DARS+R1
300
1.07
0.857
0.775
0.875
Currently, it is difficult for a developer to search through their agents’ history without employing an LLM. The agent first has to surface the code it wrote, with context that it may or may not have written to memory. With ProcGrep, search can be deterministic in the same way that writing a SQL query is. We compare search with ProcGrep against LLM judges over the same queries, taking the deterministic structural match as ground truth. We find that ProcGrep is exact on queries spanning a range of agent actions: context retrieval and the number of files read; conditional events, where an action is retrieved based on a preceding event; and missing actions, where an event is retrieved by the absence of an action. Method
Mean F1
Latency/decision
ProcGrep (structural query)
1.000
1.1 µs
Claude Sonnet 4.6 GPT-4o GPT-4o-mini Claude Opus 4.8 Claude 3.5 Haiku DeepSeek-chat
0.278 0.230 0.221 0.152 0.098 0.093
1.71 s 0.66 s 0.69 s 1.73 s 1.03 s 1.51 s
Table 5: Answering the same queries: ProcGrep versus LLM judges.
4
Natural studies with procedural representations
With this data, we can also validate other kinds of inferences regarding the shapes of problems and model behavior. For example, past work has found that models struggle with compositional generalization—this means that they are brittle in contexts where they need to do incremental work. We validate this in the wild and find that problems that require compositional generalization, defined by problems that have nested procedures, are especially difficult for agents, as evidenced by their failure rates. We define compositional problems as ones where the subproblems are ones that have been solved by the agent before, but when put together the agent failed. Looking at Figure 6a we can observe that compositionality is a relatively strong signal of failure, followed by novel actions, and familiar procedures yield the lowest failure rates. However, the pattern holds the most strongly for RLHF-trained models and much more modest for more classically trained models. 9
Across models, similar trends hold, but open-weight agents have lower failure rates to compositional problems—when computing the difference of open-weight model failure at all points compared to other model families is ∼9%.
(a) Relationship between compositional problems and pass rate across models.
(b) Failure type distributions by model family.
Figure 6: Model behavior on compositional tasks. Next, developers make a number of decisions to train and scaffold their models. We set out to understand how this affects model processes based on a set of tasks and find that “fingerprints” are recoverable—unique model-specific patterns regarding tool-use and order of operations that can be attributed back to an agent. Given certain parameters like the costs for different types of actions and the length of a task, hopefully this can form the basis of more informed model choice and configuration decisions depending on a developer’s goal (i.e. task and workflow-aware routing). For a given model, its procedural space can be described by its entropy and compression, where entropy describes the variance of the actions and compression is a rough proxy for repetitiveness. We find the GPT-4o has the most diversity of actions compared to Claude models. Entropy is just one method of characterizing procedural behavior given a trajectory and it makes sense that there is some level of behavioral similarity for models of the same family and harness—suggesting that architectural design choices bleed into procedural tendencies. We compare the divergence of procedural distributions with JSD to test and find that scaffolds and model generation are the strongest indicators of procedural habits compared to the model generation in distilled model pairs, suggesting that the generation of the model and programmed behavior play a disproportionate role and that a distilled student’s procedural style is largely derived from its teacher. See Figure 10 for a matrix showing all the pairwise divergence rates across models. Factor
Comparison
JSD
× floor
Lineage Family Scaffold
teacher → distilled child within family, across generations same model, two harnesses
0.250 0.518 0.533
3.0 6.3 6.5
Table 6: Procedural divergence across agent distributions, grouped by agent type.
10
4.1
How agents acquire context
We also look at the breadth of files that agents access. We believe this is a measure of efficiency and localization ability. In other words, the file coverage is a proxy for the range of the codebase that the agent interacts with. Claude-3.5 has the largest range, with a mean of 2.41 files per task, compared to an average of 1.66-1.90. However, the pass rate of the model is not proportional to the number of files that it accesses, where for every model there is usually a tipping point where accessing files becomes a signal of struggle rather than success. We observe this more broadly across agents where the highest pass rate instances are correlated with fewer files being edited, while there is a drop in pass rate (steeper for older models and milder for newer ones) when file edits increase—likely suggesting that success on a problem is tied to how easy it is to pinpoint.
Figure 7: Figure plotting agent pass rate by the number of files changed. We observe that a low file change rate is lightly correlated with pass rate, potentially because it means the scope of the solution was more straightforward, compared to complex tasks that are either hard to localize or require a breadth of files as context to solve. We can also use our framework to understand trajectory anomalies as it pertains to context retrieval to offer developers useful signal for when their agents are failing. For instance, out of all 63 times that Agentless “wins”—where it successfully passes a task that SWE-agent does not—SWEagent’s failures are marked by long edit streaks: it is over twice as likely to make five or more edits in a row when it fails as when it succeeds. Agentless is an overall more efficient agent, as it will require an average of 13 steps, where it will localize the error, patch the problem, and validate in a clean loop, compared to SWE-agent’s average of 33. Outcome Both pass SWE-agent only Agentless only Neither passes
n
Difficulty
SWE-agent steps
Agentless steps
54 15 63 157
7.17 4.53 4.59 0.69
20.4 30.7 33.3 36.8
13.0 13.0 13.0 13.0
Total
289
Table 7: Outcomes of two agent scaffolds on 289 tasks.
11
5
Controlled evaluations with procedural controls
In agent programming and benchmarking, an engineer can specify parameters such as the number of tool use turns and response lengths in the form of tokens, but there is little control over how a task is done. Controlling for behavior at the level of actions is an under-explored way of assessing capabilities—while ablations are possible at different levels of abstraction, it is not possible to say a model can only retrieve context via grep or when, or run a certain number of tests and after what actions. Fingerprints give us behavioral trends that form the basis for predicting which actions a given agent is most likely to take, useful for next-action prediction and anomaly detection. We batch trajectories into five groups, training models on four and leaving one as a held-out test set using GroupKFold and see that fingerprinting accuracy is relatively unchanged when grouping by task (∆ = −0.007), demonstrating that identifiability is largely a function of style and not task memorization from the probe itself (for example, pattern matching certain actions to specific tasks). As shown in Table 8, agents fall into three regimes: deterministic scaffolds like Agentless, which are nearly fully predictable (82% accuracy, +51 points over baseline); constrained scaffolds like Moatless, where the scaffold drives behavior and the baseline is already high (73% accuracy, +8 points); and open-ended model-driven agents like Claude and GPT, where predictions are stronger at the single-action level (e.g., Claude-3.5 at 50% accuracy, +33 points). We also find that edit streaks are a strong failure signal: for Moatless+DeepSeek-V3, 43% of trajectories have edit streaks of 5 or more, and of those, the fail rate is 80%, compared to 59% for no-streak trajectories. For Claude-3.5 the signal is weaker, with pass rate dropping from 26% to 11% with a streak ≥5, though the magnitude is comparable. Overall, we believe this makes a strong case for procedural representations as a basis for next-action and final state prediction. Next action
Next stage
Agent
Base Acc.
Claude-3 Claude-3.5 Claude-3.7-thinking Claude-4
13% 18% 23% 51%
GPT-4 GPT-4o
20% 57% +37 27% 60% +34
50% 56% +6 50% 62% +12
DARS+DeepSeek-R1 Agentless+Claude-3.5 Moatless+DeepSeek-V3
30% 46% +17 31% 82% +51 65% 73% +8
37% 49% +12 31% 82% +51 65% 73% +8
46% 50% 54% 61%
∆ Base Acc. +33 +33 +31 +10
33% 35% 44% 51%
47% 51% 65% 67%
∆ +14 +16 +21 +16
Table 8: Next-action and next-stage prediction accuracy across agent trajectories.
5.1
Programming procedural rewards
One application of ProcGrep is the ability to specify and reward model behavior on long-horizon tasks. Typically, reward systems for coding models have focused on binary outcomes, but trajectory specifications enable partial rewards based on procedural milestones, providing a denser signal that captures intermediate progress and can be more readily adapted to changing goals. With ProcGrep, rewards can be assigned to action sequences in uniquely fine-grained ways. Here, we design a specification to reward what we define as problem-solving best practices such as exploration, implementation, and test verification and to penalize long edit streaks that would burn resources 12
and a lack of search which suggests unsystematic problem-solving. phases: - name: exploration reward: 0.10 require any: [{atom: search repo}, {atom: read file}] min occurrences: 2 before first: edit - name: implementation reward: 0.15 require any: [{atom: edit}] - name: test verification reward: 0.25 require sequence: [edit, run test] max gap: 5 - name: completion reward: 0.10 require any: [{atom: submit}] penalties: penalty: 0.15 - name: edit streak pattern: [edit, edit, edit, edit, edit] contiguous: true - name: no search penalty: 0.05 require absent before: [search repo, read file] before first: bonuses: - name: test driven reward: 0.10 require sequence: [run test] before first: edit
edit
We show a snippet of the spec in YAML above and provide the point scheme below and a table of results where we show that Agentless+Claude-3.5 is the winning scaffold for following said instructions. Here, we hand-author an action sequence and the feedback derived from it, but do not close the loop with a trained model. Thus, we use the following as an illustrative example and recognize that crafting a state will depend on a variety of goals and decisions: {"instance id": "django django-12345", "proc score": 0.35, "binary pass": false, "satisfied phases": ["exploration", "implementation", "test verification"], "triggered penalties": ["edit streak"], "triggered bonuses": []}
Type
Component
Triggered when
Points
Phase
exploration implementation test verification completion
≥ 2 search/read before first edit any edit edit → run test within 5 steps any submit
+0.10 +0.15 +0.25 +0.10
Bonus
test driven
run test before first edit
+0.10
Penalty
edit streak no search
5 contiguous edits first edit with no prior search/read
−0.15 −0.05
Table 9: Point scheme for the procedural reward spec. Scores are bounded to the [0, 1] range and the maximum attainable score is 0.70).
13
n
Agent Agentless+Claude-3.5 DARS+R1 Claude-3.5 Claude-3.7-thinking Claude-3 GPT-4o GPT-4 Claude-4 Moatless+V3
300 300 289 284 300 278 300 288 300
Proc. Explore Test Testscore verif. driven 0.600 0.468 0.447 0.397 0.384 0.383 0.381 0.345 0.187
100% 33% 36% 97% 19% 23% 21% 100% 49%
100% 86% 90% 18% 88% 97% 85% 0% 0%
0% 0% 1% 17% 9% 2% 0% 1% 0%
Edit No streak search 0% 8% 16% 2% 12% 32% 21% 3% 41%
0% 34% 54% 0% 73% 70% 75% 0% 0%
Table 10: Procedural reward breakdown. In the following, we do a run to compare two procedural types (test-driven and patch-driven) across agent rollouts. For the test-driven specification, we reward interleaving edits with tests; for the patch-driven one, we reward the model going directly from edits to submission and penalize tests in this regime. With this, we can interpret the ∆ as how consistent each regime is with the model’s innate procedural tendencies (Table 11). Agent GPT-4o Claude-3 GPT-4 Claude-3.5 Agentless+Claude-3.5 DARS+R1 Moatless+V3 Claude-3.7-thinking Claude-4
Test-driven
Patch-driven
∆
0.562 0.541 0.515 0.565 0.700 0.550 0.095 0.285 0.200
0.399 0.399 0.452 0.513 0.700 0.557 0.456 0.677 0.692
+0.163 +0.143 +0.063 +0.052 0.000 −0.007 −0.361 −0.391 −0.492
Table 11: Mean procedural score under a test-driven vs. patch-driven spec, where ∆ > 0 shows that a test-driven regime is favored. With these examples, we hope to inspire what is possible to study, though we believe there are a number of configurations one could program depending on the use case. The scores we assign to the rewards are relatively arbitrary—our main contribution is building the means to specify them in the first place—and a meaningful area of future work is dynamic scoring that adapts to observed final states in continual-learning contexts.
6
Do students behave like their teachers? (a distilled model case study)
We consider a distilled model pair consisting of a teacher and a student model, where the student model is trained on trajectories generated by the teacher through supervised fine-tuning. While distillation is typically employed because it can produce performant models at a fraction of the cost, do students actually learn to problem solve like their parents and what value does this confer if they do [Hinton et al. 2015, Zhang et al. 2026]? We find that the student inherits the teacher’s full action vocabulary and shows concentrated entropy, which means that when the distilled model succeeds it has lower entropy and is more procedurally similar than when it fails, showing that procedural mimicry could be a means to improve success rates for distilled models. We analyze 284 parent 14
and 498 child trajectories using lineage diff across three axes: vocabulary preservation, entropy shifts, and outcome divergence. Stratifying by outcome at the native level, passing child trajectories share 0.204 of the parent’s tool signatures, whereas failing trajectories share only 0.193 (∆ = 0.01).
(a) Action entropy student and teacher model pair where the student’s action distribution is more concentrated (−0.41 bits).
Figure 8: Comparing the trajectories of distilled student-teacher pairs, comparing Claude-3.7 Sonnet (teacher) → SWE-agent-LM-32B (child) on SWE-bench Verified.
7
Conclusion
In this work we set out to define and motivate a new lens for studying agent trajectories, specifically in coding settings. They are natural exhaust from models that are being deployed for increasingly long-horizon tasks, and we believe there is a need for tools to make use of them to help a new age of developers who are tasked with deciding which models to employ and how to architect their agents. We validate procedural fingerprinting, demonstrating that problem-solving style is a real property of agent behavior and something that can be programmed. We find that agents are recoverable from their traces alone at a near 90% rate as compared to random baseline of 11%. We show that different models that would otherwise be studied in isolation can be compared through new methods for representing their traces and breaking them into meaningful sub-processes. We also show that certain procedural quirks are linked to success and failure, which can be the basis of inferring outcomes even when a full trajectory has not been carried out in its entirety, suggesting that telemetry can be a way to reduce overall compute spend. We are excited about new ways of applying ProcGrep–the library that was built to do the top-down analysis we put forth in this work—particularly, when training models to carry out long-horizon tasks with resource management in mind. In the future, we anticipate the methods put forth in this work can complement model diffing methods built to probe into models at a functional and behavioral level to produce more holistic analyses of agents [Aranguri and McGrath 2025, 15
Jiralerspong and Bricken 2026].
References Hosein Alizadeh, Muhammad Yousefnezhad, and Behrouz Minaei Bidgoli. Wisdom of crowds cluster ensemble. Intelligent Data Analysis, 19(3):485–503, June 2015. ISSN 1571-4128. doi: 10.3233/ida-150728. URL http://dx.doi.org/10.3233/IDA-150728. Santiago Aranguri and Tom McGrath. Discovering undesired rare behaviors via model diff amplification. Goodfire, 2025. https://www.goodfire.ai/research/model-diff-amplification. Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, and Charles Sutton. Program synthesis with large language models, 2021. URL https://arxiv.org/abs/2108.07732. Tamas Bisztray, Bilel Cherif, Richard A. Dubniczky, Nils Gruschka, Bertalan Borsos, Mohamed Amine Ferrag, Attila Kovacs, Vasileios Mavroeidis, and Norbert Tihanyi. I know which llm wrote your code last summer: Llm generated code stylometry for authorship attribution, 2025. URL https://arxiv.org/abs/2506.17323. Siddharth Boppana, Annabel Ma, Max Loeffler, Raphael Sarfati, Eric Bigelow, Atticus Geiger, Owen Lewis, and Jack Merullo. Reasoning theater: Disentangling model beliefs from chain-of-thought, 2026. URL https://arxiv.org/abs/2603.05488. Aylin Caliskan-Islam, Richard Harang, Andrew Liu, Arvind Narayanan, Clare Voss, Fabian Yamaguchi, and Rachel Greenstadt. De-anonymizing programmers via code stylometry. In Proceedings of the 24th USENIX Conference on Security Symposium, SEC’15, page 255–270, USA, 2015. USENIX Association. ISBN 9781931971232. Aaron Chatterji, Thomas Cunningham, David J. Deming, Zoe Hitzig, Christopher Ong, Carl Yan Shan, and Kevin Wadman. How people use chatgpt. NBER Working Paper 34255, National Bureau of Economic Research, Cambridge, MA, 2025. URL https://www.nber.org/papers/w34255. NBER Working Paper No. 34255. Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. Evaluating large language models trained on code, 2021. URL https://arxiv.org/abs/2107.03374. Wei-Lin Chiang, Lianmin Zheng, Ying Sheng, Anastasios Nikolas Angelopoulos, Tianle Li, Dacheng Li, Hao Zhang, Banghua Zhu, Michael Jordan, Joseph E. Gonzalez, and Ion Stoica. Chatbot arena: An open platform for evaluating llms by human preference, 2024. URL https://arxiv. org/abs/2403.04132. André F. Cruz, Jon Kleinberg, and Rediet Abebe. Text as the richest preference signal, April 2026. 16
Kevin Ellis, Catherine Wong, Maxwell Nye, Mathias Sable-Meyer, Luc Cary, Lucas Morales, Luke Hewitt, Armando Solar-Lezama, and Joshua B. Tenenbaum. Dreamcoder: Growing generalizable, interpretable knowledge with wake-sleep bayesian program learning, 2020. URL https://arxiv. org/abs/2006.08381. Jean-Rémy Falleri, Floréal Morandat, Xavier Blanc, Matias Martinez, and Martin Monperrus. Finegrained and accurate source code differencing. In Proceedings of the 29th ACM/IEEE International Conference on Automated Software Engineering, ASE ’14, page 313–324, New York, NY, USA, 2014. Association for Computing Machinery. ISBN 9781450330138. doi: 10.1145/2642937.2642982. URL https://doi.org/10.1145/2642937.2642982. Elena L. Glassman, Jeremy Scott, Rishabh Singh, Philip J. Guo, and Robert C. Miller. OverCode: Visualizing variation in student solutions to programming problems at scale. ACM Transactions on Computer-Human Interaction, 22(2):7:1–7:35, 2015. doi: 10.1145/2699751. Melody Y. Guan, Miles Wang, Micah Carroll, Zehao Dou, Annie Y. Wei, Marcus Williams, Benjamin Arnav, Joost Huizinga, Ian Kivlichan, Mia Glaese, Jakub Pachocki, and Bowen Baker. Monitoring monitorability, 2025. URL https://arxiv.org/abs/2512.18311. Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network, 2015. URL https://arxiv.org/abs/1503.02531. Qitian Jason Hu, Jacob Bieker, Xiuyu Li, Nan Jiang, Benjamin Keigwin, Gaurav Ranganath, Kurt Keutzer, and Shriyash Kaustubh Upadhyay. Routerbench: A benchmark for multi-llm routing system, 2024. URL https://arxiv.org/abs/2403.12031. Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. Swe-bench: Can language models resolve real-world github issues?, 2024. URL https://arxiv.org/abs/2310.06770. Thomas Jiralerspong and Trenton Bricken. Cross-architecture model diffing with crosscoders: Unsupervised discovery of differences between llms, 2026. URL https://arxiv.org/abs/2602 .11729. Andrew Rosenberg and Julia Hirschberg. V-measure: A conditional entropy-based external cluster evaluation measure. In Jason Eisner, editor, Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLPCoNLL), pages 410–420, Prague, Czech Republic, June 2007. Association for Computational Linguistics. URL https://aclanthology.org/D07-1043/. Alexis Ross, Megha Srivastava, Jeremiah Blanchard, and Jacob Andreas. Modeling student learning with 3.8 million program traces, 2025. URL https://arxiv.org/abs/2510.05056. Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units, 2016. URL https://arxiv.org/abs/1508.07909. Tom Silver, Soham Dan, Kavitha Srinivas, Josh Tenenbaum, Leslie Kaelbling, and Michael Katz. Generalized planning in PDDL domains with pretrained large language models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, 2024. doi: 10.1609/aaai.v38i18.30006. James Surowiecki. The Wisdom of Crowds: Why the Many Are Smarter Than the Few and How Collective Wisdom Shapes Business, Economies, Societies, and Nations. Doubleday, New York, 2004. ISBN 978-0385503860. 17
Alex Tamkin, Miles McCain, Kunal Handa, Esin Durmus, Liane Lovitt, Ankur Rathi, Saffron Huang, Alfred Mountfield, Jerry Hong, Stuart Ritchie, Michael Stern, Brian Clarke, Landon Goldberg, Theodore R. Sumers, Jared Mueller, William McEachen, Wes Mitchell, Shan Carter, Jack Clark, Jared Kaplan, and Deep Ganguli. Clio: Privacy-preserving insights into real-world ai use, 2024. URL https://arxiv.org/abs/2412.13678. Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, and Denny Zhou. Chain-of-thought prompting elicits reasoning in large language models, 2023. URL https://arxiv.org/abs/2201.11903. John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. Swe-agent: Agent-computer interfaces enable automated software engineering, 2024. URL https://arxiv.org/abs/2405.15793. Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. React: Synergizing reasoning and acting in language models, 2023. URL https://arxiv.org/ab s/2210.03629. Pengcheng Yin and Graham Neubig. A syntactic neural model for general-purpose code generation. In Regina Barzilay and Min-Yen Kan, editors, Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 440–450, Vancouver, Canada, July 2017a. Association for Computational Linguistics. doi: 10.18653/v1/P17-1041. URL https://aclanthology.org/P17-1041/. Pengcheng Yin and Graham Neubig. A syntactic neural model for general-purpose code generation, 2017b. URL https://arxiv.org/abs/1704.01696. Ruixiang Zhang, Richard He Bai, Huangjie Zheng, Navdeep Jaitly, Ronan Collobert, and Yizhe Zhang. Embarrassingly simple self-distillation improves code generation, 2026. URL https: //arxiv.org/abs/2604.01193.
18
Table 12: Agreement and compositionality metrics across LLM judges. Judge GPT-4o GPT-4o-mini Qwen-2.5-72B Llama-3.3-70B
% Compositional 38.1% 36.5% 17.2% 21.8%
A
Appendix
A.1
Algorithms for vocabulary discovery
A.1.1
F1 (k=1) Pass/Fail 0.363 0.246 0.167 0.000
Mean κ 0.136 0.156 0.128 0.123
Byte-Pair Encoding
Algorithm 1 BPE vocabulary induction Require: action sequences S = {s1 , . . . , sn }; target size K Ensure: vocabulary V ; tokenized sequences T 1: V ← {all atoms appearing in S} 2: T ← S ▷ each action starts as its own token 3: while |V | < K do 4: count frequency of every adjacent token pair (a, b) in T 5: (a⋆ , b⋆ ) ← arg max(a,b) freq(a, b) 6: if freq(a⋆ , b⋆ ) = 0 then break 7: end if 8: t ← a⋆ +b⋆ ; V ← V ∪ {t} 9: replace every adjacent occurrence of (a⋆ , b⋆ ) in T with t 10: end while 11: return V, T A.1.2
PrefixSpan
Algorithm 2 PrefixSpan (single-item event sequences) Require: sequences S; minimum support σ Ensure: frequent sequential patterns P 1: function PrefixSpan(α, S|α ) 2: for each action b with support(b, S|α ) ≥ σ do 3: α′ ← α · b; P ← P ∪ {α′ } 4: S|α′ ← { suffix of r after its first b : r ∈ S|α } 5: PrefixSpan(α′ , S|α′ ) 6: end for 7: end function 8: P ← ∅; PrefixSpan(⟨⟩, S) 9: return P
19
▷ S|⟨⟩ = S
A.2
Classifier prompt
Judge classifier prompt You are evaluating a software engineer’s response to a bug report. You are given the reference patch—the actual fix—and use it as ground truth. Bug report: Reference patch: Response:
{problem statement} {gold patch} {response}
Reason briefly about each dimension, then score it 0–3 (0 = wrong, 3 = exact match to the reference): • localization — same file/function as the patch? • edit type — right kind of change? • plan quality — would this plan reproduce the patch? • explanation — grounded in what the patch does? Identify the first plan step where the response diverges (−1 if fully aligned) and its level: • surface — wrong file/function name (token-level) • compositional — right location, wrong operation or order (syntactic-level) • relational — right operations, wrong dependency or interaction (graph-level) • none — no divergence
Output per-dimension reasoning, then: {"localization": int, "edit type": int, "plan quality": int, "explanation": int, "first deviation step": int, "divergence level": "surface|compositional|relational|none"}
Judge model
n
F1 (k=1)
% compositional
Mean κ
GPT-4o GPT-4o mini Qwen 2.5 72B Llama 3.3 70B
286 285 87 87
0.363 0.246 0.167 0.000
38.1% 36.5% 17.2% 21.8%
0.136 0.156 0.128 0.123
Weighted mean
745
0.253
–
–
Table 13: Comparing judges and their agreement. Overall, agreement is low across models with mean Cohen scores (κ) of 0.12–0.16. GPT family models have low agreement rates with open-weight models and same-family model pairs and open-weight models tend to agree with each other.
A.3
Procedural reward specifications
The test-driven and patch-driven specifications scored in Table 11. Both have a maximum attainable score of 0.70 before penalties.
20
test driven phases: - name: exploration reward: 0.10 require any: [{atom: search repo}, {atom: read file}] min occurrences: 2 before first: edit - name: test first reward: 0.20 require sequence: [run test] before first: edit - name: implementation reward: 0.10 require any: [{atom: edit}] - name: verification reward: 0.30 require sequence: [edit, run test] max gap: 5 penalties: - name: edit streak penalty: 0.15 pattern: [edit, edit, edit, edit, edit] contiguous:
true
patch driven phases: - name: localization reward: 0.20 require any: [{atom: search repo}, {atom: read file}] min occurrences: 2 before first: edit - name: implementation reward: 0.30 require any: [{atom: edit}] - name: completion reward: 0.20 require any: [{atom: submit}] penalties: - name: test thrash penalty: 0.15 pattern: [run test, run test, run test] contiguous: true - name: edit streak penalty: 0.10 pattern: [edit, edit, edit, edit, edit] contiguous: true
Figure 9: BPE separates agents better than PrefixSpan, scored by V-measure against agent labels. The golden set, derived from the evaluation dataset, treats a clustering as correct when every trajectory from a given agent is grouped with the others from that agent (e.g., all GPT-4o trajectories together, all Claude-3.5 trajectories together, and so on).
21
Figure 10: Ten agents compared by their pairwise divergence. Of all agent pairs, the distilled student (SWE-agent-LM-32B) is closest to its teacher (Claude-3.7 Sonnet), at JSD = 0.25.
Figure 11: Pass rate by trajectory length (canonical-action count). Pass rate declines modestly and in a non-linear fashion, from 45% at 1–10 steps to ∼29% beyond 60.
22