claude-code - 💡(How to fix) Fix [Feature Request] Add settings to disable auto-attaching active editor file and selection by default

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Why: I often want to control context explicitly via @-mentions rather than have the open file injected automatically. Reasons include: avoiding leaking unrelated/open files into the prompt, keeping context lean, and prompting about something other than the file I happen to be viewing. The existing Read(...) deny-rule workaround is per-path and also blocks Claude from reading those files when I do want it to — so it's not a substitute.

Current workaround: Per-message × on the chip / eye-slash toggle, or Read deny rules for specific sensitive paths. Neither provides a global default-off.

RAW_BUFFERClick to expand / collapse

Summary: The VS Code extension automatically attaches the currently open editor file (and current text selection) as context on every prompt. There is currently no way to turn this off by default — it can only be suppressed per-message (clicking × on the chip, or the eye-slash selection toggle), which resets each turn.

Request: A persistent setting to default auto-context to off, ideally with separate toggles:

  • disable auto-attach of active editor file
  • disable auto-share of current selection
  • Configurable via the extension settings panel and/or settings.json (e.g. claudeCode.autoAttachActiveFile: false).

Why: I often want to control context explicitly via @-mentions rather than have the open file injected automatically. Reasons include: avoiding leaking unrelated/open files into the prompt, keeping context lean, and prompting about something other than the file I happen to be viewing. The existing Read(...) deny-rule workaround is per-path and also blocks Claude from reading those files when I do want it to — so it's not a substitute.

Current workaround: Per-message × on the chip / eye-slash toggle, or Read deny rules for specific sensitive paths. Neither provides a global default-off.

<img width="711" height="126" alt="Image" src="https://github.com/user-attachments/assets/53ad2c95-aec4-4e13-8592-ad3625428304" />

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Feature Request] Add settings to disable auto-attaching active editor file and selection by default