[Feature Request] Add settings to disable auto-attaching active editor file and selection by default

Status Closed — duplicate
Maintainer reply None cached
Activity 7 comments · opened May 30, 2026 · closed Aug 20, 2026

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" />

View original on GitHub ↗

5 Comments

andrew-west-empromptu · 2 months ago

Agreed! I almost never want claude's attention on the file I just looked at and if I do it's trivial to type the file name with my message. The file pointer was designed for co editing files with claude but that is not the workflow for me and I'm sure many others.

ShatterSide · 2 months ago

Agreed! Just default it to hidden please!

It's not entirely useless and I use it sometimes. But 95%+ of the time I do not.

Red-Eyed · 2 months ago

+1 — this is a daily frustration for me.

Using the VS Code extension, the active file/selection gets auto-attached into context on almost every message. The problems:

  • I constantly attach files I didn't mean to, which silently burns tokens (and on large files in my repo, a lot of them).
  • The per-message eye toggle resets every turn, so there's no way to make "don't auto-attach" my default.

Please add a persistent setting to disable automatic file/selection context inclusion — e.g. claude-code.autoAttachContext: false — so it's opt-in per message rather than opt-out. Even a global default in settings.json would solve this. Thanks!

vbelius · 1 month ago

+1

It's repeatedly a source of great frustration for me.

driemekasten · 1 month ago

PLEASE!!! Implement this. This is absolutely annoying!

Showing cached comments. Read the full discussion on GitHub ↗