Skip to content

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

Description

@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.

  2. Layout-dependent behavior (Shift+drag file to chat not working in VS Code UI (works in CLI) #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.

  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:idebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions