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
- Open a workspace and focus the Claude Code tab.
- Drag any file from Finder onto the Claude Code view.
- 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
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
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 occurrencesgetAsFile: 0 occurrenceswebkitGetAsEntry: 0 occurrencesThe only
dragover/dragenter/dragleave/dropstrings 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
dragoverhandler that callspreventDefault()plus adrophandler that readsdataTransfer.filesand 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