Feature request: option to disable ide_opened_file context in VSCode extension
Summary
The Claude Code VSCode extension automatically sends the currently focused file's path (via <ide_opened_file> tag) as context when starting a new session. There is currently no setting to disable this behavior.
Problem
This is a security concern for users who frequently work with sensitive files such as:
.envfiles containing API keys and secrets- Database credential files
- Cloud deployment configs (e.g.,
.env.gcp.prd)
Every time a user opens a new Claude Code session while viewing one of these files, the file path (and potentially content) is automatically sent as conversation context. Users may not realize this is happening, leading to unintentional exposure of sensitive information.
Proposed Solution
Add a configurable setting (e.g., claude.disableOpenFileContext or claude.contextProviders.openFiles: false) that allows users to opt out of the ide_opened_file context being sent automatically.
Alternatively, or in addition:
- Support a glob-based exclusion pattern (e.g.,
claude.contextExcludePatterns: ["**/.env*", "**/credentials*"]) so users can selectively block sensitive file types from being included as context. - Respect
.gitignorepatterns — files already excluded from version control are often sensitive and should not be sent as context by default.
Additional Context
This was discovered when .env.gcp.prd.gcp was automatically captured as the opened file context. The user had no prior awareness that this was being sent to the model. A simple toggle would give users control over this behavior and reduce the risk of accidental secret exposure.
Environment
- OS: Windows 11
- Claude Code VSCode Extension
- Claude Opus 4.6 (1M context)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗