[FEATURE] Persistent setting to disable auto-attach of active editor file/selection

Status Closed — duplicate
Maintainer reply None cached
Activity 2 comments · opened Aug 3, 2026 · closed Aug 15, 2026

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

  1. I keep several reference files open in tabs (docs, notes, configs) unrelated to my current task.
  2. I ask Claude a question that has nothing to do with those open files.
  3. With this feature, the open file wouldn't be silently attached. I'd only include it when I explicitly want to via @-mention.
  4. This would save tokens and keep context relevant on every prompt, without requiring a manual toggle each time.

Additional Context

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗