anthropics / anthropics/claude-code

[FEATURE] VS Code: restore the include/exclude toggle on the selection chip (removed in 2.1.269)

Open
#94,347 0 comments 0 reactions 0 assignees View on GitHub
area:ide enhancement platform:vscode
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

### Preflight Checklist

- [x] I have searched [existing requests](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20label%3Aenhancement) and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)

### Problem Statement

Image

In the VS Code extension, the prompt box shows a chip for the current editor selection or open file ("2 lines selected", or the file name). Earlier versions had an eye-slash toggle on that chip: one click excluded the selection from the next message, another click included it again, without touching the editor.

In 2.1.269 the toggle is gone. The chip now has only an "x" ("Remove from message"). Clicking it discards the selection, and the only way to get it back is to re-select text in the editor or switch files and back. The dismissal is also sticky for that exact selection, so re-selecting the same lines does nothing.

This turns a cheap, reversible choice ("don't send this one this time") into a destructive one. When I'm asking a general question mid-task I want to exclude the selection for one message and have it come straight back for the next, which is exactly what the old toggle did.

The docs still describe the eye-slash toggle (VS Code extension page, "selection indicator"), and the change isn't in the changelog, so it looks unintentional or at least undocumented.

### Proposed Solution

Bring back a visibility toggle on the selection chip, alongside or instead of the "x":

- Clicking the eye / eye-slash icon flips whether the selection is attached to the next message. The chip stays visible in both states, dimmed or struck through when excluded, so I can see what will and won't be sent.
- The toggle persists until I toggle it back; the chip remains without re-selecting in the editor.
- Keep the "x" if you like as a hard "forget this selection", but it shouldn't be the only control.

Optionally, a setting such as claudeCode.autoAttachSelection to control whether the active selection/file is attached by default.

### Alternative Solutions

- Re-selecting the text in the editor. Doesn't work for the same range, because the dismissed selection is remembered and the identical selection stays dismissed.
- Switching to another editor tab and back. Works but is disruptive and loses the exact range.
- Clearing the editor selection so nothing is attached, then re-selecting later. Loses the range.
- Leaving the selection attached and telling Claude to ignore it. Wastes context and Claude sometimes still acts on it.

### Priority

Medium - Would be very helpful

### Feature Category

Interactive mode (TUI)

### Use Case Example

1. I have a 15-line SQL migration block selected because I'm iterating on it with Claude.
2. I want to ask an unrelated question without the selection being attached (esp. when I don't want to include the whole file's worth of context).
3. Old behaviour: click eye-slash, send, click again, continue with the selection.
4. New behaviour: click x, send, then go back to the editor and re-select the lines. Re-selecting the same range doesn't re-attach because the dismissal is sticky, so I have to select a different range first or switch files and back.

### Additional Context

Extension version: anthropic.claude-code 2.1.269 (darwin-arm64). CLI 2.1.220.

From the shipped webview bundle: the chip component renders a static label with tooltip "Showing Claude your current file selection (...)" plus a close button labelled "Remove from message". Dismissing stores the selection as dismissedSelection; applySelectionUpdate ignores subsequent updates that are equal to the dismissed one, or that are a no-text "file opened" event for the same file. There is no include/exclude state anymore and no contributed setting for auto-attach.

Docs still describing the toggle: the VS Code extension page's note on hiding the selection indicator with the eye-slash icon.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the VS Code extension's webview bundle and the selection chip component described in the issue; trace dismissedSelection and applySelectionUpdate to understand the current dismissal behavior. Done means the chip can visibly toggle inclusion without losing the selection, the x can still remove it if retained, and the VS Code extension documentation matches the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
developer-experience, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.