[FEATURE] Dragging a file into the prompt should insert an @ reference, not a bare path
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Dragging a file onto the prompt pastes its path as plain text, wrapped in single
quotes. @path is the syntax that loads a file into the conversation. So the
fastest way to name a file produces the one form that does not load it, and
Claude spends a turn calling Read on something the @ machinery does for free.
It matters most where there is no other route. The @ suggestion list filters
by .gitignore and expansion does not, so a git-ignored file loads fine if you
type its whole path. Dragging is the only convenient way to name that file, and
dragging is the one route that does not load it.
Two closed issues are worth reading together:
- #77204: the drop
handler already branches by file type, since a dropped image becomes inline
vision content while every other file becomes a raw path. Converting a drop
into a usable reference is not a new capability.
- #73853: the VS Code
drop inserts an absolute path, which that report calls inconsistent with the
@ flow that resolves the same file to a workspace-relative path.
Both were closed by the inactivity bot rather than on their merits.
Proposed Solution
A dropped file inserts @ followed by the path, instead of the path alone.
- The path takes the form the
@flow already produces: workspace-relative
inside the project, absolute outside it. That resolves #73853 too.
- A modifier held during the drop inserts the bare path, for renaming,
moving or passing the file to a shell command. #77204 asked for the same
escape hatch from the image side.
- Images are unchanged, and several files dropped at once each get their own
reference.
Alternative Solutions
Type the path, or type @ and pick from the suggestion list. Slow enough
that dragging is the only reason the file gets named at all, and the list never
offers a git-ignored file.
A UserPromptSubmit hook. It cannot insert the @: a hook can add context
beside the prompt or reject it, never change it. Filed separately.
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- I drag the file I am working on from my editor onto the terminal. The input
line reads fix the null check in '/home/me/app/src/auth/session.ts'.
- I press Enter. There is no
@, so nothing about the file is loaded. - Claude calls Read and answers on the next turn. The first turn produced a
file read I could have had for free.
- With this change the line reads
fix the null check in @src/auth/session.ts,
expansion loads the file, and the first turn is the answer.
Additional Context
Claude Code 2.1.278, Linux, WSL2.
Filed alongside: dragging a folder inserts nothing at all.