Field notes · Visualization × Agents

Reading Agents Like Trees

Scores tell you who won. They don’t tell you that one agent spent twenty minutes rerunning a failing test without reading the error. How I draw what coding agents do with their time, their reasoning, their memory and their context.

The short version

I run Codex and Claude on the same coding task in a small terminal tool, Duo, and record every step. The judges’ scores were easy to read and nearly useless, so I rebuilt the viewer around one question: what did each agent do with its time, its reasoning and its memory?

The views at a glance
ViewThe question it answersWhat it shows
Verdict cardWho won, why, at what cost, and how sure are we?Five evidence-backed lines; root cause stays a hypothesis until a rerun confirms it
TreeWhat shape did each run take?Loops, stalls, failed and repeated calls, checks, root cause, first divergence, memory carried in
Long runWhere did an hour-long run go wrong?Self-calibrated bursts, progress, regressions, the longest loop and stall, where to look first
Reasoning, memory & contextWhen does it think, what does it re-read, what fills its context?Thought-before-action, failures reasoned about, re-reads, context by source, measured context
AttributionWhich model wrote which part of the final answer?Per-sentence source: Codex, Claude, both, or new wording
Conversation memoryWhat does each chat turn still remember?Earlier turns carried in, and how much
Rewards & rolloutsHow reliably does a policy solve a task in an environment?Reward curves per episode, success rate with and without flagged episodes, pass@k and pass^k, where reward comes from
Over timeIs either model changing?Trends and recent shifts that survive a corrected significance test

About the screenshots. Every screenshot below comes from a synthetic demo trace I generated to show the views: a planted retry loop, invented tool outputs, made-up scores. The numbers in the pictures are illustrations, not measurements of Codex or Claude.

1. Start with five lines

Before any chart, the page opens on a verdict card. It answers the first five questions anyone asks about a comparison: who won, why, what it cost, what to change, and how sure we are. Several of these ideas come from AgentDiff, my earlier tool for diffing two agent runs.

Verdict card with five lines: VERDICT, CAUSE, COST, FIX and CONF
The verdict card. CAUSE links to the exact tool call the judges blamed. CONF never goes above “medium” for a single turn.

Two rules keep it honest. First, every line restates evidence already in the trace (the judges’ verdicts, the root-cause step, token usage), and a line with nothing to say is left out. Second, confidence uses one vocabulary everywhere. One turn is one observation, so it can never be “high”. And the root cause is a hypothesis until a rerun with the suggested fix actually changes the outcome (duo --fork TURN).

2. The run as a tree

The main view grows each run as a tree on a shared start line, so you compare shapes before you read numbers.

Two runs drawn as trees: Codex with a long amber loop and a root-cause ring, Claude short and finishing with green check fruit
Codex (top) loops for twenty minutes. Claude (bottom) reads the test, fixes the config and finishes. Synthetic data.

3. Long runs, at the scale they ran

A run that lasts an hour is mostly idle time punctuated by bursts of calls, and its loops last bursts, not steps. Drawn step by step, a three-hour run gets the same width as a three-minute one, and the loop that cost you the evening vanishes. So each run is also read at the scale it ran.

Long-run strip: bursts coloured by outcome, compressed idle gaps, a loop bracket and a look-first button
Bursts on a compressed clock: ✓ progress, ↻ loop, ! failing. The sentence underneath quotes every number it uses.

4. Reasoning, memory and context

This is the view I use most. Each model gets one card.

Two cards with stat tiles, a step strip with reasoning bars and memory arcs, and a stacked context-window chart
Codex thinks before 10% of its actions and reasons about one failure in five. Claude re-reads less and keeps a smaller context. Synthetic data.

Reasoning rises above the action line as bars, with height showing length. A green ↺ marks a failure the model thought about before acting again. A red ! marks one where it just acted again.

Memory hangs below the line as arcs that join repeat touches of the same file or search. Orange arcs are read → edit and green arcs are edit → check. Amber arcs are re-reads with nothing changed in between: the agent looked again at something it had already seen, which usually means the earlier read fell out of working memory or wasn’t trusted.

Context is the chart underneath: what the model is holding as the run goes on, stacked by source. The sources are the request and lessons, carried conversation, tool output, and its own reasoning. Circles mark the largest single outputs. The stack is an estimate (characters ÷ 4). When the log records the real input size of each model call, as Claude Code logs do, the measured context is drawn as a line on top. On a real Claude Code session I imported, the measured line sat several times above the estimate. Most of that context was conversation and earlier tool results being carried forward, which the estimate cannot see. That gap is the reason to prefer the measured line whenever a log has it.

5. Who said what

For ordinary questions, Duo asks both models and then writes one combined answer. Attribution splits that answer into sentences and labels each one Codex, Claude, both, or new wording, using overlapping word sequences.

Answer attribution: a stacked bar and a list of sentences, each labelled Claude, Codex or new wording
The combined answer drew 44% from Claude and 41% from Codex. One sentence was new. Synthetic data.

It is deliberately simple, and a paraphrase reads as “new wording”. But it immediately shows when a combined answer is really one model’s answer in a new coat of paint. It also flags the sentences only the synthesis step introduced, and those are the ones nobody’s answer supports.

6. Chat sessions and single agents

The same views work outside Duo. duo --import-chat reads claude.ai and ChatGPT exports, and duo --import-session reads Claude Code and Codex CLI session logs. When only one agent ran, the comparison panels step aside. For chats, the interesting picture is conversation memory:

A triangular matrix: each row a turn, filled cells the earlier turns it still carried, with a bar for how much was carried
Each row is a turn. Filled cells are the earlier turns it still carried in its context, and the bar is how much. Synthetic chat.

A chat app sends the whole conversation every time, so the triangle fills in and the bar grows on every turn. Duo keeps only the last ten turns, so its triangle becomes a band and the oldest turns visibly fall out. When a model “forgets” something you said early on, this view tells you whether it was even still in memory.

7. RL environments

An RL rollout has the same skeleton as an agent turn (actions, observations, a final outcome), plus a reward on every step and many episodes per task. duo --import-rollouts reads episodes as JSON or JSONL, and every view above applies. On the tree, step rewards become fruit (green for positive, red for negative, sized by magnitude) and the canopy shows the episode’s return.

Rewards and rollouts: stat tiles, cumulative reward curves for ten episodes with one dashed and flagged, a pass@k and pass^k table, and reward by action
Ten episodes of one task. Half succeed, but one of those edited the test file instead of the code, so the clean success rate is 40%. Synthetic data.

Three things this view is built to make hard to miss:

8. Over time, honestly

Single turns are anecdotes. The last view reads every stored session and asks whether either model is changing: getting slower, scoring lower, failing more tools.

Findings list, four small-multiple trend charts, a weekday-by-hour grid and long-run habits
The planted slowdown is the only finding. The noise in the other metrics is reported as “no clear change”. Synthetic data.

Draw a rolling average and the eye will always find a trend. So a change is stated only when it passes a test:

Every test in the view is corrected together with Benjamini–Hochberg. Each model needs at least eight turns and a change must reach q < 0.05; otherwise the page says “no clear change” and shows n. That is a result, not a gap. This is the piece that becomes a regression alarm when a vendor ships a new model version and your agent quietly gets slower.

9. What I think this is for

As agents move from minutes to hours to days, the question shifts from “can it do this?” to “can I leave it alone?” Answering that takes the things these views measure:

My bet is that human oversight doesn’t disappear but moves up a level: from approving every action to setting rules, auditing samples and reading pictures like these. An agent should earn autonomy one task type at a time, from measured evidence, and lose it automatically when that evidence turns.

Try it

Everything runs locally. Traces live in a SQLite file on your machine, and imports send nothing anywhere.

duo                                   # Codex + Claude side by side; prints the viewer URL
duo --import-session ~/.claude/projects/<project>/<session>.jsonl
duo --import-chat conversations.json  # claude.ai or ChatGPT export
python3 tools/serve_viewer.py         # the viewer over every stored session

Sources

Duo: Codex and Claude side by side in one terminal, github.com/sugeerth/duo. AgentDiff, github.com/sugeerth/Agenttracing.

N. Otsu (1979), a threshold selection method from gray-level histograms, IEEE Trans. Systems, Man, and Cybernetics. H. B. Mann (1945), nonparametric tests against trend, Econometrica; M. G. Kendall (1975), Rank Correlation Methods. H. Theil (1950) and P. K. Sen (1968), the Theil–Sen estimator. H. B. Mann and D. R. Whitney (1947), Annals of Mathematical Statistics. Y. Benjamini and Y. Hochberg (1995), controlling the false discovery rate, JRSS-B.

SM
Sugeerth Murugesan Staff ML Engineer / Scientist · PhD in visualization · Intel / Intuit