Trace Science: Tracepress Maps and Reduces Agent Logs

Tracepress trace science tool analyzing AI agent traces

A new open source tool called tracepress aims to make trace science practical: pulling answers out of gigabytes of AI agent logs that no person could read. Its creator, Noah Ziems, built it around a hierarchy of language model map and reduce steps.

Developers can write that hierarchy with the tracepress Python package. They can also tell a coding agent to use the tracepress skill, installed with npx skills add Ziems/tracepress.

The problem with reading agent traces

A trace is the full record of an agent working on a task. Ziems calls traces the new oil, since they hold information about model behavior, alignment, tooling problems and user frustration. Much of it is subjective and hard to measure, and a single long trace can be too long for one person to read.

That leaves real gaps. When teams build agent tooling or train a model, things can quietly misbehave, through reward hacking or doom loops for instance, while dashboard metrics look fine. Problems often surface only after training ends. In production, teams struggle to learn what users run into or which situations their offline evals miss. Ziems uses “trace science” for this kind of work, because it overlaps so much with data science.

The common shortcut is to hand a large JSON dump to a coding agent such as Claude or Codex and ask something vague like “what is causing my model to fail”. According to Ziems, the agent tends to grep with a few narrow regular expressions instead of studying the data. It misses most of what matters, burns expensive reasoning tokens and wastes time.

Claude grepping a JSON dump of traces with a long regex instead of reading them
Image: Noah Ziems

What a better trace science tool needs

After a few weeks of experiments, Ziems settled on four qualities:

  • It shouldn’t assume what the user is looking for, so the only limit is the questions people think to ask.
  • It should analyze every part of every trace and let the important findings rise out of the noise.
  • It should use language models for the heavy lifting, since the judgments are semantic.
  • It should be fast and fairly cheap, running work in parallel and skipping frontier models for every step.

How the hierarchy works

The design that worked best is a hierarchical map reduce where language models handle both operations. A long trajectory is first split into steps. Then one query runs on every step in parallel, covering fields such as the message, reasoning, tool use and environment feedback. A simple query might be “summarize this step”. The result is a short summary per step. Ziems credits Liana Patel’s LOTUS project with pioneering many of these ideas.

The second operation, lm_reduce, lets a model look across everything at once. It receives the step summaries, now short enough to fit in one context, and can write a one or two sentence account of the whole run. In the worked example it also sees each run’s outcome and the hidden verifier tests that the agent never saw.

The first operation, lm_map, takes a DSPy-style signature. Names left of the arrow are input columns and names on the right are the new columns the model fills in. Outputs are strings by default, but you can type them, for example a boolean “frustrated” flag or a label chosen from explore, edit and test. Tables are lazy, so nothing runs until the output is needed.

A worked example on Terminal-Bench

Ziems demonstrates with Terminal-Bench tasks from the Harbor Hub. The data is Terminal-Bench’s own run of Opus 5 on Terminal-Bench 4.0: 66 tasks, 330 trials and about 4 GB. A built-in helper loads local Harbor jobs into DataFrames, with one row per step. For summaries he configures the cheap gpt-6-luna model through OpenRouter and asks for one sentence of at most 20 words per step.

The hierarchy can grow. Reducing across the five trials of a task shows which failure modes repeat and what separates passes from failures. A further reduce gives one answer across all tasks. Later examples use a bigger slice of Terminal-Bench 4.1: ten tasks, five trials each from five models’ public leaderboard runs, roughly 200 trials and 20,000 steps.

The shape is flexible as well. To compare models, group the summaries by model instead of by task, reduce each model’s trials separately and combine the groups in a final reduce.

Questions it can answer in production

For deployed systems, the same structure can ask what use cases frustrate users, what they keep requesting that the product lacks, and what is happening across an agent swarm right now. It can also point at where a Claude session spends tokens and time.

For teams already collecting traces, the first trace science test is easy to run. Load a job, summarize each step, reduce to the trial level and see whether the failure patterns match what the dashboards show.

Source: Noah Ziems

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.