claude-code - 💡(How to fix) Fix Add persistent setting to disable auto-attached open-file context in VSCode extension [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#58620Fetched 2026-05-14 03:43:33
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
1
Author
Timeline (top)
labeled ×4cross-referenced ×2commented ×1
RAW_BUFFERClick to expand / collapse

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

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