Skip to content
madebywelchPublic

About

Investigate what your coding agent did and when: a timeline of every message, thought, tool call and file change in a Claude Code or Codex session.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

41 Commits

Folders and files

Repository files navigation

recap

Investigate what your coding agent did and when. recap trace turns a Claude Code, Codex, or Gemini CLI session into a timeline of messages, thinking, tool calls, and file changes recorded or inferred from the transcript.

Claude Code session trace with a selected time range, a summary, and filtered events

Why

When you hand whole tasks to coding agents, you may have several runs in progress without watching any of them step by step. A final summary or a Git diff can leave you wondering why a run took a particular turn.

When a run surprises you, open the trace to see what the agent was told, what it thought if the log includes it, which tools it called and when, and which files those calls may have changed.

Quick start

Build with Go 1.22 or later. Put the resulting binary in a directory on your $PATH.

git clone https://github.com/madebywelch/recap.git
cd recap
go build -o recap .
mkdir -p ~/.local/bin
ln -s "$(pwd)/recap" ~/.local/bin/recap
export PATH="$HOME/.local/bin:$PATH"
recap trace --latest

Open the HTML file at the printed path. --latest picks the most recently modified local Claude Code, Codex, or Gemini CLI transcript. Use --tool claude, --tool codex, or --tool gemini with --latest to pick a source, or pass a transcript path directly. The repository includes the session shown in the pictures. Demo transcript · How to rebuild the pictures

recap trace --latest --tool codex --out run.html
recap trace testdata/trace-demo.jsonl

What the timeline shows

  • User input, agent replies, and any thinking the transcript recorded.
  • Tool calls with their inputs, results, and elapsed time when both timestamps are available.
  • File changes with the path, a link to the tool call, and a colored diff when the transcript has the changed text.
  • What Claude Code gave the model to read, including reminders, file attachments, and tool list changes.
  • Tokens read, reused from cache, and written by each response, plus a Context size lane showing how much the model was given to read.
  • Recorded stop reasons, turn timings, and settings changes. The Tool and token breakdown lists what happened to each record type.

Output formats

  • HTML is the default. Open the self-contained page in a browser to select a time range, search events, or filter them to one file from the Files panel. Use --out to choose the output path.
  • Terminal with --format text prints the timeline to stdout. It uses color on a terminal unless NO_COLOR is set. Add --verbose for wall-clock times, full event details, and diffs. Add --usage-rows to show standalone token rows. For a paged view, run recap trace --latest --format text | less.
  • JSON with --format json prints the trace for use by other tools. Trace JSON schema

Dark trace with a failed test and the thinking after it expanded beneath the pinned timeline

Opening lines of the terminal trace showing session totals and colored event labels

HTML and text default to a 12-hour US Eastern clock (EST in winter, EDT in summer). Set --tz to an IANA time zone such as America/New_York, or use utc or local. Set --clock to 12 or 24. These flags override RECAP_TZ and RECAP_CLOCK. In HTML, the controls also let you switch to UTC or the browser's time zone. Use --no-redact to turn off secret redaction.

Exploring the HTML trace

Scroll the page to explore the events. The timeline and filters stay at the top. On narrower screens, use the Files button to open the file list.

A 37-minute session with Files sorted by most changed, one file chosen, and its changes open in the events

  • Drag across the timeline to filter the events to a time range. Drag an edge to resize it or the middle to move it. A horizontal swipe selects on touch screens. A vertical swipe scrolls the page.
  • Click a time to jump to the nearest event that matches the filters. Clicking outside the range clears it first. Use Clear range, Escape, or a double-click on the chart to clear the range. The file URL keeps the range in its fragment so the same selection opens on reload.
  • Use +, −, Zoom to selection, or Reset to change the view. Ctrl or Cmd plus wheel zooms around the pointer. Pan a zoomed timeline with Shift+drag, Shift+wheel, or horizontal trackpad scrolling. Vertical scrolling still moves the page.
  • The Token rows choice shows individual usage records. What am I looking at explains the row types, token terms, and timeline marks.
  • With the chart focused, use Left or Right Arrow to step between events, Shift+Left or Shift+Right to extend a range from the cursor, and Enter to zoom to that range.
  • The Files panel lists each written file once with its folder, its number of writes, and the lines added and removed. A strip under each file marks every write across the whole session, so you can see when it changed. Hollow marks are possible writes. Hover a mark for its time, or click it to jump to that write.
  • Click a file to show only its writes and the tool calls that made them. The other marks on the timeline dim and a chip names the file above the events. Expand all diffs then opens each change to that file in order. Click the file again, the chip's ×, or press Escape to show every file. The file works together with the time range, search, kind, and Disk writes only, and the URL fragment keeps it with the range.
  • With a range selected, the panel lists only the files written in it, with counts for the range. On longer sessions, filter the paths or sort by first changed, most changed, or path. Sorting by path groups files by folder. Up and Down Arrow move between files, and Enter chooses one.

Annotate a session

Add notes to an event, a moment, or a time range. Recap saves them separately and never changes the session file. Find event IDs with recap trace session.jsonl --format json.

recap note add session.jsonl --event e12 --tag review "Check this tool result"
recap note add session.jsonl --at 1:53.5 "The approach changes here"
recap note add session.jsonl --range 113s-2:05 "Review this interval"
recap note list session.jsonl
recap note edit session.jsonl NOTE_ID "Updated note"
recap note rm session.jsonl NOTE_ID
recap trace session.jsonl --serve

--serve prints a private loopback URL for the trace page, which can then save notes. Hover an event and choose Add note, choose Note this moment beside the timeline cursor, or select a period and choose Note this period. N does the same from the keyboard, and Ctrl or Cmd plus Enter saves. Notes sit under their event or as rows at their time, in a Notes lane on the timeline, and in a Notes tab beside Files that you can filter by text, tag, and author. Search, the kinds filter, a chosen file, and a selected period hide notes like other rows.

The demo session with a period note selected on the timeline, its Notes lane, and the Notes tab open

A page written to a file can show and add notes too, but new notes stay in that browser. Use Download notes and recap note import session.jsonl FILE to add them to the notes file. Notes also show in terminal and JSON traces. Storage, command options, the page, and the served API

Cost

Trace shows estimated USD cost at list prices on each response, in the Cost lane, and for selected periods or files. Response costs use exact arithmetic on recorded token counts and separate fresh input, cache reads, cache writes, and output. An open response shows its parts as a table of tokens, rate, and amount. Amounts show whole cents from $1, two significant digits below that, and “under $0.0001” for smaller ones. The “Where the cost went” section estimates what later responses spent re-reading tool results, messages, and context additions.

List-price estimates apply even to sessions covered by a subscription. Use --prices prices.json or RECAP_PRICES to supply your own rates. Price table · Overrides, attribution, and billing gaps

What the transcript can show

  • Codex thinking. Codex can save encrypted reasoning, a readable summary, or readable reasoning text. For an encrypted-only block, the trace shows when it happened if there is a timestamp. Reasoning token counts appear when the transcript reports them. Full text is unavailable for encrypted blocks.
  • Claude Code thinking. The trace shows readable thinking saved in the transcript, with secret redaction applied by default. When Claude Code saves a thinking duration or token count, the trace can show those figures even when the thinking text is unavailable.
  • Gemini CLI thinking and timing. The trace shows saved thought summaries, warnings and errors, and usage per response, including cached, thinking, and tool-use tokens. Tool durations require both a scheduled and a completed snapshot. Legacy JSON usually keeps only the completed snapshot. Gemini CLI omits API stop reasons, request timing, and most run settings from its session files. Gemini CLI recording formats
  • File tools. Claude Code and Gemini CLI file tools and Codex patches appear as recorded writes. A recorded failure suppresses the write. If the outcome or changed text is missing, the trace may have only the call or path as evidence.
  • Shell commands. Claude Code Bash results can include recorded file changes and diffs. For shell commands without recorded edits, the trace labels a redirect or another recognized write command as a possible write based on its arguments. It can miss writes inside scripts or commands it does not recognize. It does not check the filesystem to confirm the write.

Where this is going

We want to add checks that evaluate a session and a shared timeline for several sessions from a group of agents. Both are directions for future work.

Privacy

recap trace reads the transcript locally and calls no model. Static exports use no network. --serve listens only on 127.0.0.1.

Recap replaces common secrets with [REDACTED] by default. The patterns cover Stripe, OpenAI, and Anthropic-style keys, GitHub, Slack, AWS, and Google tokens, JWTs, bearer headers, key: <value> forms, private key blocks, and long hex strings. Other sensitive text may still appear in the output. Review an exported trace before sharing it. Redaction patterns

Limitations

Trace supports Claude Code, Codex, and Gemini CLI. Transcript formats can change with the source CLIs, and the trace depends on what they saved. Recap skips malformed lines, and missing timestamps or unmatched results can leave gaps in the timeline.

License

MIT.

About

Investigate what your coding agent did and when: a timeline of every message, thought, tool call and file change in a Claude Code or Codex session.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Contributors

Languages