[FEATURE] Persistent setting to disable auto-attach of active editor file/selection
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 VS Code extension (and IDE integration generally) automatically attaches the currently open file and any active selection as context on every prompt. There's no persistent way to turn this off. Only a per-message eye-icon toggle that resets after each turn. For workflows where the open file is usually unrelated to the question being asked, this adds unwanted context/noise and wastes tokens on every single message.
Proposed Solution
Add a persistent setting (e.g. claudeCode.autoAttachOpenFile or a ~/.claude/settings.json key) that disables automatic inclusion of the active editor file and selection by default. When off, the eye icon could still be used to opt in per-turn when the open file is actually relevant. Explicit @-mentions should continue to work as normal.
Alternative Solutions
Current workaround is a Read deny rule for a specific file path, but that's per-file and also blocks Claude from reading that file even when I explicitly ask it to via @-mention. so it's not a real substitute for a global default-off toggle. The only other option is manually toggling the eye icon before every single message, which is easy to forget and adds friction to every prompt.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
- I keep several reference files open in tabs (docs, notes, configs) unrelated to my current task.
- I ask Claude a question that has nothing to do with those open files.
- With this feature, the open file wouldn't be silently attached. I'd only include it when I explicitly want to via @-mention.
- This would save tokens and keep context relevant on every prompt, without requiring a manual toggle each time.
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗