Skip to content

[FEATURE] VS Code extension: add setting to disable auto-attach of open file / selection #24726

@interconnectedMe

Description

@interconnectedMe

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

The VS Code sidebar chat automatically includes the currently open file and any text selection as context on every prompt. The only way to suppress this is the per-prompt eye-icon toggle, which resets after each message. There is no persistent setting to disable it.

Proposed Solution

Add a persistent VS Code extension setting (e.g. claude-code.autoAttachContext: false) that disables automatic inclusion of the active editor file and selection. The default can remain true to preserve current behaviour for users who want it.

Alternative Solutions

Make the eye-icon toggle "sticky" so it remembers the user's last choice across messages
Add a per-workspace setting so some projects auto-attach and others don't

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

I frequently keep reference files open in tabs (docs, config, notes) that are unrelated to my current Claude conversation. Every single message I send requires an extra click on the eye icon to hide irrelevant context. Over a session with dozens of messages this adds up to significant friction.

Additional Context

The @-mention system already provides an explicit way to include files when needed, so disabling auto-attach doesn't remove any capability — it just makes inclusion opt-in rather than opt-out.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions