Add `in:<N>`, `out:<N>`, and `tokens:<N>` filter fields (with `:`, `>`, `<`
operators) to the TUI filter query language. Populate input_tokens and
output_tokens on SessionListItem from the DB sessions table, wire them into
the SessionRow trait, and update the help modal to document the new fields.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Home jumps to the top (scroll = 0) and End jumps to the bottom, mirroring
the existing gg/G vim-style bindings. Help modal updated to document both.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the '>' prefix + yellow fg on the selected/viewing agent row with
Modifier::REVERSED applied to the full span, matching ratatui Table highlight
conventions and removing the need for a cursor character.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Press '/' to immediately focus the filter input on the session-list
screen and the search input on the transcript screen, matching the
less(1) convention. Updates help modal and placeholder hint text.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- claudbg-vqhj: '/' key to focus filter/search bar
- claudbg-j9az: bug — model column always blank in sessions list
- claudbg-6m2c: token count filter fields (in:/out:/tokens: with </> ops)
- claudbg-e49f: Home/End keys to jump to top/bottom of transcript
- claudbg-8bs3: color-highlight selected agent row instead of '>' cursor
Removed "project truncates beginning" TODO item — already implemented
in truncate_project() which prepends '…' and keeps the tail.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
Add --scope=project|user flag to `sessions list` (default: project).
When project scope is active, only sessions whose project_path matches
the current working directory are shown. Use --scope=user to see all.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the user is viewing a SubagentTranscript, the corresponding entry
in the sub-agents panel is now highlighted with '>' prefix regardless
of which panel has keyboard focus.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When on SubagentTranscript, Esc or Backspace now goes back to the parent
session's Transcript view (lazy-reloads entries) instead of jumping all
the way to the session list. Transcript → session list path unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gg (double-g): jump to top of transcript via pending_g chord detection.
G (Shift+G): jump to bottom of transcript.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Compute total rendered lines on each page-down keypress and cap the
scroll offset so it cannot scroll past the last line.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Query the DB cache on TUI startup to enrich SessionListItems with
message_count and fallback project_path for sessions whose JSONL
first line lacks a cwd field.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Also close claudbg-4g3l, claudbg-ltt0, claudbg-37cj as already implemented.
Fixes pre-existing fmt issues in agents.rs, sessions.rs, filter.rs, and TUI files.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Created 10 beans covering all tracked work items:
- claudbg-x45o: sessions list --scope flag (project-scoped by default)
- claudbg-9627: sessions list missing project path bug
- claudbg-zniv: TUI missing project path bug
- claudbg-0yk4: TUI message count always 0
- claudbg-4gtn: Space/PageDown scrolls past transcript end
- claudbg-e4ac: selected agent highlights in agents widget
- claudbg-mfpd: back-navigation from agent to session transcript
- claudbg-u28r: search highlight unreadable in light mode
- claudbg-trk3: Shift+G jump to bottom of transcript
- claudbg-6t38: gg jump to top of transcript
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 months ago
33 changed files with 1051 additions and 200 deletions
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: todo
status: completed
type: task
type: task
priority: normal
created_at: 2026-03-31T00:32:57Z
created_at: 2026-03-31T00:32:57Z
updated_at: 2026-03-31T00:32:57Z
updated_at: 2026-04-01T05:44:59Z
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: todo
status: completed
type: feature
type: feature
priority: normal
created_at: 2026-03-31T00:32:40Z
created_at: 2026-03-31T00:32:40Z
updated_at: 2026-03-31T00:32:40Z
updated_at: 2026-04-01T05:44:56Z
---
---
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: todo
status: completed
type: feature
type: feature
priority: normal
created_at: 2026-03-31T00:32:35Z
created_at: 2026-03-31T00:32:35Z
updated_at: 2026-03-31T00:32:35Z
updated_at: 2026-04-01T05:44:58Z
---
---
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).