hadlock/cscope

Jazzy ratatui TUI for browsing Claude Code session history

2

stars

7

commits

Rust

primary language

Jul 2, 2026

updated

README

cscope

A jazzy terminal UI for browsing, searching, and inspecting Claude Code session history across all your projects. Native Rust, zero network, keyboard-driven.

  ▄████▄    ██████  ▄████▄   ▒█████   ██▓███  ▓█████
 ▒██▀ ▀█  ▒██    ▒ ▒██▀ ▀█  ▒██▒  ██▒▓██░  ██▒▓█   ▀
 ▒▓█    ▄ ░ ▓██▄   ▒▓█    ▄ ▒██░  ██▒▓██░ ██▓▒▒███
 ▒▓▓▄ ▄██▒  ▒   ██▒▒▓▓▄ ▄██▒▒██   ██░▒██▄█▓▒ ▒▒▓█  ▄
 ▒ ▓███▀ ░▒██████▒▒▒ ▓███▀ ░░ ████▓▒░▒██▒ ░  ░░▒████▒

What it does

Walks ~/.claude/projects/*, parses each project's sessions-index.json, and streams session JSONL on demand. Two-pane layout: collapsible project tree on the left, color-coded transcript on the right.

  • [user] lime · [assistant] neutral · [tool_use] gold · [tool_result] dim · [thinking] violet · [summary] cyan
  • Animated rainbow banner, hot-pink selection highlight, neon focus borders
  • Per-session token totals + cost estimate (Anthropic public rates, model-aware)
  • Filter by free-text, sort by recent / message count / alpha, flat or tree view

Run

cargo run --release

Flags

flagenvdefaultwhat
--claude-home <path>CSCOPE_CLAUDE_HOME~/.claudelook elsewhere
--metrics-port <port>CSCOPE_METRICS_PORT9090Prometheus /metrics (0 disables)
--log-file <path>CSCOPE_LOG_FILE$XDG_STATE_HOME/cscope/cscope.logstructured log file
--log-filter <directives>CSCOPE_LOGcscope=info,warntracing filter

Keys

keyaction
j/k, ↑/↓navigate / scroll
Ctrl-d/u, PgDn/PgUpjump 10 / 15
g/Gtop / bottom
Enterexpand project · load session
Tabswitch pane
/filter (esc to clear)
scycle sort: recent → tokens → msgs → alpha
ptoggle tree / flat
ttoggle thinking blocks
rtoggle tool_result blocks
Rrescan ~/.claude/projects/
yprint session UUID into the status bar
q, Escquit (Esc backs out of transcript first)

Observability

Every keypress, render, JSONL parse error, and session load duration is tracked. The /metrics endpoint serves Prometheus text format on port 9090 (or --metrics-port):

cscope_build_info{version="0.1.0"} 1
cscope_uptime_seconds 12.345
cscope_sessions_total 142
cscope_projects_total 15
cscope_messages_loaded_total 0
cscope_jsonl_parse_errors_total 0
cscope_keypresses_total 0
cscope_render_seconds_sum 0.000000
cscope_render_seconds_count 0
cscope_session_load_seconds_sum 0.000000
cscope_session_load_seconds_count 0

Logs are JSON-per-line, rotated by your filesystem of choice. Tail with jq:

tail -f ~/Library/Application\ Support/cscope/cscope.log | jq .

Build

cargo build --release
# binary at target/release/cscope

Stack

  • ratatui 0.30 + ratatui-widgets 0.3 + crossterm for the TUI
  • tracing + tracing-subscriber (JSON layer) for structured logging
  • tiny_http for the /metrics server
  • serde_json for streaming JSONL
  • walkdir + dirs for filesystem discovery

No async runtime, no API calls, no config file required. Read-only — cscope never writes to ~/.claude/.

Contributors

Hadlock

7 commits

hadlock/cscope

Jazzy ratatui TUI for browsing Claude Code session history

2

stars

7

commits

Rust

primary language

Jul 2, 2026

updated

README

cscope

A jazzy terminal UI for browsing, searching, and inspecting Claude Code session history across all your projects. Native Rust, zero network, keyboard-driven.

  ▄████▄    ██████  ▄████▄   ▒█████   ██▓███  ▓█████
 ▒██▀ ▀█  ▒██    ▒ ▒██▀ ▀█  ▒██▒  ██▒▓██░  ██▒▓█   ▀
 ▒▓█    ▄ ░ ▓██▄   ▒▓█    ▄ ▒██░  ██▒▓██░ ██▓▒▒███
 ▒▓▓▄ ▄██▒  ▒   ██▒▒▓▓▄ ▄██▒▒██   ██░▒██▄█▓▒ ▒▒▓█  ▄
 ▒ ▓███▀ ░▒██████▒▒▒ ▓███▀ ░░ ████▓▒░▒██▒ ░  ░░▒████▒

What it does

Walks ~/.claude/projects/*, parses each project's sessions-index.json, and streams session JSONL on demand. Two-pane layout: collapsible project tree on the left, color-coded transcript on the right.

  • [user] lime · [assistant] neutral · [tool_use] gold · [tool_result] dim · [thinking] violet · [summary] cyan
  • Animated rainbow banner, hot-pink selection highlight, neon focus borders
  • Per-session token totals + cost estimate (Anthropic public rates, model-aware)
  • Filter by free-text, sort by recent / message count / alpha, flat or tree view

Run

cargo run --release

Flags

flagenvdefaultwhat
--claude-home <path>CSCOPE_CLAUDE_HOME~/.claudelook elsewhere
--metrics-port <port>CSCOPE_METRICS_PORT9090Prometheus /metrics (0 disables)
--log-file <path>CSCOPE_LOG_FILE$XDG_STATE_HOME/cscope/cscope.logstructured log file
--log-filter <directives>CSCOPE_LOGcscope=info,warntracing filter

Keys

keyaction
j/k, ↑/↓navigate / scroll
Ctrl-d/u, PgDn/PgUpjump 10 / 15
g/Gtop / bottom
Enterexpand project · load session
Tabswitch pane
/filter (esc to clear)
scycle sort: recent → tokens → msgs → alpha
ptoggle tree / flat
ttoggle thinking blocks
rtoggle tool_result blocks
Rrescan ~/.claude/projects/
yprint session UUID into the status bar
q, Escquit (Esc backs out of transcript first)

Observability

Every keypress, render, JSONL parse error, and session load duration is tracked. The /metrics endpoint serves Prometheus text format on port 9090 (or --metrics-port):

cscope_build_info{version="0.1.0"} 1
cscope_uptime_seconds 12.345
cscope_sessions_total 142
cscope_projects_total 15
cscope_messages_loaded_total 0
cscope_jsonl_parse_errors_total 0
cscope_keypresses_total 0
cscope_render_seconds_sum 0.000000
cscope_render_seconds_count 0
cscope_session_load_seconds_sum 0.000000
cscope_session_load_seconds_count 0

Logs are JSON-per-line, rotated by your filesystem of choice. Tail with jq:

tail -f ~/Library/Application\ Support/cscope/cscope.log | jq .

Build

cargo build --release
# binary at target/release/cscope

Stack

  • ratatui 0.30 + ratatui-widgets 0.3 + crossterm for the TUI
  • tracing + tracing-subscriber (JSON layer) for structured logging
  • tiny_http for the /metrics server
  • serde_json for streaming JSONL
  • walkdir + dirs for filesystem discovery

No async runtime, no API calls, no config file required. Read-only — cscope never writes to ~/.claude/.

Contributors

Hadlock

7 commits

Languages

Rust

100.0%