# Claude Code – Don't Attach Open File by Default

> Source: <https://github.com/anthropics/claude-code/issues/63925>
> Published: 2026-08-02 10:00:58+00:00

-
[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)

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

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

[enhancementNew feature or request](https://github.com/anthropics/claude-code/issues?q=state%3Aopen%20label%3A%22enhancement%22)New feature or request

[platform:vscodeIssue specifically occurs in VS Code](https://github.com/anthropics/claude-code/issues?q=state%3Aopen%20label%3A%22platform%3Avscode%22)Issue 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](https://github.com/anthropics/claude-code/issues?q=state%3Aopen%20label%3A%22area%3Aide%22)

[enhancementNew feature or request](https://github.com/anthropics/claude-code/issues?q=state%3Aopen%20label%3A%22enhancement%22)New feature or request

[platform:vscodeIssue specifically occurs in VS Code](https://github.com/anthropics/claude-code/issues?q=state%3Aopen%20label%3A%22platform%3Avscode%22)Issue specifically occurs in VS Code
