VSCode Extension: Add setting to disable automatic IDE selection/context injection into conversations
Problem
The VSCode extension automatically injects IDE selection context (selected text, open file paths) into new Claude Code conversations. There is no setting to disable this behavior.
This causes cross-contamination between unrelated work sessions. In a multi-ticket workflow where different files from different tickets may be open in the editor, starting a new conversation about Ticket B will silently inject file paths and content from Ticket A if those files happen to be open or selected.
Real-world impact
In our case, the agent picked up a scratch directory path from an unrelated ticket's file that was open in the IDE (c:\repo\temp\tickets\ltcrcm-1317\scratch\investigate-output.txt) and used it as the working directory for a completely different ticket (LTCRCM-1360). This broke ticket isolation and could have caused cross-contamination of investigation artifacts between tickets.
The injected context appears in <ide_selection> tags and is presented as "The user selected the lines X to Y from [path]" — which makes the agent treat it as relevant context even when it has nothing to do with the user's actual request.
Requested behavior
Add a VSCode extension setting (e.g., claude-code.includeIdeSelection: true|false) to completely disable automatic injection of IDE selection context into conversations. Default can remain true for backwards compatibility, but users working across multiple concurrent workstreams need the ability to start clean conversations without IDE bleed-through.
Current workarounds (all inadequate)
- Eye icon toggle: Must be clicked manually every single conversation — easy to forget
- Close all other files: Impractical when working across multiple tickets
- Separate VSCode windows: Heavy-handed; defeats the purpose of a single workspace
- Use CLI instead: Loses all VSCode integration benefits
Environment
- Claude Code VSCode Extension
- Windows 11
- Multi-ticket development workflow with file-based ticket isolation
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗