Work

AgentTrace

See where two AI agent runs start behaving differently.

When an agent starts failing after a prompt, model, tool, or code change, the final output rarely tells you what happened. AgentTrace compares two execution traces and takes you to the first observable behavioral difference.

View source on GitHub →

Independent project · React, TypeScript · local-first · MIT · 2026

AgentTrace comparing two runs of the same task. Both runs report success. The two lanes run together, split at step 4 where the model output differs, and rejoin at the final step.
Two runs of one task. They agree, split at step 4, and rejoin.

01 Agent failures are hard to debug

A coding agent succeeds on a task. You change its system prompt and run the same task again. This time it fails.

You now have two long execution traces full of searches, file reads, tool calls, arguments, results, retries, and errors. The final outputs tell you the runs were different. They do not tell you where the execution behavior separated.

AgentTrace gives you a place to start looking.

02 What it does

AgentTrace aligns the two trajectories, collapses the behavior that stayed the same, and surfaces the first observable divergence. It compares tool calls, arguments, results, errors, and stopping behavior.

03 Why a normal diff is not enough

Agent runs do not line up event for event. One run searches twice where another searches once. A tool call gets inserted, skipped, or reordered. Matching event 12 in one trace to event 12 in the other stops meaning anything almost immediately.

Ids and timestamps differ on every run too, so a line diff marks nearly every line as changed even when the behavior is identical.

04 The engineering

I modeled each execution as a sequence and built deterministic weighted Needleman-Wunsch alignment to pair behaviorally similar events while leaving gaps where one run inserted or skipped an action. No model in the loop, no embeddings, no randomness.

AgentTrace Trace view: two aligned columns of steps with a gutter between them, folded runs of identical steps, overview strips, and a field-level inspector on the right.
Trace view: folded identical regions, the alignment gutter, and the field-level inspector.

05 Real-agent validation

Testing on real Claude Code sessions exposed a flaw the synthetic fixtures had not. A model turn that only emits tool calls has no visible output, and every such turn carried the same signature, so a turn that ran one shell command compared as identical to a turn that ran eight searches.

I changed the behavioral signature to incorporate the tools a turn emits, and added regression tests. On the long validation pair:

Aligned rows
63
Identical rows
7 → 1
Unsupported identical rows
7 → 0
Difference regions
7 → 1

Correct pairings, the first observable difference, and existing synthetic fixture behavior were unchanged.

AgentTrace comparing two real Claude Code runs. Both report unknown status. The runs split at the first Bash call, where the commands differ, and run A continues with six steps run B does not have.
The real pair. Both runs report unknown status, and they split at the first tool call.

06 Scope

AgentTrace identifies observable behavioral differences between executions. It does not determine why an agent behaved differently or decide which run is correct.

View source on GitHub →