[BUG] VS Code 2.1.268: current-file chip Hide toggle replaced by X - context auto-attach opt-out no longer persists
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
In 2.1.268 the VS Code extension replaced the current-file chip's Hide toggle with an X. The changelog presents this as an improvement. It removed the only working opt-out from IDE context auto-attach.
There is now no supported way -- setting, command, keybinding, or environment variable -- to stop the active editor file and selection from being injected into every prompt.
The X is not a replacement for what it replaced. Read from the shipped webview/index.js in 2.1.270: the X calls dismissSelection(), which stores the dismissed selection in dismissedSelection, and applySelectionUpdate() then suppresses re-attachment only while that same file remains active. Dismissal is scoped per file, not per session or per conversation. Switch tabs and the chip returns. Switch back and it returns again.
A reference file kept open -- docs, a config, a template -- must be dismissed every single time focus returns to it. The Hide toggle held its state. That is the regression.
The same release also moved the indicator from the status line into the composer, so the thing that must now be repeatedly dismissed also sits directly in the input being typed in.
What Should Happen?
Dismissing the current-file chip should persist until the user reverses it, as the Hide toggle did.
Better: a setting. claudeCode.autoAttachActiveFile (or autoAttachContext / shareIdeSelection -- all proposed across the open issues below), default true to preserve current behavior, honored per workspace.
An X and a persistent opt-out are orthogonal. Shipping the first did not require deleting the second, and both can coexist:
- Keep the X. Removal should be discoverable -- #20886 and #26577 were right about that.
- Restore persistence, via a setting or by making the X sticky for the session.
@-mentions already provide explicit, precise file inclusion. Opt-in is the correct default for context this expensive. That is not what is being asked for here -- only the option.
Error Messages/Logs
CHANGELOG.md, 2.1.268:
- [VSCode] Changed the current-file chip in the message box: an X now removes it,
replacing the Hide toggle
- Improved the prompt footer: an editor or /diff selection now shows inside the
prompt input, and fullscreen mode shows Remote Control status in the header
instead of the footer
Steps to Reproduce
- Install Claude Code for VS Code 2.1.268 or later (reproduced on 2.1.270).
- Open two files in the editor,
a.mdandb.ts. - Open a Claude Code chat panel. With
a.mdfocused, the current-file chip showsa.md. - Click the X on the chip. The chip clears.
- Click the
b.tstab. The chip reappears showingb.ts. - Click back to the
a.mdtab. The chip reappears showinga.mdagain, despite step 4. - Repeat indefinitely. There is no setting, command, or keybinding that stops this.
On 2.1.267, the Hide toggle in step 4 stayed off.
Additional confirmation that no opt-out exists: the extension contributes 17 settings and 28 commands in 2.1.270; none governs context attachment. onDidChangeActiveTextEditor and onDidChangeTextEditorSelection in extension.js are registered unconditionally with no config or environment gate.
Claude Model
_No response_
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.267
Claude Code Version
2.1.270 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
The issues this change resolved were asking for the opposite
#20886 (Jan 26, 2026, closed as not planned, marked stale) reports as a bug that there is no way to remove the attachment: no X, no context menu, backspace does nothing, closing the file in the editor does not remove it, and the only workaround is reloading the window.
#26577 (Feb 18, 2026, closed as duplicate) states the goal outright: the attachment "unnecessarily consumes tokens," and the reporter "must resort to closing file tabs or switching files as workarounds."
Neither reporter wanted a better button. Both wanted the open file to stop being context. The X was the mechanism they could infer from the UI in front of them, not the objective.
Notably, neither issue mentions the Hide toggle -- good evidence it was undiscoverable. That is a real problem and worth fixing. It did not require deleting the toggle.
Also worth noting: #20886 was closed as not planned and marked stale, and the change it requested then shipped roughly seven months later.
The standing request set
Persistent opt-out has been requested continuously for seven months: #23968, #24726, #25179, #45991, #63925, #65641, and #66162 (closed as duplicate) -- plus #20886 and #26577 above. Nine issues, one goal: don't send my open file.
No maintainer has replied on any of them. There is no public record of the trade-off being weighed, only the outcome, shipped as an improvement.
There is no workaround
The only complete workarounds available today are:
- Work with zero editor tabs open -- the listener clears context when
visibleTextEditors.length === 0-- which defeats the purpose of an IDE extension; or - Patch
webview/index.jsin the installed extension and pin the version so auto-update does not revert it.
Users are doing (2); community patch scripts for this circulate publicly. When the remedy for a default is editing a vendor's minified bundle and refusing updates, the default is wrong.
Impact
Per-message friction in the primary input path, on by default, with no off switch. It spends tokens on irrelevant files, and it sends whatever happens to be open -- including files a user would not choose to send -- without an affirmative action.
Note on Terminal/Shell: not applicable. This is the VS Code extension's native UI (claudeCode.useTerminal is false), not a terminal session. Selected "Other" as the closest available option.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗