--- # claudbg-d9ev title: '`sessions dump` should collapse consecutive identical rows' status: completed type: bug priority: normal created_at: 2026-03-30T04:38:42Z updated_at: 2026-03-30T05:08:51Z parent: claudbg-tci9 --- ## Problem `sessions dump` produces hundreds of identical consecutive rows (e.g. repeated `progress` entries) that differ only in timestamp, making the output very noisy. ## Example Rows 555–661 in session `21fae0a8` are all `progress` entries with the same type, role, and content preview. They currently appear as 107 separate table rows. ## Expected behavior Consecutive rows that are identical in all fields *except* the timestamp should be collapsed into a single row with a range indicator: ``` 555-661 | progress | | ``` Only collapse truly identical rows (same `type`, `role`, and `content` preview). Do not collapse if any of these differ. ## Scope - Applies to `sessions dump` table output only. - Does **not** apply to `sessions transcribe`. - Does **not** apply to `--follow` mode (streaming). - JSON/XML output should also collapse (the range can be represented as `{"seq_start": 555, "seq_end": 661, ...}`). ## Implementation hint After building the `rows` vector in `dump()`, run a post-processing pass: iterate rows and merge consecutive runs where `row[2]` (type), `row[3]` (role), and `row[4]` (content) are all equal. Replace the merged run with a single row whose `#` column shows `N-M` and whose timestamp is dropped or shows the first timestamp. ## Relevant files - `src/commands/sessions.rs` — `dump()` function, row-building loop ## Summary of Changes Added collapse_dump_rows() post-processing pass in sessions.rs that merges consecutive rows with identical type/role/content into a single row with seq shown as 'N-M' range. Applied before output format branching so it affects table, JSON, and XML output uniformly.