Add persistent setting to disable auto-attached open-file context in VSCode extension

Resolved 💬 3 comments Opened May 13, 2026 by benitogf Closed May 16, 2026

Problem

The VSCode native extension automatically attaches the currently-opened editor file to every turn as an <ide_opened_file> context block. For most prompts this file is unrelated to what the user is asking, and silently biases the model toward it.

The in-prompt eye-icon toggle hides it for a single turn, but resets each turn. There is no way to flip the default.

Request

Add a persistent setting (in ~/.claude/settings.json or VSCode settings under claude-code.*) to make the default off, with the eye-icon used to opt in per turn when the open file is actually relevant.

Suggested key: claude-code.autoAttachOpenFile: false (default true to preserve current behavior).

Why

  • Reduces noise / token usage on unrelated prompts
  • Prevents accidental context bleed when the user has a sensitive or unrelated file open
  • Matches user intent: the file is in the IDE, not in the conversation, unless explicitly shared

Environment

  • Claude Code VSCode extension v2.1.140
  • VSCode on Linux (WSL2)

---
🤖 Generated with Claude Code

View original on GitHub ↗

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