[FEATURE] Per-chip remove affordance for attachments in VS Code extension
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When working with a file in VS Code, it gets automatically attached to the Claude CoThe Claude Code VS Code extension lets users attach code snippets to the chat input via Ctrl+U (Send Selection to Claude). Each invocation adds a new pill/chip referencing the selected range. In practice, users often
accumulate many snippets across a session — sometimes 5–10+ ranges from several different files — to build a focused, multi-context prompt.
However, once a chip is in the input area, there is no way to remove a single chip selectively:
- The chip has no X (close) icon
- Hovering reveals no remove affordance
- Right-click shows no context menu
- Selecting the chip and pressing Backspace/Delete does nothing
- Closing the source file in the editor does not remove its reference
The only known workaround is Reload Window (Cmd/Ctrl+Shift+P → "Reload Window"), which wipes every chip and forces the user to re-select all the snippets they actually wanted to keep. If a user has added 9 references and
wants to remove just 3, they must redo the 6 selections that were perfectly fine.
This is related to, and broader than, issue #20886, which describes the same UI limitation specifically for the auto-attached current-file reference.de chat input (appears as a pill like ".claude.json").
<img width="650" height="810" alt="Image" src="https://github.com/user-attachments/assets/c3961d11-2366-48e1-8769-e37643511aa7" />
Proposed Solution
Add per-chip removal affordances to every attachment/selection pill in the chat input area:
- An inline X (close) icon on each chip — visible on hover, clickable to remove only that chip.
- Keyboard support — place the caret immediately after a chip and press Backspace to delete just that one chip (matches behavior of typical token/pill inputs).
- Right-click context menu on a chip with at least:
- "Remove this reference"
- "Remove all references"
- (Bonus) "Reveal in editor" to jump back to the source range.
The X icon (item 1) alone would already unblock the core workflow; items 2 and 3 would bring parity with how attachment pills behave in Cursor, GitHub Copilot Chat, and ChatGPT.
Alternative Solutions
- "Clear all attachments" button that wipes only chips while preserving typed text. A partial improvement — still forces re-selection of anything the user wanted to keep.
- "Manage attachments" popover listing every chip in a vertical list with a remove button next to each. Heavier UI, but more scalable when the input contains many chips.
- Auto-prune stale references when their source file is closed or deleted. Addresses one specific subcase but does not solve selective removal in general.
- Status quo + documentation: explicitly document Reload Window as the supported workaround. Lowest cost, but does not address the underlying UX gap.
Priority
High - Significant impact on productivity
Feature Category
File operations
Use Case Example
While debugging a regression that spans multiple modules, I open six files and use Ctrl+U to attach nine separate code ranges — three from the request handler, three from the cache layer, three from the database adapter.
After thinking through the symptoms, I realize the cache-layer code is irrelevant and want to drop just those three pills before sending my prompt to Claude.
With today's UI, my only option is Reload Window, which deletes all nine pills. I then have to navigate back to four open files, re-locate the six remaining ranges, and re-select them with Ctrl+U — roughly two minutes of pure
redo work for what should be three clicks. Over a multi-hour debugging session this friction repeats many times and meaningfully degrades the otherwise excellent attach-context workflow.
Expected experience: hover any of the three cache-layer chips → click X → done. Total time: under five seconds.
Additional Context
Related to #20886
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗