Skip to main content

Lightweight viewer for Claude Code session transcripts

Project description

claude-scrollback

A lightweight viewer for Claude Code session transcripts. Converts .jsonl session files into readable, interactive HTML — with a built-in server for browsing and a static site generator for archiving.

Pure python, no dependencies to install.

Live demo →

Install

pip (recommended)

pip install claude-scrollback

from source:

git clone https://github.com/alexdej/claude-scrollback
pip install -e claude-scrollback/

Or use generator.py standalone:

git clone https://github.com/alexdej/claude-scrollback
python claude-scrollback/claude_scrollback/generator.py <dir>

Usage

Quick start

Installation installs a claude-scrollback command.

# Browse all your Claude Code sessions (uses ~/.claude/projects/ automatically)
claude-scrollback view

# Browse sessions for the current Claude Code project directory
claude-scrollback view .

# Browse sessions for a specific project
claude-scrollback view ~/projects/myapp

# View a single session file
claude-scrollback view path/to/session.jsonl

All directory modes start a local server and open your browser automatically.

claude-scrollback is the command installed by pip install claude-scrollback. If you're running from a clone without installing, use python -m claude_scrollback in place of claude-scrollback throughout. Add a shell alias if you want something shorter:

alias sb='claude-scrollback'

Subcommands

claude-scrollback view [path] [-p PORT] [-n]
claude-scrollback show [uuid]
claude-scrollback generate [path] [-o OUTDIR]

view      start a local server and open the session browser
show      find and open a session by UUID
generate  generate static HTML from session files

view

claude-scrollback view                        # all projects, port 8080, opens browser
claude-scrollback view . -p 9000             # current project, custom port
claude-scrollback view . -n                  # start server without opening browser
claude-scrollback view session.jsonl         # convert single file, open in browser

Options: -p/--port PORT (default: 8080), -n/--no-open

show

Find a session by UUID and open it in the browser. Searches ~/.claude/projects/ automatically.

claude-scrollback show abc123de-f456-7890-abcd-ef1234567890

# Pipe in any text containing UUIDs — all matching sessions are opened
git log --format="%B" | claude-scrollback show
git show HEAD | claude-scrollback show

generate

Generate a static HTML site from session files.

claude-scrollback generate                        # all projects -> ./_site/
claude-scrollback generate . -o ~/my-archive/    # current project, custom output dir
claude-scrollback generate session.jsonl          # single file -> session.html

Options: -o/--out-dir DIR (default: _site/)

Path resolution

When you pass a project directory (like .), scrollback maps it to the corresponding Claude Code sessions folder automatically. Claude Code stores sessions under ~/.claude/projects/ with the project path encoded as the directory name (colons, slashes, and backslashes replaced with -):

~/projects/myapp        ->  ~/.claude/projects/-home-you-projects-myapp/
~/work/another-project  ->  ~/.claude/projects/-home-you-work-another-project/

If the path you give already contains .jsonl files (directly or in subdirectories), it's used as-is.

What it renders

Each session page shows:

  • Human messages and Claude responses in distinct styled bubbles
  • Tool calls (Read, Edit, Bash, Glob, Write, etc.) collapsible with full inputs
  • Tool results collapsible, truncated for large outputs
  • Thinking blocks collapsible when present
  • Context compaction markers when Claude Code summarised the context mid-session
  • API errors (rate limits, auth failures) surfaced inline
  • Token usage per response
  • Session metadata: working directory, git branch, start/end time, message and tool call counts
  • Resume command — one click copies cd <project> and claude --resume <session-id> to clipboard

The index page lists all sessions sorted newest-first with a live filter box and per-session metadata pills.

Note: Session transcripts include everything shown to Claude during the conversation — file contents, command output, environment details, and more. Review before sharing or publishing.

Linking sessions to commits

Include the session ID as a git trailer when committing AI-assisted work:

Fix authentication token refresh race condition

Claude-Session: abc123de-f456-7890-abcd-ef1234567890

The session ID is shown in the metadata card on each session page with a copy button. The resume command (also one-click copyable) lets you pick up the conversation right where it left off.

To find and open sessions referenced in your git log:

# Open all Claude-sessions from recent history
git log --format="%B" | claude-scrollback show

# Open the session from a specific commit
git show <commit> | claude-scrollback show

# Or open a session directly by UUID
claude-scrollback show <uuid>

Session directory layout

Claude Code organises sessions by project under ~/.claude/projects/:

~/.claude/projects/
  -home-you-projects-myapp/
    abc123.jsonl
    def456.jsonl
  -home-you-work-another-project/
    ...

scrollback handles both flat directories (one project) and nested trees (all projects).

Example sessions

The example/projects/ directory contains synthetic sessions demonstrating the viewer across different scenarios. To browse them:

claude-scrollback view example/projects/

Requirements

Python 3.8+, standard library only.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_scrollback-1.0.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_scrollback-1.0.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file claude_scrollback-1.0.0.tar.gz.

File metadata

  • Download URL: claude_scrollback-1.0.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for claude_scrollback-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f4037f1cc827d42886d49d5abf46275603ac0b93d86b4a18b6c21daaaab551e2
MD5 e14601b9561d92c7052c6ce8d107765a
BLAKE2b-256 e1d324152d5443e3b8c4de91e230bbd505fef9380023f74d4ee17ed5c5146e05

See more details on using hashes here.

File details

Details for the file claude_scrollback-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_scrollback-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86907efcc5c23d1a68be152d014fd6169c248e6e12496a87c418c9856b362d51
MD5 a2056c3579c7ec7ac89e95a76bb0d800
BLAKE2b-256 a272cbbb82b000df8b324bcc0994dc9a52ae275646553428ca86d87c37637d80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page