[FEATURE] Persistent config option to disable IDE context sharing (opened files, selections)
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
The Claude Code VS Code extension automatically sends the currently opened file name and any highlighted text selection to the API as part of the system prompt context (ide_opened_file and ide_selection tags). There is no setting to disable this behavior.
There is a toggle in the input field UI (crossed eye icon) to disable this per session, but it does not persist between sessions or reboots. Every time the editor restarts, context sharing is re-enabled silently.
Additionally, the eye icon toggle is only visible when there are open editors. If no files are open when the session starts, there is no indication that this behavior is active. As soon as a file is opened, it gets shared silently before the user has a chance to toggle it off.
This is a privacy concern. When using Claude Code as a sidebar panel, any file open in the editor (including personal, medical, legal, or financial documents) has its filename and selection content sent to the API without persistent, explicit consent.
Proposed Solution
Add a persistent configuration option in settings.json to disable IDE context sharing entirely:
{
"claudeCode.sendEditorContext": false
}
Or more granular options:
{
"claudeCode.sendOpenedFileName": false,
"claudeCode.sendEditorSelection": false
}
The setting should persist across sessions and reboots, unlike the current per-session toggle.
Alternative Solutions
- The in-UI toggle (crossed eye icon) exists but resets every session. Making that toggle persist would be a minimal fix.
- Closing sensitive files before using Claude Code works but is not practical when using the sidebar panel alongside normal editor work.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
- User opens a personal document in VS Code (medical notes, personal writing, financial records)
- User switches to the Claude Code sidebar panel to work on a coding task
- The extension silently sends the personal document's filename (and any selected text) as context in the API request
- User has no persistent way to prevent this. The per-session toggle resets on every restart
- With this feature, the user could set
sendEditorContext: falseonce and never worry about accidental context leakage
Additional Context
- The
DISABLE_TELEMETRYandDO_NOT_TRACKenvironment variables do not affect this behavior, as it is part of the core API request, not telemetry - This is especially important for users in regulated industries or with strict personal privacy requirements
- Related issues: #24726 (open since Feb 2026, no dev response), #40869 (open since May 2026, reports of credential leaks), #53518 (closed as stale)
- See comment below for a proof-of-concept patch with code analysis
Environment
- Claude Code VSIX version: 2.1.159 (Anthropic.claude-code-2.1.159@linux-x64)
- IDE: VSCodium 1.100.3 (also affects VS Code)
- OS: Linux (Nobara 43 / Fedora)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗