[BUG] Drag and drop not working in VS Code extension chat panel (works in terminal CLI)

Open 💬 28 comments Opened Feb 12, 2026 by emregurhan

Bug Description

Drag and drop functionality is fully operational in the terminal/CLI mode but completely non-functional in the VS Code extension chat panel. This is a regression introduced around v2.1.6 and remains unresolved as of v2.1.39 (latest tested).

This issue consolidates multiple fragmented reports into a single tracking issue, as the root cause appears to be the same across all of them.

Environment

  • Claude Code: v2.1.39
  • VS Code: 1.109.2 (Universal)
  • Commit: 591199df409fbf59b4b52d5ad4ee0470152a9b31
  • Date: 2026-02-10
  • Electron: 39.3.0 / Chromium: 142.0.7444.265 / Node.js: 22.21.1
  • OS: macOS (Darwin arm64 25.3.0)
  • Scope: Affects sidebar view, partially affects tab view

Steps to Reproduce

  1. Open Claude Code in VS Code extension (sidebar or tab view)
  2. Drag a file from Finder / VS Code file explorer / desktop into the chat input area
  3. Observe: the drop event is silently ignored — no file attachment, no path insertion, no visual feedback

Expected Behavior

Files dragged into the chat panel should be attached as context, consistent with the terminal CLI behavior where file paths are inserted into the prompt on drop.

Actual Behavior

The drop action is completely ignored. No error, no visual feedback, no file reference added.

Root Cause Analysis

Based on investigation across related issues, the likely root cause is:

  1. Missing or broken drop event handlers in the VS Code webview: The extension's chat panel runs inside a VS Code webview. Webviews require explicit drop/dragover event listeners and event.preventDefault() on dragover to enable drop. If these were removed or broken during the v2.1.6 refactor, drops would be silently ignored — which is exactly the observed behavior.
  1. Layout-dependent behavior (#18037): Drop works in tab view but not sidebar view, suggesting the webview's drop zone dimensions or event propagation differ between layouts. This points to a CSS/DOM issue where the drop target element doesn't cover the full input area in sidebar mode.
  1. VS Code API limitation: VS Code's WebviewView (sidebar) has different capabilities than WebviewPanel (tab). The sidebar webview may have additional restrictions on drag events that need explicit handling via vscode.DataTransfer.

Impact

This is a high-impact workflow regression affecting daily productivity:

  • Users must fall back to manual @ mentions or /add commands
  • Breaks muscle memory and slows down file-heavy workflows
  • Multiple users in related issues report considering alternatives to Claude Code

Related Issues (Consolidation)

This issue consolidates the following fragmented reports — all appear to share the same root cause:

| Issue | Description | Reactions |
|-------|-------------|-----------|
| #18037 | Shift+drag file to chat not working in VS Code UI (works in CLI) | 7 👍 |
| #17906 | Drag-and-drop from file explorer not working in Cursor (regression since v2.1.6) | 8 👍 |
| #21044 | Drag & drop attachment does nothing in Remote-SSH (Windows → Debian) | Open |
| #17897 | Cowork sidebar: items appear draggable but drop into Chat does nothing | Open |
| #16221 | Drag and drop file/image affects all Claude Code tabs in window | Open |
| #17703 | Add drag and drop file upload to Document Upload dialog | Open |
| #16532 | /add-dir doesn't handle backslash-escaped spaces from terminal drag-and-drop | Open |
| #21863 | Drag and drop file path insertion broken in v2.1.25 (Kitty terminal) | Open |

Workarounds

  • Tab view: Open extension as a tab instead of sidebar (partial fix per #18037)
  • @ mentions: Use @filename to reference files in chat
  • /add command: Use /add <path> to manually add files to context
  • Downgrade: Roll back to v2.1.5 where drag & drop reportedly worked

View original on GitHub ↗

28 Comments

solarpunked · 4 months ago

Adding a +1 in the hope this gets fixed asap

deiansp · 4 months ago

Absolutely needed. +1

igoralentyev · 4 months ago

I dont want to pay 200$ for DX like this. Cursor has this from day 0, why you just cant vibe code this as all other CC parts?

egemenkarabyk · 3 months ago

Any update on this issue?

mopi1402 · 3 months ago

+1.

wistful-wolf · 3 months ago

+1 it is strange not having such basic feature this late into the game

Metisse · 3 months ago

+1
Other solution : i use Claude in IDE "BLACKBOX AI" it's working with this

umutbozdag · 3 months ago

any update?

Toucouleur66 · 3 months ago

Why the hell this bug even happened!

BringerOD · 2 months ago

+1 please fix

Hulkster1004-1004 · 2 months ago

+1 — repro on macOS, drag-drop in the sidebar is unreliable: sometimes no overlay appears, sometimes the overlay appears but drop does nothing.

Specific use case: working with Office files (.xlsx/.docx/.pptx) referenced in chat via a custom MCP extractor. Path-typing workaround works, but sidebar drag-drop is the natural UX.

Note: Anthropic's recently-released Claude for Excel / Word / PowerPoint add-ins are a separate product and do not address this — they put Claude inside Office apps rather than letting Office files into Claude Code.

ramiloif · 2 months ago

Totally this is the most frustrating part of moving from cursor, really miss that

khaivngo · 2 months ago

Please fix

vishnyo · 1 month ago

Drag the file, press SHIFT before drop - works.

Toucouleur66 · 1 month ago
Drag the file, press SHIFT before drop - works.

Nope

vishnyo · 1 month ago
> Drag the file, press SHIFT before drop - works. Nope

Watch

https://github.com/user-attachments/assets/960e8272-0ec7-44bd-9f4b-492b5d28f585

and-fed · 1 month ago

@vishnyo what VS Code version and OS is it?

vishnyo · 1 month ago
@vishnyo what VS Code version and OS is it?

<img width="1716" height="1012" alt="Image" src="https://github.com/user-attachments/assets/479d33fa-bc11-4014-8c5e-a3771a5d425c" />

<img width="354" height="482" alt="Image" src="https://github.com/user-attachments/assets/2d2a8171-d910-4f30-a9dd-8c7066a94ee1" />

<img width="724" height="1148" alt="Image" src="https://github.com/user-attachments/assets/9be10696-6d57-48e0-86cc-eccf4b8b4b09" />

david-pw · 1 month ago
> @vishnyo what VS Code version and OS is it?

Must only work on MacOS. Because it's 100% not working in Windows / WSL 2. I can see the chat interface reacting to the SHIFT + DRAG UX, but on drop no files are added to the chat interface. RIP.

Version: 1.123.0 (user setup)
Commit: 6a44c352bd24569c417e530095901b649960f9f8
Date: 2026-06-03T11:29:03+02:00
Electron: 42.2.0
ElectronBuildId: 14159160
Chromium: 148.0.7778.97
Node.js: 24.15.0
V8: 14.8.178.14-electron.0
OS: Windows_NT x64 10.0.26200
Identifier
anthropic.claude-code
Version
2.1.168
Last Updated
21 hours ago
11bluetree · 28 days ago

I confirmed that on Mac, file paths can be pasted by drag & drop.
It works from both the sidebar and the tabs.
There is a trick to it:

  1. Drag the file
  2. Move it over the paste area
  3. Once over the area, press and hold Shift
  4. Drop it
- Mac
Apple M4 Pro
Tahoe 26.5.1

- Claude Code for VS Code
2.1.181

https://github.com/user-attachments/assets/49765c68-6d32-40be-a13c-e4564a36443e

Lawrence-Godfrey · 15 days ago

I've found that the drag-and-drop feature specifically doesn't work when using the Remote SSH extension, and working with a codebase which is on the remote machine.
So if I am using a codebase which is on the remote machine, drag-and-drop doesn't work. I have to manually @ to add context.
If I'm using a codebase which is local, drag-and-drop works perfectly.

Identifier
ms-vscode-remote.remote-ssh
Version
0.124.0
Identifier
anthropic.claude-code
Version
2.1.197
Version: 1.126.0
Commit: 7e7950df89d055b5a378379db9ee14290772148a
Date: 2026-06-23T01:46:13Z
Electron: 42.2.0
ElectronBuildId: 14159160
Chromium: 148.0.7778.97
Node.js: 24.15.0
V8: 14.8.178.14-electron.0
OS: Darwin arm64 25.5.0
MacBook Air
15-inch, M4, 2025
16GB
Lawrence-Godfrey · 13 days ago

I think I've found the root cause in the extension bundle and verified a fix locally.

Root cause

In the webview bundle (webview/index.js, v2.1.199), dropped files arrive via the drag's
dataTransfer as URI strings under the resourceurls and codeeditors types. Both branches
funnel each URI through the same converter function (minified as uQe):

async function uQe(e, t) {
  if (!e.trim()) return null;
  let i = e.trim();
  if (!i.startsWith("file://")) return null;   // ← the bug
  i = decodeURIComponent(i.substring(7));
  if (t && i.startsWith(t)) {
    i = i.slice(t.length);
    if (i.startsWith("/")) i = i.slice(1);
  }
  return i;
}

It only accepts file:// URIs and silently returns null for anything else. In a Remote SSH
window, resources dragged from the VS Code explorer carry vscode-remote://ssh-remote+<host>/path
URIs, not file:// URIs — so every drop is discarded with no error and no visual feedback,
which matches the reported behavior exactly. Local workspaces produce file:// URIs, which is
why drag-and-drop works there.

This likely explains at least #21044 (Remote-SSH) among the issues consolidated here.
Note that @ mentions are unaffected because they resolve through the extension host (running
on the remote), which reads files via the VS Code API directly — the drop path is the only place
where resource URIs cross into the webview as strings.

Verified fix

I patched the installed bundle on my remote machine
(~/.vscode-server/extensions/anthropic.claude-code-2.1.199-linux-x64/webview/index.js) to strip
the vscode-remote://<authority> prefix and fall through to the existing file:// logic:

async function uQe(e, t) {
  if (!e.trim()) return null;
  let i = e.trim();
  if (i.startsWith("vscode-remote://")) {
    let rp = i.indexOf("/", "vscode-remote://".length);
    if (rp === -1) return null;
    i = "file://" + i.substring(rp);           // strip scheme + authority
  }
  if (!i.startsWith("file://")) return null;
  // ... rest unchanged
}

After Developer: Reload Window, drag-and-drop from the explorer into the chat works over
Remote SSH — the dropped file is added as context, same as in a local workspace. The existing
workspace-root relativization and URL-decoding continue to apply since the converted URI reuses
the original code path. In the real source this is probably better expressed by parsing with
vscode.Uri and accepting the vscode-remote scheme rather than string-prefix matching.

Environment: Claude Code extension 2.1.199 (linux-x64 remote), Remote-SSH 0.124.0,
VS Code 1.126.0 on macOS (arm64) → Ubuntu remote.

shawnli1024 · 6 days ago

I developed a vscode extension plugin [Drag File to Claude Code Session], which is currently available for testing.
Installation Method 1: Install from VS Code Marketplace. Press Ctrl+Shift+X to open the extension panel, search for "Drag File to Claude Code Session", and click Install.

wwoland · 3 days ago

**Another root cause, affecting local (non-remote) drops: the handler reads dataTransfer path data after an await, when the drag data store is already cleared**

This is independent of the Remote-SSH vscode-remote:// scheme issue reported above — both discard drops silently.

In webview/index.js, the chat drop handler processes attachments first and only then reads the path data used for @path mention insertion (minified names from 2.1.185; 2.1.207 from the marketplace is structurally identical):

async function Me($) {
  // ...guards...
  let De = $.dataTransfer?.files;
  if (De && De.length > 0) {
    let {attachments: At, unsupportedFiles: Ri} = await bR(De);  // ← await: reads file contents as data URLs
    if (At.length > 0) p((so) => [...so, ...At]);
    J(Ri);                                                       // "Unsupported file type" toast
  }
  let gt = $.dataTransfer?.items;                                // ← read AFTER the await
  if (!gt) return;
  await OTt(gt, e.cwd.value, (At) => { a.current?.insertAtMention(`@${At}`, !1) });
}

Per the HTML drag-and-drop spec, the drag data store is only readable synchronously during drop event dispatch. Once the handler yields at await bR(De), dataTransfer.items is empty and getData() returns "". So whenever a drag carries file content (.files non-empty), the @path insertion branch (OTt, which reads the resourceurls/codeeditors string items) is guaranteed to run against an empty item list and silently does nothing.

Observable symptoms this explains:

  • Drop a non-attachable file (e.g. .zip): "Unsupported file type" toast, and no @path is ever inserted even though the drag carried the path.
  • Drop a supported file: it attaches as content, but the path-mention branch still silently no-ops.
  • Drags where .files is empty (plain DOM drags on some platforms) skip the await, reach items synchronously, and work — which is why behavior looks inconsistent across platforms/drag sources in this thread.

Fix: snapshot the string data synchronously at the top of the handler — e.g. const ru = $.dataTransfer.getData("resourceurls"), ce = $.dataTransfer.getData("codeeditors") (or getAsString callbacks registered before any await) — then process attachments.

Verified fix: I patched my installed bundle to snapshot resourceurls/codeeditors via getData() before the await and insert the mentions from the snapshot; after Reload Window, Shift+drag from the Explorer sidebar now inserts @path correctly, including for .zip files that previously only produced the error toast.

Environment: anthropic.claude-code 2.1.185 (running in Cursor, macOS arm64); same handler code confirmed present in the 2.1.207 VSIX from the marketplace.

rajdbs32 · 12 hours ago

In my windows i have noticed drag drop fails when connected to a remote ssh, but not when i use it locally.
EVEN THE DRAG DROP EXTENSION BY @shawnli1024 dosent seem to work in remote sshs

shawnli1024 · 11 hours ago
In my windows i have noticed drag drop fails when connected to a remote ssh, but not when i use it locally. EVEN THE DRAG DROP EXTENSION BY @shawnli1024 dosent seem to work in remote sshs

Could you check the Output panel in VS Code? Open it with Ctrl+Shift+U, then select "Drag File to Claude Code" from the dropdown at the top-right. Look for a line like [DragCC] Starting ... with python. — this tells us which helper script is being used. If you see [DragCC] Unsupported environment or No X11 DISPLAY is available, it means the extension is running on the remote Linux side instead of your local Windows machine.

rajdbs32 · 10 hours ago
> In my windows i have noticed drag drop fails when connected to a remote ssh, but not when i use it locally. EVEN THE DRAG DROP EXTENSION BY @shawnli1024 dosent seem to work in remote sshs Could you check the Output panel in VS Code? Open it with Ctrl+Shift+U, then select "Drag File to Claude Code" from the dropdown at the top-right. Look for a line like [DragCC] Starting ... with python. — this tells us which helper script is being used. If you see [DragCC] Unsupported environment or No X11 DISPLAY is available, it means the extension is running on the remote Linux side instead of your local Windows machine.

<img width="855" height="138" alt="Image" src="https://github.com/user-attachments/assets/d0efe3df-f954-42ea-bf9b-82dfcd1b3863" />

shawnli1024 · 10 hours ago
> > In my windows i have noticed drag drop fails when connected to a remote ssh, but not when i use it locally. EVEN THE DRAG DROP EXTENSION BY @shawnli1024 dosent seem to work in remote sshs > > > Could you check the Output panel in VS Code? Open it with Ctrl+Shift+U, then select "Drag File to Claude Code" from the dropdown at the top-right. Look for a line like [DragCC] Starting ... with python. — this tells us which helper script is being used. If you see [DragCC] Unsupported environment or No X11 DISPLAY is available, it means the extension is running on the remote Linux side instead of your local Windows machine. <img alt="Image" width="855" height="138" src="https://private-user-images.githubusercontent.com/52234042/622595297-d0efe3df-f954-42ea-bf9b-82dfcd1b3863.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODQxOTUxOTcsIm5iZiI6MTc4NDE5NDg5NywicGF0aCI6Ii81MjIzNDA0Mi82MjI1OTUyOTctZDBlZmUzZGYtZjk1NC00MmVhLWJmOWItODJkZmNkMWIzODYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNzE2VDA5NDEzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRlNjM5YWVkZDdjMWIxNWUxNmVhMzEzNjNjMGQ5OGQxNjkzNmMxMDI1YjdkM2IzY2E4ZTZlNzI2NDZhMTlhOTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.r2NyRv73ttDc1IETdPXN2OMs2_yM8-FVs7ESxPUQPn0">

I can't get the reason by the message of image. Then there 2 ways , 1-you can fix this bug by yourself and the repo is https://github.com/shawnli1024/drag_file_to_claude_code_session; 2-Just wait, I need to set up the environment and reproduce this bug. Angway, I hope you can chosse 1 and contribute your strength for this tool.