[FEATURE] Interactive session deletion in the `--resume` picker (like Ctrl+X in `claude agents`)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Summary
The claude --resume picker has no way to delete a session. You can preview (Space), rename (Ctrl+R), filter by project/branch/worktree, and search — but old or forked sessions can only be removed by manually deleting .jsonl files from ~/.claude/projects/<project>/. The claude agents view already supports interactive removal via Ctrl+X; the resume picker should offer the same.
Motivation
- Forked sessions and dead-end resumes accumulate quickly and clutter the picker, making it hard to find the session you actually want.
- The only current way to clean them up is to leave the picker, locate the right
.jsonlon disk, andrmit by hand — error-prone and easy to delete the wrong one. claude agentsalready establishes the pattern (Ctrl+X to remove), so there's a consistent, discoverable UX to mirror.
Proposed Solution
In the claude --resume picker:
- Add a Ctrl+X binding to delete the highlighted session, matching
claude agents. - Use the same confirm-by-repeat behavior as
claude agents: the first Ctrl+X prompts "press Ctrl+X again to confirm," and a second Ctrl+X deletes. No separate confirmation dialog — behavior should be identical toclaude agents. - Refuse or warn when the target is a live/background session (e.g. a running background agent) — stop it first rather than deleting the file out from under it.
- Reflect the deletion in the list immediately and add the key to the picker footer (alongside
Ctrl+R to rename, etc.).
Alternative Solutions
There is no in-picker option today. The only current ways to delete a session:
- Delete the transcript file manually. Each session/fork is one
.jsonlunder~/.claude/projects/<project>/. Removing it drops it from the picker (permanent, no undo):
``bash``
rm ~/.claude/projects/<project>/<session-id>.jsonl
- Stop live/background sessions first. If the session is still running as a background agent, deleting the file out from under it is unsafe — stop it in
claude agents(Ctrl+X) first, then delete the.jsonl.
Both are manual, out-of-band, and easy to get wrong (deleting the wrong file, or a still-live session) — which is exactly why an in-picker delete is wanted.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
Environment
- Claude Code version: 2.1.198
- Platform: Linux (CLI / console)
Related
- #79122
- #79435