You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Elijah Voigt 0bca469701 fix(claudbg-9627): scan up to 20 lines for cwd field in session discovery
The project path was missing for sessions whose first JSONL line has no
cwd field. Fix reads up to 20 non-empty lines to find any entry with cwd
(typically a system-type entry that may not be at line 1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 months ago
.beans fix(claudbg-9627): scan up to 20 lines for cwd field in session discovery 2 months ago
.claude Initial project scaffold 2 months ago
specs feat(claudbg-gf58): TUI filter panel with persistent query history 2 months ago
src fix(claudbg-9627): scan up to 20 lines for cwd field in session discovery 2 months ago
.beans.yml Initial project scaffold 2 months ago
.envrc Initial project scaffold 2 months ago
.gitignore Initial project scaffold 2 months ago
CLAUDE.md chore(claudbg-g0oh): remove cargo-nextest, use cargo test 2 months ago
Cargo.lock feat(tui): add ratatui + crossterm dependencies 2 months ago
Cargo.toml feat(tui): add ratatui + crossterm dependencies 2 months ago
LICENSE docs: add README and MIT license 2 months ago
README.md docs: add README and MIT license 2 months ago
TODO.md chore: convert TODO.md items to beans tickets 2 months ago
flake.lock Initial project scaffold 2 months ago
flake.nix chore(claudbg-g0oh): remove cargo-nextest, use cargo test 2 months ago

README.md

claudbg

A CLI tool for inspecting Claude Code sessions. Reads JSONL session files from ~/.claude/projects/, caches them in a local SQLite database, and lets you list, dump, and transcribe sessions and sub-agent runs.

+----------+--------------------------+----------------------------+-------------------+----------+
| ID       | Date                     | Project                    | Model             | Messages |
+==========================================================================================================================+
| 21fae0a8 | 2026-03-28T20:36:00.417Z | /home/user/my-project      | claude-sonnet-4-6 | 663      |
| 80e9ebac | 2026-03-28T17:45:00.872Z | /home/user/my-project      | claude-sonnet-4-6 | 36       |
| 18b7e801 | 2026-03-28T03:13:13.354Z | /home/user/other-project   | claude-sonnet-4-6 | 239      |
+----------+--------------------------+----------------------------+-------------------+----------+

Features

  • List sessions sorted by most recent activity
  • Dump raw message entries from any session
  • Transcribe sessions as a human-readable chat log
  • Inspect sub-agent runs with the same list/dump/transcribe commands
  • Live follow (--follow) streams new entries as a session is written
  • Multiple output formats: table, JSON, XML
  • Local cache with lazy sync — only re-parses files that have changed on disk

Installation

Prerequisites

  • Rust (stable) — install via rustup

From source

git clone https://github.com/pop/claudbg
cd claudbg
cargo install --path .

With Nix flakes

nix run github:pop/claudbg

Or add to your flake inputs and install into your profile:

inputs.claudbg.url = "github:pop/claudbg";

Usage

Listing sessions

# Show all sessions, most recent first
claudbg sessions list

# Show full UUIDs and paths
claudbg sessions list --verbose

# Output as JSON
claudbg sessions list --output json

Reading a session

Session IDs can be given as the full UUID or an 8-character prefix.

# Dump raw message entries (sequence, timestamp, type, role, content preview)
claudbg sessions dump 21fae0a8

# Full content, no truncation
claudbg sessions dump 21fae0a8 --verbose

# Human-readable transcript (user/assistant turns, tool calls)
claudbg sessions transcribe 21fae0a8

# Include thinking blocks and tool output in the transcript
claudbg sessions transcribe 21fae0a8 --include thinking,output

# Stream new entries as they are written (e.g. while a session is active)
claudbg sessions transcribe 21fae0a8 --follow

Sub-agent runs

Claude Code uses sub-agents for long-running tasks. claudbg agents mirrors the sessions commands for those runs.

# List all sub-agent runs within a session
claudbg agents list 21fae0a8

# Transcribe a specific sub-agent run
claudbg agents transcribe 21fae0a8 <agent-id>

# Follow a live sub-agent run
claudbg agents transcribe 21fae0a8 <agent-id> --follow

Indexing

The database is kept in sync lazily (on every read command). You can also trigger a full resync manually:

# Sync any changed session files
claudbg index

# Force rebuild of the entire cache
claudbg index --force

Global flags

Flag Description
--output table|json|xml Output format (default: table)
--verbose Show full UUIDs and untruncated content
--include thinking,output Include thinking blocks and/or tool results in transcripts

Database

claudbg stores its cache at ~/.claude/claudbg.db (libsql/SQLite). The JSONL files under ~/.claude/projects/ are always the source of truth — the database is a read-through cache and can be deleted or rebuilt at any time.

Roadmap

  • tui — Terminal UI for browsing sessions interactively
  • query — Run ad-hoc SQL against the session cache (claudbg query "SELECT ...")
  • Token usage reports — Aggregate cost/usage across sessions and date ranges
  • Search — Full-text search across session content
  • Export — Export transcripts to Markdown or HTML
  • Watch mode — Automatically index new sessions as Claude Code writes them

Development

The project uses Nix flakes for a reproducible dev environment:

nix develop    # enter the dev shell (provides rustup, cargo-nextest, etc.)
cargo build
cargo nextest run
cargo clippy --all-targets -- -D warnings
nix flake check   # runs the full CI suite

License

MIT