daaain/claude-code-log
A Python CLI tool that converts Claude Code transcript JSONL files into readable HTML / Markdown format.
Claude Code Log – What It Is
A small Python command‑line utility that reads the JSONL transcript files produced by Claude Code (Anthropic’s IDE‑assistant) and turns them into clean, browsable HTML or Markdown logs.
Why It Exists
Claude Code stores every prompt, response, tool call and system command as a line‑by‑line JSON record. Those raw files are hard for a human to read or share. Claude Code Log automates the conversion, adds navigation, token‑usage stats, date‑range filtering and a terminal UI so you can:
- Review a single session or an entire
~/.claude/projects/hierarchy. - Export a compact Markdown dump that can be fed back to any LLM for analysis.
- Visualise the conversation timeline, filter message types, and see how many tokens each part consumed.
Core Features (as described in the README)
| Feature | What It Does |
|---|---|
| Interactive TUI | Terminal UI for browsing sessions, generating HTML/MD, resuming a session, and quick stats. |
| Project‑wide processing | Scans ~/.claude/projects/, creates a top‑level index page with cards for each project and per‑project combined transcripts. |
| Single‑file/dir mode | Convert an individual transcript.jsonl or any directory of them. |
| HTML export | Minimalist, responsive pages with syntax‑highlighted code, runtime JavaScript filters, token counters, and a floating back‑to‑top button. |
| Markdown export | GitHub‑flavored Markdown; --compact merges consecutive same‑type sections, --detail controls verbosity. |
| Token usage tracking | Shows per‑message and per‑session token counts. |
| Date‑range filtering | Natural‑language dates ("yesterday", "last week", etc.) to limit the output. |
| Git SHA linking | Detects SHA‑like strings and turns them into clickable links to GitHub/GitLab/Bitbucket or a custom URL template. |
| Rich message support | Handles user, assistant, system, tool‑use/result, thinking, and image messages. |
| Cross‑session summary matching | Aligns Claude‑generated summaries with the original sessions even when they arrive asynchronously. |
| Provider hooks (experimental) | Direct export from Antigravity CLI (agy) and Codex CLI (codex) via --provider. |
Typical Use‑Cases
- Personal audit – “What did I work on with Claude last week?” → run
claude-code-log --from-date "last week" --open-browser. - Cost tracking – Token usage per session helps estimate Claude Code spend.
- Sharing – Export a session as HTML and send the link to a teammate.
- LLM‑driven analysis – Generate a compact Markdown dump (
--detail low --format md --compact) and feed it to another model for pattern detection or requirements extraction. - Version‑control linking – Clickable commit hashes let you jump from a conversation directly to the relevant code change.
Getting Started
# Quick one‑liner (no permanent install)
uvx claude-code-log@latest --open-browser
# Or install via pip
pip install claude-code-log
# Basic commands
claude-code-log # process all ~/.claude/projects/ and open index.html
claude-code-log my-project --tui # launch the terminal UI for a single project
claude-code-log transcript.jsonl -o session.md --detail low --format md --compact
Extensibility & Community
- The project ships a CONTRIBUTING.md with testing and architecture notes.
- Community extensions include the
archive-sessionskill/command that wraps the CLI for in‑chat use. - TODO list mentions UI tutorials, parallel processing, Git worktree merging, and GitHub‑Action wrappers.
All information above is taken directly from the repository’s README; no additional assumptions have been made.
Related
- Project
- Project
- Project
- Project
- Project