feat(picker): delete a session from disk with Ctrl-D#3
Merged
Conversation
Add provider-aware session deletion, triggered by Ctrl-D on the highlighted
row and gated behind a y/N confirm.
- new internal/del package: BuildPlan + Delete
- claude: remove <uuid>.jsonl plus the per-uuid session-env/ and
file-history/ sidecar dirs
- codex: run native `codex delete <id>` (prunes its index db), then remove
the rollout file as a fallback
- copilot / gemini: remove the whole per-session directory
- guardOK: every target must be absolute, under $HOME, and >=3 segments
deep, so a malformed session can never target $HOME or ~/.claude itself
- picker: Ctrl-D arms a red "delete <provider> <cwd>? (y/N)" prompt; y deletes
and drops the row (green status), any other key cancels; a failed delete
keeps the row and shows the error. Delete is injected as a callback to keep
the picker decoupled from del.
- tests: del plan building + guard rejection; picker arm/cancel/confirm/drop
and failure-keeps-row.
- docs: README + --help document the key.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Adds provider-aware session deletion to the picker. Press Ctrl-D on the highlighted row, then y to confirm (any other key cancels).
How each provider is handled
<uuid>.jsonlplus the per-uuidsession-env/<uuid>andfile-history/<uuid>sidecar directories (both confirmed to be per-UUID dirs), so no orphans are left behind.codex delete <id>first (it also prunes Codex's own history/index db), then remove the rollout file as a fallback if the CLI isn't onPATH.Safety
del.guardOKgates every removal target: it must be an absolute path, live under$HOME, and be at least 3 segments deep. A malformed session (empty ID/File) can therefore never target$HOME,~/.claude,~/.codex, etc.os.RemoveAlltreats already-missing paths as success.UX
delete <provider> <cwd>? (y/N)prompt on the top line.ydeletes, drops the row from the list, and shows a green status; any other key cancels.delpackage.Tests
internal/del: plan building per provider + guard rejection (shallow / outside-home / home itself).internal/picker: Ctrl-D arm → cancel, arm → confirm → drop row, and failure-keeps-row.Docs updated in README and
--help.🤖 Generated with Claude Code