Add webview/context menu to the chat panel ("Ask Claude about this selection")

Status Open
Reported on v2.1.251
Maintainer reply None cached
Activity 1 comment · opened Aug 31, 2026

Problem

Text selected inside the Claude chat panel has no path back into the prompt box. Right-clicking it shows only the built-in Cut / Copy / Paste menu.

This comes up constantly: Claude explains something, one line in that explanation needs a follow-up, and the only way to ask about it is Ctrl+C → click the input → Ctrl+V. In an editor this is solved (Alt+K inserts an @file#L10-20 reference), but the answer panel itself has nothing.

Why extensions can't fix this

VS Code supports custom context menus inside webviews via the webview/context contribution point plus data-vscode-context attributes. Other extensions already use it — GitLens and the MSSQL extension both ship webview/context menus.

But that contribution point only applies to the owning extension's webview. A third-party extension cannot add items to claudeVSCodePanel, cannot read the selection inside it, and cannot write into the prompt box. So this can only be fixed by the Claude Code extension itself.

Checked against anthropic.claude-code 2.1.251 (win32-x64) on VS Code 1.135.0:

  • contributes.menus contains only editor/title and commandPalette
  • no webview/context entry
  • data-vscode-context does not appear anywhere in the extension

Proposed behaviour

Right-click on a selection inside the chat panel → "Ask about this" → the selected text is quoted into the prompt box, cursor placed after it, ready for a follow-up question. Same shape as the existing Alt+K flow, but for the answer itself.

A keyboard shortcut for the same action would help too — one that works while the webview has focus. The current Ctrl+Esc binding is gated on editorTextFocus, which is false inside the panel, so it triggers claude-vscode.blur rather than .focus there.

Current workaround

An AutoHotkey script: hotkey → Ctrl+C → send F13 (bound with no when clause to claude-vscode.focus, since editorTextFocus is false in the webview) → Ctrl+V. It works, but it is OS-level key synthesis standing in for a two-line manifest entry.

Environment

  • VS Code 1.135.0, Windows 11
  • anthropic.claude-code 2.1.251 (win32-x64)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗