Skip to content

feat: new session command with keep/delete prompt on exit - #10

Merged
alexmt merged 1 commit into
mainfrom
feat/new-session-cmd
Apr 11, 2026
Merged

feat: new session command with keep/delete prompt on exit#10
alexmt merged 1 commit into
mainfrom
feat/new-session-cmd

Conversation

@alexmt

@alexmt alexmt commented Apr 11, 2026

Copy link
Copy Markdown
Owner

Closes #9

Summary

  • [n] starts claude (no --resume) in the current working directory; respects the --dangerously-skip-permissions setting
  • On exit: reloads sessions from disk, diffs against a pre-launch snapshot of IDs to find the new session
  • If a new session is found: shows "Session ended — keep it?" overlay in the preview pane
    • y / enter / esc → keep (no-op)
    • n → delete (uses existing deleteSessionsessionDeletedMsg flow)
  • If the user exits claude immediately and nothing was created: silently refreshes the list
  • Clears any active search on reload so the new session is always visible in the list

Implementation notes

  • newSessionExitMsg carries the pre-launch ID snapshot; handled by handleNewSessionExit
  • confirmNew / newSessionID fields drive the overlay; routed before other key handlers in Update
  • esc and enter both keep — safe-default to prevent accidental deletion

🤖 Generated with Claude Code

Press n to start a fresh claude session in the current working
directory. After exit, the preview pane shows "Session ended — keep
it?": y/enter/esc keeps, n deletes. Prevents one-off sessions from
accumulating in the list.

Sessions are detected by snapshotting existing IDs before launch, then
diffing after store.Load() on exit. The --dangerously-skip-permissions
setting is respected when starting new sessions.

Closes #9

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alexmt
alexmt merged commit c019edd into main Apr 11, 2026
1 check passed
@alexmt
alexmt deleted the feat/new-session-cmd branch April 11, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: new session command with keep/delete prompt on exit

1 participant