VS Code: setting to default-disable auto-attached editor selection / open-file notice

Resolved 💬 1 comment Opened Jun 1, 2026 by andrew-west-empromptu Closed Jun 2, 2026

Summary

The VS Code extension auto-attaches two things to every prompt:

  1. The path of the currently open file (as an <ide_opened_file> notice, ~25 tokens).
  2. The current editor selection, if any (as ⧉ Selected N lines from <file>).

There's no way to make this default-off.

Motivation: attention noise, not byte cost

The byte cost of the open-file notice is trivial. The real issue is attention — the agent sees the path and infers the open file may be relevant to the task, even when it isn't. For users who drive Claude Code primarily via explicit @-mentions or natural-language references, the auto-attached path is a steady source of subtle misdirection. Selected text amplifies this further.

Auto-attach is great when you want it. It's noise when you don't, and there's no way to flip the default.

Existing workarounds and why they fall short

  1. Per-conversation eye-slash toggle on the selection indicator — manual, doesn't persist across sessions, and (as far as I can tell) only covers selection, not the open-file notice.
  2. Read deny rules in settings.json — these block all access to the path, including explicit @-mentions and tool reads. That's not what users want here: the goal is "don't auto-attach, but let me still reference it on demand." Deny rules conflate suppression with prohibition.
  3. Terminal mode (useTerminal: true) — gives up the graphical panel entirely.

Request

Add an extension setting (e.g. claudeCode.includeEditorContext, default true for back-compat) that disables auto-attachment of the selection AND the open-file notice. Optional refinement: separate keys for selection vs. open-file (claudeCode.includeSelection, claudeCode.includeOpenFile), since some users may want one but not the other.

When off, users would still opt in per-prompt via @-mentions — which is already first-class and explicit.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗