[FEATURE] VS Code Extension: Add "Clear Context" option when exiting Plan Mode
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
When using Claude Code in VS Code with plan mode enabled (Initial Permission Mode: plan), after Claude finishes planning and the user approves the plan, the session continues execution in the same context window. This means:
- All the planning context (exploration, hypothesis testing, file reads) remains in the conversation
- The context window is already partially consumed before implementation even begins
- This can lead to suboptimal performance on complex implementations due to accumulated context
In contrast, the CLI version (terminal/iTerm/Ghostty) recently received a significant improvement: when exiting plan mode, users now see options like:
Would you like to proceed?
❯ 1. Yes, clear context and bypass permissions
2. Yes, and manually approve edits
3. Yes, and bypass permissions
4. Yes, manually approve edits
5. Type here to tell Claude what to change
The key feature is "Yes, clear context and..." - this clears the context window and automatically starts a fresh session, pasting in the plan as the initial prompt. This ensures implementation begins with a clean slate and the full plan as context.
VS Code users don't have this option. The extension simply continues in the same session after plan approval.
Proposed Solution
Add the same "clear context" options to the VS Code extension when exiting plan mode:
- After plan approval, show a modal or quick pick menu with options matching the CLI:
- "Yes, clear context and bypass permissions"
- "Yes, clear context and manually approve edits"
- "Yes, and bypass permissions" (current behavior)
- "Yes, and manually approve edits" (current behavior)
- When "clear context" is selected:
- End the current session
- Automatically start a new session in the same working directory
- Paste the plan file contents (or a reference to it) as the initial user prompt
- Apply the selected permission mode
- UX details:
- The plan file path should be shown so users know where their plan is saved
- The transition should be seamless - users shouldn't need to manually copy/paste anything
Alternative Solutions
Current workaround: Users must manually:
- Copy the plan file path
- End the session
- Start a new conversation
- Paste the plan contents or reference
This is tedious and error-prone. Users often forget to clear context, leading to degraded performance on complex implementations.
Other tools: Some AI coding assistants automatically manage context by starting fresh sessions for different phases of work.
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
- User opens Claude Code in VS Code with
Initial Permission Mode: plan - User requests: "Implement a new authentication system with OAuth2"
- Claude explores the codebase, reads 15+ files, forms a plan
- Claude writes the plan and calls
ExitPlanMode - Current behavior: User approves, implementation starts with 50%+ context already used
- Desired behavior: User selects "Yes, clear context and bypass permissions", a fresh session starts with just the plan, implementation has full context available
Additional Context
Screenshots
The CLI now shows this menu when exiting plan mode:
Would you like to proceed?
❯ 1. Yes, clear context and bypass permissions
2. Yes, and manually approve edits
3. Yes, and bypass permissions
4. Yes, manually approve edits
5. Type here to tell Claude what to change
ctrl-g to edit in VS Code · .claude/plans/example-plan.md
Technical Considerations
- The VS Code extension should save the plan to the same location as CLI (
.claude/plans/) - The new session should inherit workspace settings
- Consider showing a brief transition indicator so users know the context was cleared
- The plan file reference could use the existing
ctrl-g to edit in VS Codepattern from CLI
Why This Matters
Plan mode's value proposition is "think first, then execute." However, if the thinking phase consumes significant context, the execution phase suffers. The CLI team clearly recognized this by adding the "clear context" feature - VS Code users deserve the same optimization.
6 Comments
This seems like a huge problem with the VS Code extension and also it should be trivial to fix.
I would love this as well. I use Claude Code in the terminal instead of VS Code for this single reason. I'd rather use the extension for the ability to navigate the prompt window better and I prefer the fonts/visual.
This is also my biggest issue currently with my workflow in VS Code with having to manually clear context on plan exit.
This is the only reason I don't use the VSCode extension in plan mode. The clear context stuff is really needed
Issue #18750 Verification
Title: [FEATURE] VS Code Extension: Add "Clear Context" option when exiting Plan Mode
Issue Date: 2026-01-17
Verification Date: 2026-04-07
Status: RESOLVED
---
Issue Summary
This issue reports that the VS Code plan-mode approval flow lacked the CLI-style clear-context option, so implementation continued in the same conversation instead of being able to start from a fresh session.
---
Verification Results
Claim 1: Plan mode now exposes a clear-context option on the plan accept screen
Status: RESOLVED
At https://code.claude.com/docs/en/settings, line 208:
showClearContextOnPlanAccept | Show the "clear context" option on the plan accept screen. Defaults to false. Set to true to restore the option.Verdict: The current settings docs explicitly document the clear-context option on the plan accept screen.
---
Claim 2: The dialog can start a fresh implementation session instead of always keeping the same conversation
Status: RESOLVED
At https://code.claude.com/docs/en/hooks-guide, line 365:
The hook path always keeps the current conversation: it cannot clear context and start a fresh implementation session the way the dialog can.Verdict: The current docs explicitly distinguish the normal dialog from the hook path and state that the dialog can clear context and start a fresh implementation session.
---
Claim 3: This is part of the current plan-mode behavior in Claude Code's editor integrations
Status: RESOLVED
At https://code.claude.com/docs/en/changelog, line 343:
Changed plan mode to hide the "clear context" option by default (restore with "showClearContextOnPlanAccept": true).At https://code.claude.com/docs/en/settings, line 461:
The same precedence applies whether you run Claude Code from the CLI, the VS Code extension, or a JetBrains IDE.Verdict: The changelog confirms the option exists in the current product, and the settings docs confirm the same settings model applies in the VS Code extension.
---
Current State
| Claim | Status |
|-------|--------|
| Clear-context option exists on the plan accept screen | RESOLVED |
| Dialog can start a fresh implementation session | RESOLVED |
| Setting applies to VS Code extension workflows | RESOLVED |
---
Suggested Fix
N/A - issue has been resolved.
---
References
showClearContextOnPlanAcceptand describes the clear-context option on the plan accept screen.---
Conclusion & Recommendation
Primary Concern: The request asked for a VS Code plan-mode path that can clear context before implementation begins.
Resolution Status: RESOLVED
Recommendation: CLOSE
Current public docs now describe the clear-context plan-accept option and explicitly explain that the dialog can start a fresh implementation session. Based on the current documented behavior, this request appears addressed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.