feat: prune a conversation from the TUI with Ctrl+R#16
Merged
Conversation
Adds a per-conversation prune action mirroring the Ctrl+D delete flow: Ctrl+R on the selected row opens a confirm prompt showing its size, and on confirm prunes that one file in place (dropping toolUseResult + file-history-snapshot via the shared pruneFile) and refreshes the SIZE column. The conversation stays in the list, just smaller. This is the TUI half of the prune feature; the `ccs prune` CLI is the batch half.
brtkwr
added a commit
that referenced
this pull request
Jun 22, 2026
Adds a per-conversation prune action mirroring the Ctrl+D delete flow. Ctrl+R on the selected row measures the projected saving and opens a confirm prompt - "Prune "<topic>"? 75MB -> 53MB, saves 21MB (keeps dialogue). [y/N]" - and on confirm prunes that one file in place via the shared pruneFile (drops toolUseResult + file-history-snapshot, integrity-checked atomic replace) and refreshes the SIZE column. The conversation stays in the list, just smaller. Lands on main directly: the original #16 was stacked on the CLI-prune branch and merged into that branch instead of main, so the Ctrl+R binding never reached main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The TUI half of the prune feature: a per-conversation prune action, mirroring the Ctrl+D delete flow.
Prune "<topic>" (75MB)? Removes duplicate data, keeps dialogue. [y/N]pruneFile(dropstoolUseResult+file-history-snapshot, integrity-checked atomic replace), and refreshes the SIZE column in place. The conversation stays in the list, just smaller.--helpkeybindings updated.This is the clean way to prune (and then resume-test) a single low-risk conversation, vs the batch
ccs pruneCLI.Stacked on #14
Based on
feat/prune-cli(#14) since it reusespruneFile. Targets that branch so the diff is just the TUI action; it'll retarget tomainonce #14 merges (and I'll rebase over the responsive-width changes from #15).Tests
TestPruneConversationShrinksAndUpdatesSize- prunes a temp conversation, asserts the file shrinks, the snapshot is gone, the message is kept, and the displayed size (in bothitemsandfiltered) updates.TestCtrlREntersAndCancelsPruneConfirm- Ctrl+R enters confirm mode, Esc cancels.go test -cover= 64.1%.Note
Pruning runs synchronously on confirm (like Ctrl+D delete), so a multi-GB file briefly blocks the UI. Acceptable for a confirmed one-off; async with a spinner is a possible later polish.