In the TUI session list, the message count column always shows 0. The message count is not being populated from the database or computed correctly for the TUI.
## Summary of Changes
In `src/tui/run.rs`: after building the session list from disk discovery, open the DB and query `session_id, COALESCE(project_path, ''), message_count` from the sessions table. Use `tokio::task::block_in_place` to run the async DB query from the synchronous TUI startup. Populate `msg_count` on each `SessionListItem` from the DB result.
title: Add --[no-]color global flag and NO_COLOR env var support
title: Add --[no-]color global flag and NO_COLOR env var support
status: completed
status: todo
type: task
type: task
priority: normal
created_at: 2026-03-31T00:32:57Z
created_at: 2026-03-31T00:32:57Z
updated_at: 2026-04-01T05:44:59Z
updated_at: 2026-03-31T00:32:57Z
parent: claudbg-qpfe
parent: claudbg-qpfe
---
---
Add `--color` / `--no-color` as a global CLI flag (available on all commands). When not specified, auto-detect: enable color if stdout is a tty and NO_COLOR is unset/empty. Honor the NO_COLOR environment variable (any non-empty value → disable color), per the NO_COLOR spec. This flag controls all ANSI output in the CLI (transcripts etc).
Add `--color` / `--no-color` as a global CLI flag (available on all commands). When not specified, auto-detect: enable color if stdout is a tty and NO_COLOR is unset/empty. Honor the NO_COLOR environment variable (any non-empty value → disable color), per the NO_COLOR spec. This flag controls all ANSI output in the CLI (transcripts etc).
## Summary of Changes
Already implemented prior to this bean being created. `GlobalOpts` in `src/cli.rs` has `--color`/`--no-color` flags and `color_enabled()` respects `NO_COLOR` env var per spec.
title: Limit list output to 10 by default with --limit flag
title: Limit list output to 10 by default with --limit flag
status: completed
status: todo
type: feature
type: feature
priority: normal
created_at: 2026-03-31T00:32:40Z
created_at: 2026-03-31T00:32:40Z
updated_at: 2026-04-01T05:44:56Z
updated_at: 2026-03-31T00:32:40Z
---
---
Both `sessions list` and `agents list <session-id>` should default to showing only the 10 most recent entries (sorted most-recent-first). Add a `--limit=<N|all>` flag to override: accepts an integer (e.g. `--limit=50`) or the keyword `all` to show everything.
Both `sessions list` and `agents list <session-id>` should default to showing only the 10 most recent entries (sorted most-recent-first). Add a `--limit=<N|all>` flag to override: accepts an integer (e.g. `--limit=50`) or the keyword `all` to show everything.
## Summary of Changes
Already implemented prior to this bean being created. The `Limit` enum with `Count(10)` default is in `src/cli.rs`, applied via `--limit` flag on both `sessions list` and `agents list`.
title: 'TUI: Space/PageDown scrolls past end of transcript'
status: completed
type: bug
priority: normal
created_at: 2026-03-31T23:45:06Z
updated_at: 2026-04-01T05:51:55Z
---
Space/PageDown in the transcript view continues scrolling past the last line. It should stop at the bottom of the transcript content.
## Summary of Changes
In `src/tui/screens/transcript.rs`, the PageDown/Space handler now clamps scroll to the actual content length: computes `total_lines = build_chat_lines(...).len()` and `max_scroll = total_lines.saturating_sub(page_height)`, then applies `.min(max_scroll)` to prevent scrolling into empty space. Updated 3 existing tests to populate entries before testing scroll behavior.
Add token-based filter fields to the filter query language so users can narrow the session list by token usage.\n\nSupported fields and operators:\n- in:<int> — tokens in (input tokens)\n- out:<int> — tokens out (output tokens)\n- tokens:<int> — total tokens (in + out)\n- All three support <and> comparisons (e.g. tokens:>50000, in:<1000)\n\nRequiresstoringtokencountspersessionintheDBandexposingthemviatheFilter::matches()path.
Implemented: added in:, out:, and tokens: filter fields. SessionListItem now carries input_tokens/output_tokens populated from DB. SessionRow trait extended. Help modal updated.
Add gg (double-g) keybinding in the transcript view to jump to the top of the transcript (vim-style gg navigation). Requires buffering single 'g' keypress to detect the chord.
## Summary of Changes
Added `pending_g: bool` field to `AppState` (init to false). In `handle_transcript_event`, clear `pending_g` on any key that isn't 'g', then handle 'g': if `pending_g` was already set, scroll to top (gg); otherwise set `pending_g = true`.
title: 'TUI: color-highlight selected agent row instead of ''>'' cursor'
status: completed
type: feature
priority: normal
created_at: 2026-04-01T06:11:10Z
updated_at: 2026-04-01T06:16:40Z
---
In the sub-agents panel (transcript screen), the currently selected/viewed agent is shown with a '>' prefix and yellow text. Instead, use row-level color highlighting (e.g. reversed or bold style on the full row) so the cursor character is not needed — matching how ratatui Table highlights work.\n\nThe rendering is in the subagent_lines iterator in src/tui/screens/transcript.rs. Replace the '> {short_id} {agent_type}' format with ' {short_id} {agent_type}' and apply a highlight style (e.g. Modifier::REVERSED) to the selected row span instead.
## Summary of Changes
Replaced '>' prefix + yellow fg on selected/viewing agent row with Modifier::REVERSED on the full span in the subagent_lines iterator (src/tui/screens/transcript.rs). All rows now use ' {short_id} {agent_type}' text; the highlight is conveyed entirely through the reversed video style.
title: 'sessions list: some sessions show no project path'
status: completed
type: bug
priority: normal
created_at: 2026-03-31T23:44:53Z
updated_at: 2026-04-01T05:59:53Z
---
Some entries in `claudbg sessions list` do not display a project path. Investigate why the project path is missing for certain sessions.
## Summary of Changes
Fixed `read_cwd_from_first_line()` in `src/parser/discovery.rs`. The old code stopped after the first non-empty line even if it contained no `cwd` field. The fix scans up to 20 non-empty lines looking for any entry with a `cwd` field. Claude Code typically writes `cwd` on a `system`-type entry which may not be the very first line in all session files.
title: 'TUI: Home/End keys jump to top/bottom of transcript'
status: completed
type: feature
priority: normal
created_at: 2026-04-01T06:11:02Z
updated_at: 2026-04-01T06:19:13Z
---
Add Home and End key bindings in the transcript screen to complement the existing gg/G vim-style bindings:\n- Home → jump to top of transcript (same as gg)\n- End → jump to bottom of transcript (same as G)\n\nHandle in handle_transcript_event() in src/tui/screens/transcript.rs alongside the existing Char('g')/Char('G') cases.
title: 'TUI: selected agent highlights in agents widget when viewing agent transcript'
status: completed
type: feature
priority: normal
created_at: 2026-03-31T23:45:09Z
updated_at: 2026-04-01T05:55:52Z
---
When an agent transcript is being viewed, the corresponding agent entry in the agents widget panel should be highlighted/selected to show which agent is active.
## Summary of Changes
In `render_transcript` (`src/tui/screens/transcript.rs`), changed the agent highlight condition to check two cases: `is_viewing` (current screen is `SubagentTranscript` with matching `agent_id`) OR `is_panel_selected` (index matches `subagent_selected` and panel has focus). The agent in view is always highlighted regardless of which panel has focus.
title: 'TUI: model column always blank in sessions list'
status: completed
type: bug
priority: normal
created_at: 2026-04-01T06:10:52Z
updated_at: 2026-04-01T06:13:14Z
---
The Model column in the TUI session-list screen is always empty. Root cause: when building SessionListItem in src/tui/run.rs the model field is set to String::new(), and the DB enrichment query (SELECT session_id, project_path, message_count FROM sessions) does not fetch the model column. The model field does exist in the sessions DB table. Fix: add model to the enrichment SELECT and populate item.model during the enrichment loop.
## Summary of Changes
Added model to the DB enrichment query in src/tui/run.rs and populated item.model in the enrichment loop.
title: 'sessions: no sub-command defaults to sessions list'
title: 'sessions: no sub-command defaults to sessions list'
status: completed
status: todo
type: feature
type: feature
priority: normal
created_at: 2026-03-31T00:32:35Z
created_at: 2026-03-31T00:32:35Z
updated_at: 2026-04-01T05:44:58Z
updated_at: 2026-03-31T00:32:35Z
---
---
Running `claudbg sessions` with no sub-command should behave identically to `claudbg sessions list`. Note: `claudbg agents` does NOT get this treatment since agents list requires a session ID.
Running `claudbg sessions` with no sub-command should behave identically to `claudbg sessions list`. Note: `claudbg agents` does NOT get this treatment since agents list requires a session ID.
## Summary of Changes
Already implemented prior to this bean being created. `src/main.rs` uses `cmd.unwrap_or(SessionsCmd::List { limit: Default::default(), filter: vec![] })` so `claudbg sessions` defaults to `sessions list`.
title: 'TUI: navigate back to main session transcript from agent transcript'
status: completed
type: feature
priority: normal
created_at: 2026-03-31T23:45:12Z
updated_at: 2026-04-01T05:55:11Z
---
There is currently no way to navigate back to the main session transcript after drilling into an agent transcript. Add a keybinding (e.g. Backspace or Escape) to return to the parent session view.
## Summary of Changes
Added `go_back_to_transcript(parent_session_id)` to `AppState` in `state.rs`: transitions to `Screen::Transcript { session_id: parent_session_id }`, clears transcript entries (to trigger lazy-reload), and leaves `subagents` intact (they belong to the parent session).
Changed the Esc/Backspace arm in `handle_transcript_event` (`transcript.rs`) to be context-aware: when on `SubagentTranscript`, calls `go_back_to_transcript` to return to the parent session view; when on `Transcript`, calls `go_back` to return to the session list. Backspace is added as a second binding alongside Escape.
title: 'TUI: Shift+G jumps to bottom of transcript'
status: completed
type: feature
priority: normal
created_at: 2026-03-31T23:45:17Z
updated_at: 2026-04-01T05:53:50Z
---
Add Shift+G keybinding in the transcript view to jump to the bottom of the transcript (vim-style G navigation).
## Summary of Changes
Added `KeyCode::Char('G')` arm in `handle_transcript_event`: computes total rendered lines via `build_chat_lines` and sets `transcript_scroll` to `total_lines.saturating_sub(page_height)` — same clamping as PageDown, but jumps directly to bottom.
title: 'TUI: search highlight text unreadable in light mode'
status: completed
type: bug
priority: normal
created_at: 2026-03-31T23:45:15Z
updated_at: 2026-04-01T05:45:54Z
---
In light mode, the selected/highlighted search match text is too dark to read against the highlight background. The search highlight colors need to be adjusted to be legible in both light and dark mode.
## Summary of Changes
Changed `SEARCH_HIGHLIGHT` style in `src/tui/screens/transcript.rs` from `bg(Color::Yellow).fg(Color::Black)` to `bg(Color::Blue).fg(Color::White)`. Blue/white is universally readable in both light and dark terminal themes.
Pressing '/' in the session list or transcript screen should immediately focus the filter/search input, matching the less(1) convention. Currently 't' and Tab are the only bindings that open the filter. The '/' binding should work on both the session-list screen (opens the filter bar) and the transcript screen (opens the search bar).
title: 'sessions list: scope to current project by default with --scope flag'
status: completed
type: feature
priority: normal
created_at: 2026-03-31T23:44:50Z
updated_at: 2026-04-01T05:58:09Z
---
When run inside a project directory, `claudbg sessions` should only list sessions for that project (similar to how `claude /continue` lists sessions for that project). Override with `--scope=[user|project|local]` — default is 'project'.
## Summary of Changes
Added `SessionScope` enum (`Project` | `User`) to `src/cli.rs`.
Added `--scope` flag to `SessionsCmd::List` with default `project`.
Updated `sessions::list()` signature to accept `scope: SessionScope`.
When scope is `Project`, resolves the current working directory and filters raw rows to only include sessions whose `project_path` exactly matches the CWD. Scope `User` shows all sessions (previous behavior).
title: 'TUI: some sessions show no project path in session list'
status: completed
type: bug
priority: normal
created_at: 2026-03-31T23:44:55Z
updated_at: 2026-04-01T05:49:51Z
blocking:
- claudbg-9627
---
In the TUI session list, some sessions do not display a project path. Likely related to the same root cause as the CLI bug (claudbg-9627).
## Summary of Changes
Implemented together with claudbg-0yk4 in `src/tui/run.rs`. When `sr.project_path` from disk discovery is empty (cwd not present in first JSONL line), fall back to the `project_path` stored in the DB sessions table (which is populated during `claudbg index` sync by scanning all JSONL entries).