Agent trace viewer
Open agent traces — Claude Messages API and OpenAI Chat Completions or Responses logs, OpenTelemetry GenAI spans, Claude Code session JSONL — and see every turn, model call and tool call on a timeline and in a tree, with latency, tokens split into cache reads and writes, cost per step, failed tool calls and retries, and full-text search; nothing leaves the browser.
Added
How to use it
An agent run is a pile of JSON: requests, responses, tool calls and their results, maybe spans from a tracing SDK. This page reads the common formats into one picture — which model call asked for which tool, how long each took, where the tokens and the money went, what failed and what was tried again — so you can debug an agent without writing a script first. The trace is read in this browser tab; it is not uploaded and not saved.
How to use it
Load. Drop one or more files on the page, open them, or paste JSON or JSON Lines. The format is recognised by itself:
| Format | What is read |
|---|---|
Claude Code session |
|
Claude Messages API |
A request ( |
OpenAI Chat Completions |
Messages with |
OpenAI Responses API |
|
OpenTelemetry GenAI |
OTLP JSON ( |
In a request/response log the time between a response that asked for tools and the next request is the time the tools took. Traces without timestamps are drawn with evenly spaced steps.
Search and filter (top of the page) apply to every view: the text is matched against step names, models, message text, tool inputs and results and span attributes. Show narrows to the turns, the model calls, the tool calls, or only errors, retries and tool calls without a result.
Timeline. One row per step, indented by nesting, with a bar from its start to its end — agents, model calls (with tokens), tool calls, user and system messages. ✕ marks an error, ↻ a retry, a striped bar a tool call with no result in the file. Tap a row for its details: times, model, tokens and cost, the text and thinking, the tool input and result, and the raw JSON (copyable). Drag across the time axis to zoom into a stretch of the run; Zoom timeline here fits the view to one step (its subagent, say), and Show the whole trace zooms out again. Full screen gives the timeline the whole screen (Panels hides the details beside it).
Tree. The same steps as an outline: agents, their turns, each model call with the tool calls it made, and subagents under the tool call that started them, with time, tokens and cost summed under every node.
Tokens & cost. Totals (uncached input, cache writes, cache reads, output, the share of input served from the cache), a chart of the tokens of every model call with the cumulative cost, a table per model and per call, and the price table. Prices are US$ per million tokens; edit any row or add a model (a fine-tune, a self-hosted model at your own rate) — edits are kept in this browser.
Tool calls. Per tool: calls, errors, retries, calls without a result, total, median and longest time; and every call with its input, duration and status.
A retry is a tool call that follows a failed call of the same tool by the same agent (“after error”), or one that repeats an earlier call with exactly the same input (“identical”), and a model call that follows a failed model call in the same agent (“after API error”). This is a rule of thumb: a test run repeated after a fix is counted too.
How cost is worked out, per model call: uncached input × input price + 5-minute cache writes × 1.25 × input price + 1-hour cache writes × 2 × input price + cache reads × the model’s cache-read price + output × output price (Anthropic’s published multipliers). For example 1,000 uncached input, 2,000 cache-write, 10,000 cache-read and 500 output tokens on Claude Opus 5.5 ($4 input, $5 5-minute write, $0.20 read, $20 output per million) cost 0.004 + 0.010 + 0.002 + 0.010 = $0.026.
Limits
-
Prices are list prices as of the date in the table (Anthropic, from its pricing page) or published in 2025 (OpenAI) and may be out of date; batch, priority, fast-mode, long-context and regional prices and tool fees (web search) are not included. Cost is an estimate from the token counts in the file.
-
OpenTelemetry instrumentations differ in how they count input tokens. The semantic conventions ask for
gen_ai.usage.input_tokensto include cached tokens, so cache reads and writes are subtracted from it when they fit; an instrumentation that reports uncached tokens only is then under-counted. -
A Messages API or Chat Completions request on its own has no usage or timing for the earlier turns in its history; only responses carry tokens.
-
Claude Code’s session format is undocumented and changes; lines it does not recognise are skipped. Thinking is often stored empty (only a signature), which is shown as “thinking omitted”.
-
Files up to a few tens of MB stay responsive (big files are parsed in a background worker); the timeline draws the first 400 matching steps with a button for more, and tables show the first 1,000 rows — use the search to narrow.
-
Streaming event logs (server-sent events) are not read; save the final message instead.
Sources: Anthropic, Messages API and prompt caching (usage fields, cache-write multipliers), pricing; OpenAI, Chat Completions and Responses API references, pricing; OpenTelemetry, semantic conventions for generative AI (spans, agent spans, attribute names) and the OTLP JSON encoding.
Related: Tokenizer explorer (why token counts differ between models), LLM serving (latency and throughput of the model calls themselves), AI economics, Model evaluation and JSON workbench for digging into one record.
Linking to an example
A link opens the tool with an example and a filter: /tools/agent-trace/?<parameters>#<tab>,
where the tab is load, timeline, tree, tokens or tools. Share link (top right) builds one
from the current settings. Your own trace never goes into a link — only the example name, the
search text, the filter and edited prices do.
| Parameter | Meaning | Example |
|---|---|---|
|
a built-in synthetic trace (list below) |
|
|
search text |
|
|
|
|
| Name | Tab | Shows |
|---|---|---|
|
timeline |
A Claude Code session: a failing test, an |
|
timeline |
A Messages API log: two tool calls in parallel, a calendar timeout retried, a 1-hour cache write read back on later turns (open) |
|
tools |
A Chat Completions JSONL log: parallel |
|
tokens |
The Responses API with reasoning tokens and |
|
tree |
OTLP JSON GenAI spans: an agent, a sub-agent, a tool that times out and is retried (open) |
For example, ?example=claude-code&show=issues#timeline
shows only what went wrong in the Claude Code session.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.