[FEATURE]
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
Title: Feature request: Confirm before closing chat window to prevent accidental context loss
Body:
Problem
When using Claude Code in the VS Code extension, it's very easy to accidentally close the chat panel (e.g., by clicking the wrong button, pressing a shortcut, or closing the sidebar). When this happens, the entire conversation context is lost immediately with no way to recover it.
This is especially painful during long, complex sessions where significant context has been built up — architectural decisions, debugging progress, multi-step plans, etc. Losing all of that in one accidental click is extremely frustrating.
Proposed Solution
Proposed Solution
Add a confirmation dialog before closing/destroying an active chat session. For example:
"You have an active conversation. Are you sure you want to close it? This will clear all context."
[Close] [Cancel]
The confirmation should appear when:
The user closes the chat panel
The user closes the VS Code window with an active session
Any action that would destroy the current conversation context
Optionally, this could be a setting (claude-code.confirmBeforeClosing: true/false) for users who prefer the current behavior.
Alternative Solutions
Alternatives Considered
Auto-save/restore sessions: More complex but would also solve the problem by persisting conversation state
Undo close: Allow reopening the last closed session (similar to "Reopen Closed Editor" in VS Code)
Additional Context
This is a common UX pattern — browsers confirm before closing tabs with form data, terminals confirm before killing processes, etc. A chat session with accumulated context deserves the same protection.
Priority
High - Significant impact on productivity
Feature Category
Interactive mode (TUI)
Use Case Example
_No response_
Additional Context
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗