claude-code - 💡(How to fix) Fix [FEATURE]VS Code extension: no way to disable auto-attachment of active editor file to chat context

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

This is disruptive when working across multiple chat tabs on different topics: every conversation gets injected with context from whatever file happens to be open in the editor, regardless of relevance. The only available workaround is manually clicking the file chip in the input bar to exclude it — this must be repeated for every single message.

RAW_BUFFERClick to expand / collapse

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

When a file is open in the VS Code editor, the Claude Code extension automatically attaches it to every chat conversation — including unrelated chats and new conversations opened while that file remains active. There is no setting to disable this behavior.

This is disruptive when working across multiple chat tabs on different topics: every conversation gets injected with context from whatever file happens to be open in the editor, regardless of relevance. The only available workaround is manually clicking the file chip in the input bar to exclude it — this must be repeated for every single message.

I verified all 33 Claude-related settings in VS Code — none of them control this behavior.

Proposed Solution

Add a VS Code setting: Claude Code: Auto-attach Active Editor File (boolean, default: true).

When set to false, the active editor file should not be automatically added to chat context. Users would still be able to attach files manually via the + button.

Alternative Solutions

Currently working around it by clicking the eye icon on the file chip before every message to exclude it from context. This is the only available control and it's tedious.

Priority

High - Significant impact on productivity

Feature Category

Performance and speed

Use Case Example

I have test.gs open in the editor/selected/clicked once in the left panel I open a new Claude chat to ask an unrelated question (e.g., about a different project) The .gs file is automatically attached to the new chat I have to manually exclude it before sending If I switch to another chat tab — same problem repeats With this setting disabled, none of this would happen. Files would only enter context when I explicitly add them.

Additional Context

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING