Skip to content

[Bug] Dragging a file onto the Claude Code tab opens it as an editor tab instead of attaching it to the session #8

Description

@tbarsness

Problem to solve

Dragging a file onto the Claude Code tab does not attach it to the Claude session. Instead, VS Code's editor drop handler intercepts the drop and opens the file as a new editor tab in the same editor group, next to the Claude Code tab. Claude never becomes aware of the file.

For images this is doubly confusing, because the opened tab often fails to render ("An error occurred while loading the image"), so it looks like the drop failed entirely rather than having been misrouted.

Steps to reproduce

  1. Open a workspace and focus the Claude Code tab.
  2. Drag any file from Finder onto the Claude Code view.
  3. Observe: a new editor tab opens for that file. Nothing is added to the Claude session.

Expected

The dropped file's path is inserted into the Claude Code prompt (or the file is attached to the session), the way it works in Claude Code running in a plain terminal.

Notes on cause

The Claude Code view is a webview served from Contents/Resources/ide-views/terminal/. Grepping the shipped bundle (main.a38e6cdb08224913.js) for file-drop APIs returns nothing:

  • onDrop / ondrop: 0 occurrences
  • getAsFile: 0 occurrences
  • webkitGetAsEntry: 0 occurrences

The only dragover / dragenter / dragleave / drop strings in the bundle belong to React's synthetic event registry, not to any application handler. So the webview registers no drop target, the drag falls through to the surrounding VS Code editor group, and the workbench's default "open dropped file" behavior wins.

A dragover handler that calls preventDefault() plus a drop handler that reads dataTransfer.files and writes the resulting path(s) into the terminal input should be enough to claim the drop before the workbench sees it.

Workarounds that do not work

Holding Option while dragging (the usual macOS "paste path instead of file" modifier) does not help. The editor drop handler still wins.

The only working workaround is typing or pasting the absolute path into the prompt by hand.

Related

This is the drag-and-drop sibling of #6 (copy-paste image support). Same underlying gap: the terminal webview has no path for ingesting a file from the host, whether by paste or by drop. Fixing them together would likely share most of the work.

Environment

  • DevSwarm 2.4.0 (com.twentyfirstidea.devswarm)
  • macOS, Darwin 25.5.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions