[FEATURE] VSCode: Support adding multiple code selections to chat context incrementally via shortcut

Open 💬 7 comments Opened Mar 11, 2026 by Sherlockedb

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

Currently in the Claude Code VSCode extension, when you select code and use the shortcut to add it to chat, only one selection can be referenced at a time. There is no way to accumulate multiple code ranges from different files into the chat context.

This makes it difficult to ask Claude about interactions between code spread across multiple files or locations, as you can't reference f1.ts:100-200 and f2.ts:200-300 simultaneously without manually typing the references.

Proposed Solution

Add a "Add selection to chat" shortcut (similar to Cursor's behavior) that appends the current code selection to the chat context rather than replacing it.

Workflow:

  1. Select code in file A → press shortcut → selection appended to chat (e.g. f1.ts:100-200)
  2. Navigate to file B → select another range → press shortcut → appended alongside first (f1.ts:100-200 f2.ts:200-300)
  3. Type your question and send

The accumulated selections should be clearly visible in the chat input, and each one should be individually removable.

Alternative Solutions

  • Manually typing file paths and line ranges — tedious and error-prone
  • Adding entire files as context — adds too much noise, especially for large files

Priority

High - Significant impact on productivity

Feature Category

Interactive mode (TUI)

Use Case Example

  1. I'm debugging a bug that spans a utility function in utils.ts and its caller in service.ts
  2. I select the utility function (utils.ts:45-80) and press the shortcut to add it to chat
  3. I navigate to service.ts, select the relevant caller code (service.ts:120-145), and press the shortcut again
  4. Both selections appear in the chat input as context
  5. I type "Why does this cause a null reference error?" and send
  6. Claude can see both code segments and give an accurate answer

Additional Context

Cursor IDE supports this workflow natively and it significantly improves the experience when working across multiple files. The feature would make Claude Code's VSCode integration much more competitive for multi-file analysis tasks.

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗