cd /news/developer-tools/claude-code-don-t-attach-open-file-b… · home topics developer-tools article
[ARTICLE · art-83606] src=github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Claude Code – Don't Attach Open File by Default

A feature request on GitHub's Anthropic Claude Code repository, issue #63925, asks for a persistent setting to disable the VS Code extension's default auto-attachment of the active editor file and current selection as context on every prompt. The requester notes that the current workaround of per-message dismissal or Read deny rules is insufficient, and proposes a setting like claudeCode.autoAttachActiveFile: false.

read1 min views1 publishedAug 2, 2026
Claude Code – Don't Attach Open File by Default
Image: source
[Notifications](/login?return_to=%2Fanthropics%2Fclaude-code)You must be signed in to change notification settings -
[Fork 22.5k](/login?return_to=%2Fanthropics%2Fclaude-code)


[area:ide](https://github.com/anthropics/claude-code/issues?q=state%3Aopen%20label%3A%22area%3Aide%22)

enhancementNew feature or requestNew feature or request

platform:vscodeIssue specifically occurs in VS CodeIssue specifically occurs in VS Code

Description #

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.

Metadata #

Metadata #

Assignees

Labels

area:ide enhancementNew feature or requestNew feature or request

platform:vscodeIssue specifically occurs in VS CodeIssue specifically occurs in VS Code

── more in #developer-tools 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-don-t-at…] indexed:0 read:1min 2026-08-02 ·