CLI for parsing and browsing Claude Code session files (.jsonl).
- Parse sessions: Convert
.jsonlsession files to readable formats (narrative, terminal, markdown) - Interactive browser: Browse sessions with fzf, preview content, resume sessions
- Session discovery: Find sessions by ID prefix, filter by date/project
- Streaming mode: Parse sessions in real-time from stdin
- Subagent support: Include subagent transcripts in output
Requires Bun:
git clone https://github.com/nitsanavni/session.git
cd session
bun install# Basic narrative output
bun src/cli.ts <session.jsonl>
# By session ID (searches ~/.claude/projects/)
bun src/cli.ts 502de9c7
# Terminal format (replicates Claude's /export)
bun src/cli.ts session.jsonl --format terminal
# Markdown format
bun src/cli.ts session.jsonl --format markdown
# Include tool inputs/outputs
bun src/cli.ts session.jsonl --tool-input --tool-output
# Include subagent transcripts
bun src/cli.ts session.jsonl --subagents# Open fzf browser with preview
bun src/cli.ts find
# Filter by date
bun src/cli.ts find --since 1d # last day
bun src/cli.ts find --since 2w # last 2 weeks
# All projects (not just current)
bun src/cli.ts find --all-projectsKeybindings in fzf:
Enter- output session pathCtrl-R- resume session withclaude --resumeCtrl-E- export to markdown fileCtrl-T- push to retro (requiresRETRO_SCRIPTenv var)
# List recent sessions
bun src/cli.ts list
# Limit results
bun src/cli.ts list -n 5
# Output as JSON
bun src/cli.ts list --output json# Parse from stdin in real-time
tail -f session.jsonl | bun src/cli.ts --stream
# Pipe from claude
claude -p "hello" --output-format stream-json | bun src/cli.ts --streamSessions are stored at ~/.claude/projects/<project-hash>/*.jsonl by Claude Code. The project hash is derived from your working directory path.
OPTIONS:
--format <fmt> Output format: narrative (default), terminal, markdown
--stream Stream mode: read from stdin, output in real-time
--tool-input Include tool call inputs
--tool-output Include tool results
--truncate <n> Truncate tool I/O to n chars (default: 500)
--subagents Include subagent transcripts (appended at end)
--include-warmups Include warmup subagents (excluded by default)
--list-files List all related files (main + subagents), one per line
--help, -h Show help
LIST/FIND OPTIONS:
--limit, -n <n> Limit results (default: 10)
--project <hash> Filter to specific project
--all-projects Show sessions from all projects
--output <format> Output format: path, id, json
--since <filter> Filter by date (1d, 2w, 2024-01-15)
CLAUDE_BIN- Path to claude executable (default:claude)VSC_BIN- Path to vsc-bridge executable (default:vsc)RETRO_SCRIPT- Path to a script to run when pressing Ctrl-T in the browser (optional)
MIT