Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Chat Selection CommentNew to Visual Studio Code? Get it now.
Chat Selection Comment

Chat Selection Comment

duonganh

|
3 installs
| (2) | Free
Select text in a chat response, add an optional comment and images, and attach it to the chat input as a chip.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Chat Selection Comment

Select text in a chat response, add an optional comment and images, and attach it to the chat input as a chip, similar to "Add Selection to Chat".

Usage

  1. Select text inside a chat response. A Comment button appears.
  2. Click Comment to open the "Add an optional comment..." box.
  3. Type a comment. Add images by pasting (Ctrl+V) or with the paperclip button, which accepts several images.
  4. Press Enter or click the arrow button. Shift+Enter adds a new line, Esc or a click outside closes the box.

The selection and your comment go into one chip named Selected response <time>. Images become separate image chips, and the comment chip lists their names so the model can tell which images belong to which comment.

Setup

  1. Install the .vsix.
  2. Run Chat Selection Comment: Enable from the Command Palette, then reload the window.
  3. To remove it, run Chat Selection Comment: Disable and reload.

How it works

VS Code has no extension API for adding buttons to chat responses. This extension copies a script next to workbench.html in the VS Code install folder and adds a <script> tag. A backup is saved as workbench.html.before-chat-actions.bak.

Limitations

  • VS Code may show an "installation appears to be corrupt" warning.
  • A VS Code update restores workbench.html and removes the script. The extension offers to enable it again on the next start.
  • The install folder must be writable. A per-user install under AppData works; a system-wide install may need elevated rights.
  • Image chips depend on the chat's built-in paste handling, which needs an extension that provides chatReferenceBinaryData. Without it, images may not become chips.
  • The script relies on internal class names of the chat UI, which can change between VS Code versions.
  • Only images are supported. Other file types are not.
  • The setting chat.pasteAsAttachmentThreshold affects every paste into the chat input. A low value turns ordinary pastes into chips.
  • Not tested in Remote or WSL windows.

Manual restore

Close VS Code, then copy workbench.html.before-chat-actions.bak over workbench.html in the same folder and delete chat-selection-actions.js.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft