session-render
Turns one Claude Code session log into a standalone HTML page you can open, archive, or email. The output is fully self-contained — syntax highlighting is done at build time with Pygments, so there is zero CDN/JS dependency and it works offline.
How to run
Dependencies (markdown, pygments) are declared inline via PEP 723 script metadata, so uv run installs them automatically — no --with flags needed:
uv run "${CLAUDE_PLUGIN_ROOT:-$(dirname "$0")}/render.py" \
<session-id | path/to/session.jsonl> [output.html]
- First arg: a bare session id (resolved by globbing
~/.claude/projects/**/<id>*.jsonl) or a direct path to a.jsonl. - Second arg (optional): output path. Defaults to
/tmp/claude-session-<id>.html. --claude-dir DIRoverrides the search root (defaults to$CLAUDE_DIRor~/.claude).
Then open it: open <output.html> (macOS) / xdg-open (Linux).
Layout
Left-aligned threaded log, intentionally minimal (no avatars/bubbles/shadows):
- You and Claude messages are top-level, rendered from markdown.
- Tool calls nest one level deeper under a hairline guide rail: a monospace caption (
› Bash — description), the syntax-highlighted command, and the output. Tool output is expanded by default (collapsible); errors are flagged red. - Thinking and injected skill/context blocks are collapsed
<details>. - Model-fallback and refusal notices render as quiet left-aligned system notes.
- Sticky-free header shows title, session id, start/end time, and model(s).
Notes
- Empty/stripped
thinkingblocks are skipped. tool_use↔tool_resultare linked by id, so each result renders inline under its call.- Bash commands highlight with the bash lexer; fenced code blocks highlight by their language;
Writecontent highlights by file extension. Plain stdout is shown as-is in a dark block. - Code style is
github-dark(setPYG_STYLEnear the top ofrender.pyto change it). - The script prints the output path, byte size, and block count when done.
Finding a session id
# by recent activity
ls -t ~/.claude/projects/*/*.jsonl | head
# by title/content
grep -l "some text" ~/.claude/projects/*/*.jsonl