npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-code-transcripts

v1.0.2

Published

Convert Claude Code session JSON to clean mobile-friendly HTML pages with pagination

Readme

claude-code-transcripts

Convert Claude Code session files (JSON or JSONL) to clean, mobile-friendly HTML pages with pagination.

Example transcript produced using this tool.

Read A new way to extract detailed transcripts from Claude Code for background on this project.

Note: This is a pure TypeScript port of claude-code-transcripts, originally written in Python by Simon Willison.

Installation

Install with npm:

npm install -g claude-code-transcripts

Or run directly with npx:

npx cct --help

You can use cct or claude-code-transcripts — both work the same.

Usage

This tool converts Claude Code session files into browseable multi-page HTML transcripts.

There are three commands available:

  • local (default) - select from local Claude Code sessions stored in ~/.claude/projects
  • json - convert a specific JSON or JSONL session file (or URL)
  • all - convert all local sessions to a browsable HTML archive

The quickest way to view a recent local session:

cct

This shows an interactive picker to select a session, generates HTML, and opens it in your default browser.

Output options

All commands support these options:

  • -o, --output <directory> - output directory (default: writes to temp dir and opens browser)
  • -a, --output-auto - auto-name output subdirectory based on session ID or filename
  • --repo <owner/name> - GitHub repo for commit links (auto-detected from git push output if not specified)
  • --open - open the generated index.html in your default browser (default if no -o specified)
  • --gist - upload the generated HTML files to a GitHub Gist and output a preview URL
  • --json - include the original session file in the output directory

The generated output includes:

  • index.html - an index page with a timeline of prompts and commits
  • page-001.html, page-002.html, etc. - paginated transcript pages

Local sessions

Local Claude Code sessions are stored as JSONL files in ~/.claude/projects. Run with no arguments to select from recent sessions:

cct
# or explicitly:
cct local

Use --limit to control how many sessions are shown (default: 10):

cct local --limit 20

Publishing to GitHub Gist

Use the --gist option to automatically upload your transcript to a GitHub Gist and get a shareable preview URL:

cct --gist
cct json session.json --gist

This will output something like:

Gist: https://gist.github.com/username/abc123def456
Preview: https://gisthost.github.io/?abc123def456/index.html
Files: /var/folders/.../session-id

The preview URL uses gisthost.github.io to render your HTML gist. The tool automatically injects JavaScript to fix relative links when served through gisthost.

Combine with -o to keep a local copy:

cct json session.json -o ./my-transcript --gist

Requirements: The --gist option requires the GitHub CLI (gh) to be installed and authenticated (gh auth login).

Auto-naming output directories

Use -a/--output-auto to automatically create a subdirectory named after the session:

# Creates ./session_ABC123/ subdirectory
cct json session_ABC123.json -a

# Creates ./transcripts/session_ABC123/ subdirectory
cct json session.json -o ./transcripts -a

Including the source file

Use the --json option to include the original session file in the output directory:

cct json session.json -o ./my-transcript --json

This is useful for archiving the source data alongside the HTML output.

Converting from JSON/JSONL files

Convert a specific session file directly:

cct json session.json -o output-directory/
cct json session.jsonl --open

This works with both JSONL files in the ~/.claude/projects/ folder and JSON session files.

The json command can take a URL to a JSON or JSONL file as an alternative to a path on disk:

cct json https://example.com/session.jsonl --open

Converting all sessions

Convert all your local Claude Code sessions to a browsable HTML archive:

cct all

This creates a directory structure with:

  • A master index listing all projects
  • Per-project pages listing sessions
  • Individual session transcripts

Options:

  • -s, --source <directory> - source directory (default: ~/.claude/projects)
  • -o, --output <directory> - output directory (default: ./claude-archive)
  • --include-agents - include agent session files (excluded by default)
  • --dry-run - show what would be converted without creating files
  • --open - open the generated archive in your default browser
  • -q, --quiet - suppress all output except errors

Examples:

# Preview what would be converted
cct all --dry-run

# Convert all sessions and open in browser
cct all --open

# Convert to a specific directory
cct all -o ./my-archive

# Include agent sessions
cct all --include-agents

Features

  • Session Parsing: Supports JSON and JSONL formats with graceful error handling
  • Markdown Rendering: Full markdown support in all text blocks
  • Code Highlighting: Syntax-highlighted JSON output
  • Git Integration: Auto-detects GitHub repos, creates clickable commit links
  • Responsive Design: Mobile-friendly with touch-friendly buttons
  • Pagination: Splits conversations into manageable pages (5 per page)
  • Content Truncation: Long content can be expanded/collapsed
  • Interactive Timestamps: Shows relative times in browser
  • Batch Processing: Convert entire session archives with progress tracking
  • GitHub Gist Publishing: One-command publishing with preview URLs
  • Image Embedding: Embedded image support in tool results
  • Thinking Blocks: Collapsible AI thinking visualization
  • Tool Display: Custom rendering for Bash, Write, Edit, and TodoWrite tools

Development

Clone the repository and install dependencies:

git clone https://github.com/simonw/claude-code-transcripts
cd claude-code-transcripts
pnpm install

Build the TypeScript:

pnpm build

Run tests:

pnpm test
# or watch mode:
pnpm test:watch

Run the CLI in development mode:

pnpm dev --help
pnpm dev json session.jsonl --open

Project Structure

src/
├── cli.ts        # CLI application with Commander.js
├── parser.ts     # Session file parsing (JSON/JSONL)
├── renderer.ts   # HTML generation engine
├── templates.ts  # HTML template functions
├── css.ts        # Embedded CSS stylesheet
├── js.ts         # Embedded client-side JavaScript
└── index.ts      # Public API exports

tests/
├── parser.test.ts
├── renderer.test.ts
├── templates.test.ts
└── sample_session.json/jsonl