Add v0.1.0 project plan: 37 beans across 7 epics

Milestone: v0.1.0 - Core Session Inspector
Epics: CLI Foundation, Data Parsing & Models, Database & Caching,
Output Formatting, Sessions Commands, Agent Commands, Stub Commands

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Elijah Voigt 2 months ago
parent c85e353c70
commit b6740f0f9e

@ -0,0 +1,10 @@
---
# claudbg-3wel
title: v0.1.0 - Core Session Inspector
status: todo
type: milestone
created_at: 2026-03-27T19:36:45Z
updated_at: 2026-03-27T19:36:45Z
---
First release: CLI foundation, session/agent data parsing, DB caching, and core inspect commands (list, dump, transcribe).

@ -0,0 +1,15 @@
---
# claudbg-4d4h
title: Sessions Commands
status: todo
type: epic
priority: normal
created_at: 2026-03-27T19:36:52Z
updated_at: 2026-03-27T19:41:00Z
parent: claudbg-3wel
blocked_by:
- claudbg-6wkk
- claudbg-g7zj
---
sessions list, dump, transcribe subcommands and --follow streaming flag.

@ -0,0 +1,14 @@
---
# claudbg-6wkk
title: Database & Caching
status: todo
type: epic
priority: normal
created_at: 2026-03-27T19:36:52Z
updated_at: 2026-03-27T19:41:00Z
parent: claudbg-3wel
blocked_by:
- claudbg-mztt
---
libsql setup, DB schema (normalized + denormalized), lazy sync, and index command.

@ -0,0 +1,11 @@
---
# claudbg-76fy
title: Implement JSONL session file reader
status: todo
type: task
created_at: 2026-03-27T19:39:15Z
updated_at: 2026-03-27T19:39:15Z
parent: claudbg-mztt
---
Async function that reads a .jsonl file line by line using tokio, deserializes each line into SessionEntry, and skips/logs malformed lines gracefully. Must handle partial last lines (live session writes).

@ -0,0 +1,12 @@
---
# claudbg-7vkw
title: 'index subcommand: full resync'
status: todo
type: task
priority: normal
created_at: 2026-03-27T19:39:33Z
updated_at: 2026-03-27T19:39:44Z
parent: claudbg-6wkk
---
Implement `claudbg index` which walks all discovered session and agent files and syncs them into the DB (respecting lazy-sync mtime/size checks). Add --force flag to clear all cached data and rebuild from scratch. Print progress (N sessions indexed, M skipped).

@ -0,0 +1,11 @@
---
# claudbg-ag0r
title: follow flag for agents commands
status: todo
type: task
created_at: 2026-03-27T19:40:39Z
updated_at: 2026-03-27T19:40:39Z
parent: claudbg-g12t
---
Add --follow flag to 'agents dump' and 'agents transcribe', mirroring the sessions --follow implementation. Watches the sub-agent JSONL file for new appended lines.

@ -0,0 +1,11 @@
---
# claudbg-b1pa
title: Stub Commands
status: todo
type: epic
created_at: 2026-03-27T19:36:52Z
updated_at: 2026-03-27T19:36:52Z
parent: claudbg-3wel
---
tui and query subcommands that print 'coming soon\!' placeholders.

@ -0,0 +1,11 @@
---
# claudbg-bh11
title: sessions list command
status: todo
type: task
created_at: 2026-03-27T19:40:02Z
updated_at: 2026-03-27T19:40:02Z
parent: claudbg-4d4h
---
Implement 'claudbg sessions list'. Default columns: session ID (short 8-char), date (ISO or human-relative), project path, model, message count. With --verbose: full UUID. Supports --output flag. Sorted chronologically (most recent first). Lazily syncs session index before querying.

@ -0,0 +1,11 @@
---
# claudbg-bt5p
title: XML output renderer
status: todo
type: task
created_at: 2026-03-27T19:40:53Z
updated_at: 2026-03-27T19:40:53Z
parent: claudbg-g7zj
---
Implement --output=xml renderer. Not a strict XML schema — use XML tags as section guards to aid model attention (e.g. <session>, <message role='assistant'>, <tool_use name='Bash'>, <thinking>, <content>). Mechanically wraps each logical section. No DTD or schema validation required.

@ -0,0 +1,11 @@
---
# claudbg-d3aj
title: Session statistics computation
status: todo
type: task
created_at: 2026-03-27T19:39:15Z
updated_at: 2026-03-27T19:39:15Z
parent: claudbg-mztt
---
Given a parsed list of SessionEntries, compute: total input/output/cache tokens (sum across all assistant message usage fields), tool call counts keyed by tool name, session duration (sum of durationMs from system messages with subtype=turn_duration), model (from first assistant message). Return a SessionStats struct.

@ -0,0 +1,11 @@
---
# claudbg-edmr
title: 'Lazy sync: process session files on read'
status: todo
type: task
created_at: 2026-03-27T19:39:33Z
updated_at: 2026-03-27T19:39:33Z
parent: claudbg-6wkk
---
Before serving any session data, check if the session's file_mtime and file_size in the DB match the file on disk. If not (or if absent), parse the file and upsert into all tables. Skip files that are already up to date. This runs transparently before every command that reads session data.

@ -0,0 +1,11 @@
---
# claudbg-ei6j
title: sessions dump command
status: todo
type: task
created_at: 2026-03-27T19:40:02Z
updated_at: 2026-03-27T19:40:02Z
parent: claudbg-4d4h
---
Implement 'claudbg sessions dump <session-id>'. Minimal processing: read each JSONL line and render it as a table row with columns: #, timestamp, type, role, content preview (truncated). Expands newlines in content for readability. With --verbose: show full content, no truncation. Accepts short (8-char prefix) or full session ID.

@ -0,0 +1,11 @@
---
# claudbg-fkyt
title: JSON output renderer
status: todo
type: task
created_at: 2026-03-27T19:40:52Z
updated_at: 2026-03-27T19:40:52Z
parent: claudbg-g7zj
---
Implement --output=json renderer: serialize the data model to pretty-printed JSON using serde_json. All commands should produce clean, parseable JSON with no extra decorations.

@ -0,0 +1,11 @@
---
# claudbg-ftb9
title: Table output renderer
status: todo
type: task
created_at: 2026-03-27T19:40:52Z
updated_at: 2026-03-27T19:40:52Z
parent: claudbg-g7zj
---
Implement the table renderer using comfy-table or tabled. Define a trait (e.g. Renderable) that all data types implement to produce a table. Used as the default --output=table format. Handle terminal width gracefully (truncate or wrap columns).

@ -0,0 +1,15 @@
---
# claudbg-g12t
title: Agent Commands
status: todo
type: epic
priority: normal
created_at: 2026-03-27T19:36:52Z
updated_at: 2026-03-27T19:41:00Z
parent: claudbg-3wel
blocked_by:
- claudbg-6wkk
- claudbg-g7zj
---
agents list, dump, transcribe subcommands for sub-agent sessions and --follow flag.

@ -0,0 +1,11 @@
---
# claudbg-g5uv
title: Session file discovery
status: todo
type: task
created_at: 2026-03-27T19:39:15Z
updated_at: 2026-03-27T19:39:15Z
parent: claudbg-mztt
---
Walk ~/.claude/projects/ to enumerate all session .jsonl files. Decode URL-encoded directory names (e.g. -run-media-pop-... → /run/media/pop/...) to recover the project path. Return a list of SessionRef { session_id: Uuid, project_path: PathBuf, file_path: PathBuf, modified_at: SystemTime }.

@ -0,0 +1,14 @@
---
# claudbg-g7zj
title: Output Formatting
status: todo
type: epic
priority: normal
created_at: 2026-03-27T19:36:52Z
updated_at: 2026-03-27T19:41:00Z
parent: claudbg-3wel
blocked_by:
- claudbg-h7xu
---
Table (default), JSON, and XML output renderers behind the global --output flag.

@ -0,0 +1,11 @@
---
# claudbg-goc1
title: libsql DB setup and connection
status: todo
type: task
created_at: 2026-03-27T19:39:32Z
updated_at: 2026-03-27T19:39:32Z
parent: claudbg-6wkk
---
Initialize a libsql connection to ~/.claude/claudbg.db using tokio. Create the DB file if it does not exist. Expose a DbPool or Connection handle shared across the app. Support a --clear flag that drops and recreates the DB.

@ -0,0 +1,11 @@
---
# claudbg-h7xu
title: CLI Foundation
status: todo
type: epic
created_at: 2026-03-27T19:36:52Z
updated_at: 2026-03-27T19:36:52Z
parent: claudbg-3wel
---
Main CLI entry point, clap subcommand structure, global flags, output format infrastructure, and shared utilities.

@ -0,0 +1,11 @@
---
# claudbg-hskl
title: Denormalized raw sessions table
status: todo
type: task
created_at: 2026-03-27T19:39:32Z
updated_at: 2026-03-27T19:39:32Z
parent: claudbg-6wkk
---
Create a raw_sessions table (session_id TEXT PK, raw_jsonl TEXT, file_mtime INTEGER, file_size INTEGER) storing the full file content as a blob. Used for dump and fast retrieval when normalized tables are overkill.

@ -0,0 +1,11 @@
---
# claudbg-i09w
title: App error type and Result alias
status: todo
type: task
created_at: 2026-03-27T19:38:56Z
updated_at: 2026-03-27T19:38:56Z
parent: claudbg-h7xu
---
Define a top-level AppError enum (IoError, ParseError, DbError, NotFound, etc.) and a Result<T> alias. Use thiserror or a similar crate.

@ -0,0 +1,11 @@
---
# claudbg-i8tm
title: query subcommand stub
status: todo
type: task
created_at: 2026-03-27T19:40:53Z
updated_at: 2026-03-27T19:40:53Z
parent: claudbg-b1pa
---
Add 'claudbg query' subcommand via clap. Handler prints: 'query: coming soon!' and exits 0. Include placeholder help text describing the intended behavior: filter/search sessions by project, date, tool use, with key:value and key:glob syntax.

@ -0,0 +1,11 @@
---
# claudbg-iwqj
title: agents transcribe command
status: todo
type: task
created_at: 2026-03-27T19:40:39Z
updated_at: 2026-03-27T19:40:39Z
parent: claudbg-g12t
---
Implement 'claudbg agents transcribe <session-id> <agent-id>'. Same structure as sessions transcribe: stats header (token counts, tool use breakdown, duration, model) + pretty-printed chat log. Respects --include flag.

@ -0,0 +1,11 @@
---
# claudbg-jupi
title: Sub-agent file discovery
status: todo
type: task
created_at: 2026-03-27T19:39:15Z
updated_at: 2026-03-27T19:39:15Z
parent: claudbg-mztt
---
Given a session ID, locate its subagents/ directory under ~/.claude/projects/{project-dir}/{session-id}/subagents/. Enumerate agent-{id}.jsonl files and their corresponding .meta.json files. Return AgentRef { agent_id: String, agent_type: Option<String>, session_id: Uuid, file_path: PathBuf }.

@ -0,0 +1,11 @@
---
# claudbg-ki43
title: agents list command
status: todo
type: task
created_at: 2026-03-27T19:40:39Z
updated_at: 2026-03-27T19:40:39Z
parent: claudbg-g12t
---
Implement 'claudbg agents list <session-id>'. Columns: agent ID (short 8-char hex), agent type (from .meta.json, e.g. Explore/Plan/general-purpose), message count. With --verbose: full agent ID. Accepts short or full session ID. Supports --output flag.

@ -0,0 +1,11 @@
---
# claudbg-kzcs
title: agents dump command
status: todo
type: task
created_at: 2026-03-27T19:40:39Z
updated_at: 2026-03-27T19:40:39Z
parent: claudbg-g12t
---
Implement 'claudbg agents dump <session-id> <agent-id>'. Same as sessions dump but reads the sub-agent JSONL file. Minimal processing: table row per entry with #, timestamp, type, role, content preview. --verbose for full content.

@ -0,0 +1,11 @@
---
# claudbg-lmdl
title: tui subcommand stub
status: todo
type: task
created_at: 2026-03-27T19:40:53Z
updated_at: 2026-03-27T19:40:53Z
parent: claudbg-b1pa
---
Add 'claudbg tui' subcommand via clap. Handler prints: 'tui: coming soon!' and exits 0. Subcommand should have a brief description in --help output.

@ -0,0 +1,11 @@
---
# claudbg-m4p1
title: sessions transcribe command
status: todo
type: task
created_at: 2026-03-27T19:40:02Z
updated_at: 2026-03-27T19:40:02Z
parent: claudbg-4d4h
---
Implement 'claudbg sessions transcribe <session-id>'. Header section: SessionStats (token counts, tool call breakdown by name, duration, model). Body: each message rendered as a chat log entry — user text, assistant text blocks, tool use (name + input always shown; output shown only if 'output' is in --include), thinking blocks shown only if 'thinking' in --include. Default --include: tools.

@ -0,0 +1,14 @@
---
# claudbg-mztt
title: Data Parsing & Models
status: todo
type: epic
priority: normal
created_at: 2026-03-27T19:36:52Z
updated_at: 2026-03-27T19:41:00Z
parent: claudbg-3wel
blocked_by:
- claudbg-h7xu
---
Rust types for all JSONL message variants, file discovery, JSONL reader, and session statistics computation.

@ -0,0 +1,11 @@
---
# claudbg-nmuu
title: Define global CLI flags
status: todo
type: task
created_at: 2026-03-27T19:38:56Z
updated_at: 2026-03-27T19:38:56Z
parent: claudbg-h7xu
---
Add global flags available to all subcommands: --output [table|json|xml] (default: table), --verbose (bool), --include <list> (comma-separated: thinking,output,tools — default: tools). These must be accessible from every command handler.

@ -0,0 +1,11 @@
---
# claudbg-pkyj
title: Implement main CLI entry point and subcommand structure
status: todo
type: task
created_at: 2026-03-27T19:38:56Z
updated_at: 2026-03-27T19:38:56Z
parent: claudbg-h7xu
---
Wire up clap App with top-level subcommands: sessions, agents, index, tui, query. Each subcommand is a separate clap subcommand group. Binary entry point dispatches to the correct handler.

@ -0,0 +1,11 @@
---
# claudbg-uls1
title: Define Rust types for JSONL schema
status: todo
type: task
created_at: 2026-03-27T19:39:15Z
updated_at: 2026-03-27T19:39:15Z
parent: claudbg-mztt
---
Model the full JSONL schema as serde-deserializable Rust types: SessionEntry enum (user/assistant/system/progress/file-history-snapshot/queue-operation), AssistantContent enum (text/thinking/tool_use), UserContent enum (text/tool_result/image), Usage struct, ToolUseInput, SystemMessage subtypes, ProgressData. All fields should match the on-disk schema discovered from ~/.claude/projects/.

@ -0,0 +1,11 @@
---
# claudbg-umrv
title: 'Normalized DB schema: sessions, messages, tool_uses tables'
status: todo
type: task
created_at: 2026-03-27T19:39:32Z
updated_at: 2026-03-27T19:39:32Z
parent: claudbg-6wkk
---
Create tables: sessions (session_id, project_path, file_path, first_message_at, last_message_at, model, message_count, file_mtime, file_size), messages (id, session_id, uuid, timestamp, type, role, content_json), tool_uses (id, session_id, message_uuid, tool_name, input_json, result_json). Include indexes on session_id and timestamp.

@ -0,0 +1,11 @@
---
# claudbg-x7wb
title: Short UUID display utility
status: todo
type: task
created_at: 2026-03-27T19:38:56Z
updated_at: 2026-03-27T19:38:56Z
parent: claudbg-h7xu
---
Utility function: given a UUID string, return the first 8 characters as the short form. Used in sessions list, agents list, etc. when --verbose is not passed.

@ -0,0 +1,11 @@
---
# claudbg-yugb
title: Add Cargo.toml dependencies
status: todo
type: task
created_at: 2026-03-27T19:38:56Z
updated_at: 2026-03-27T19:38:56Z
parent: claudbg-h7xu
---
Add clap (derive feature), tokio (full), serde + serde_json, libsql, chrono, uuid, and a table rendering crate (comfy-table or tabled) to Cargo.toml.

@ -0,0 +1,11 @@
---
# claudbg-zwoj
title: follow flag for sessions commands
status: todo
type: task
created_at: 2026-03-27T19:40:28Z
updated_at: 2026-03-27T19:40:28Z
parent: claudbg-4d4h
---
Add --follow flag to 'sessions dump' and 'sessions transcribe'. After reading to end of file, continue watching the file for new lines (similar to tail -f). New entries are rendered and appended to output as they arrive. Use tokio file watching or polling.

@ -67,7 +67,9 @@
cargo-watch cargo-watch
cargo-edit cargo-edit
cargo-nextest cargo-nextest
clang
beans beans
jq
]; ];
}; };
}); });

Loading…
Cancel
Save