A Python CLI tool that converts Claude Code transcript JSONL files into readable HTML format.
claude_code_log.webm
π View Changelog - See what's new in each release
This tool generates clean, minimalist HTML pages showing user prompts and assistant responses chronologically. It's designed to create a readable log of your Claude Code interactions with support for both individual files and entire project hierarchies.
TL;DR: run the command below and browse the pages generated from your entire Claude Code archives:
uvx claude-code-log --open-browser- Project Hierarchy Processing: Process entire
~/.claude/projects/directory with linked index page - Single File or Directory Processing: Convert individual JSONL files or specific directories
- Chronological Ordering: All messages sorted by timestamp across sessions
- Session Demarcation: Clear visual separators between different transcript sessions
- Date Range Filtering: Filter messages by date range using natural language (e.g., "today", "yesterday", "last week")
- Summary Support: Display summary messages matched with corresponding sessions
- System Command Visibility: Show system commands (like
init) in expandable details - Markdown Rendering: Automatic markdown rendering in assistant message content
- Project Navigation: Master index page with project statistics and quick navigation
- Space-Efficient Layout: Compact design optimized for content density
- CLI Interface: Simple command-line tool using Click
# Process all projects in ~/.claude/projects/ (default behavior)
claude-code-log
# Explicitly process all projects
claude-code-log --all-projects
# Process all projects and open in browser
claude-code-log --open-browser
# Process all projects with date filtering
claude-code-log --from-date "yesterday" --to-date "today"
claude-code-log --from-date "last week"This creates:
~/.claude/projects/index.html- Master index with project cards and statistics~/.claude/projects/project-name/combined_transcripts.html- Individual project pages
# Single file
claude-code-log transcript.jsonl
# Specific directory
claude-code-log /path/to/transcript/directory
# Custom output location
claude-code-log /path/to/directory -o combined_transcripts.html
# Open in browser after conversion
claude-code-log /path/to/directory --open-browser
# Filter by date range (supports natural language)
claude-code-log /path/to/directory --from-date "yesterday" --to-date "today"
claude-code-log /path/to/directory --from-date "3 days ago" --to-date "yesterday"claude_code_log/parser.py- Data extraction and parsing from JSONL filesclaude_code_log/renderer.py- HTML generation and template renderingclaude_code_log/converter.py- High-level conversion orchestrationclaude_code_log/cli.py- Command-line interface with project discoveryclaude_code_log/models.py- Pydantic models for transcript data structuresclaude_code_log/templates/- Jinja2 HTML templatestranscript.html- Main transcript viewer templateindex.html- Project directory index template
pyproject.toml- Project configuration with dependencies
The project uses:
- Python 3.12+ with uv package management
- Click for CLI interface and argument parsing
- Pydantic for robust data modeling and validation
- dateparser for natural language date parsing
- Standard library for JSON/HTML processing
- Minimal dependencies for portability
- mistune for quick Markdown rendering
Run tests with:
uv run pytestGenerate test coverage reports:
# Run tests with coverage
uv run pytest --cov=claude_code_log --cov-report=html --cov-report=term
# Generate HTML coverage report only
uv run pytest --cov=claude_code_log --cov-report=html
# View coverage in terminal
uv run pytest --cov=claude_code_log --cov-report=term-missingHTML coverage reports are generated in htmlcov/index.html.
Comprehensive Testing & Style Guide: The project includes extensive testing infrastructure and visual documentation. See test/README.md for details on:
- Unit Tests: Template rendering, message type handling, edge cases
- Test Coverage: 78%+ coverage across all modules with detailed reporting
- Visual Style Guide: Interactive documentation showing all message types
- Representative Test Data: Real-world JSONL samples for development
- Style Guide Generation: Create visual documentation with
uv run python scripts/generate_style_guide.py
- Format code:
ruff format - Lint and fix:
ruff check --fix - Type checking:
uv run pyright
- Test:
uv run pytest - Test with Coverage:
uv run pytest --cov=claude_code_log --cov-report=html - Format:
ruff format - Lint:
ruff check --fix - Type Check:
uv run pyright - Generate Style Guide:
uv run python scripts/generate_style_guide.py
Test with Claude transcript JSONL files typically found in ~/.claude/projects/ directories.
When processing all projects, the tool generates:
~/.claude/projects/
βββ index.html # Master index with project cards
βββ project1/
β βββ combined_transcripts.html # Individual project page
βββ project2/
β βββ combined_transcripts.html
βββ ...- Project Cards: Each project shown as a clickable card with statistics
- Summary Statistics: Total projects, transcript files, and message counts
- Recent Activity: Projects sorted by last modification date
- Quick Navigation: One-click access to any project's detailed transcript
- Clean URLs: Readable project names converted from directory names
- User Messages: Regular user inputs and prompts
- Assistant Messages: Claude's responses (when not filtered)
- Summary Messages: Session summaries with special formatting
- System Commands: Commands like
initshown in expandable details - Tool Use: Tool invocations and results with proper formatting
- Responsive Design: Works on desktop and mobile
- Syntax Highlighting: Code blocks properly formatted
- Markdown Support: Full markdown rendering including:
- Headers, lists, emphasis
- Code blocks and inline code
- Links and images
- GitHub Flavored Markdown features
- Session Navigation: Clear visual breaks between transcript sessions
- Command Visibility: System commands shown with context but not cluttering the main view
- Tool Interactions: Tool use and results displayed in collapsible sections
Install using pip:
pip install claude-code-logOr install from source:
git clone https://github.com/your-username/claude-code-log.git
cd claude-code-log
uv sync
uv run claude-code-log- Show top level stats on index page: token usage added up + time of last interaction
- Tool Use Preview: Show first few lines of tool use and other collapsed details
- In-page Filtering: Client-side filtering and search
- Timeline view: Show interaction on a timeline to get a better idea on timings and parallel calls