Skip to content

Turn Codex CLI session logs into browsable HTML transcripts

License

Notifications You must be signed in to change notification settings

masonc15/codex-transcript-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codex-transcript-viewer

Converts Codex CLI JSONL session transcripts into single-file HTML viewers with sidebar navigation, search, and filtering. No external dependencies. Just open the .html in any browser.

Viewer showing a final answer with sidebar navigation and filters

See the full demo for more screenshots and a walkthrough of every feature.

Install

git clone https://github.com/masonc15/codex-transcript-viewer.git
uv tool install ./codex-transcript-viewer

Or run directly without installing:

uv run --directory ./codex-transcript-viewer codex-transcript-viewer <session.jsonl>

Usage

codex-transcript-viewer <session.jsonl> [output.html]

If you omit the output path it writes <input-stem>.html in the current directory.

Codex stores sessions as JSONL files under ~/.codex/sessions/. Find one and point the tool at it:

codex-transcript-viewer ~/.codex/sessions/2026/02/18/rollout-2026-02-18T10-06-22-019c7149.jsonl
open rollout-2026-02-18T10-06-22-019c7149.html

What the viewer shows

The HTML output has a sticky sidebar on the left with a scrollable event tree and a main content area on the right. Each event type gets its own visual treatment:

  • User messages with green left border
  • Final answers highlighted with a subtle green background
  • Commentary (intermediary updates) in italic with a muted border
  • Reasoning summaries in gray italic
  • Tool calls showing the command or JSON arguments
  • Tool outputs with click-to-expand for long content
  • System events (turn started, aborted, rolled back) in dim text
  • Token usage counters

The sidebar supports text search and preset filters (Default, No tools, User only, Answers, All). On mobile the sidebar collapses behind a hamburger menu.

Credits

Inspired by the HTML session export in pi, a coding agent by @badlogic.

Project structure

src/codex_transcript_viewer/
  parser.py       - JSONL parsing and event extraction
  markdown.py     - lightweight markdown-to-HTML conversion
  formatting.py   - timestamp formatting helpers
  html_builder.py - assembles the final HTML from events
  style.css       - all CSS for the viewer
  viewer.js       - sidebar filtering and navigation
  cli.py          - command-line entry point

About

Turn Codex CLI session logs into browsable HTML transcripts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published