Dragging a file from Finder into the terminal silently strips `&` from the path

Status Open
Reported on v2.1.228
Maintainer reply None cached
Activity 0 comments · opened Aug 15, 2026

Summary

Dragging a file whose name contains & from Finder into the Claude Code prompt inserts a path with
the & character removed. The spaces around it are preserved, so Block & Crown.csv becomes
Block Crown.csv (two consecutive spaces). The result looks like a plausible path, so the error is
easy to miss.

Environment

  • Claude Code 2.1.228
  • macOS 13.7.8 (22H730), Intel
  • VS Code integrated terminal 1.133.0 (TERM_PROGRAM=vscode)

Steps to reproduce

  1. Create a file with & in the name, e.g. ~/Downloads/Block & Crown.csv
  2. In Claude Code, start typing a message referring to the file
  3. Drag that file from Finder into the terminal window
  4. Look at the inserted path

Expected

The path is inserted intact, escaped or quoted as needed — e.g. /Users/me/Downloads/Block\ \&\ Crown.csv
or '/Users/me/Downloads/Block & Crown.csv'.

Actual

The & is dropped and the surrounding spaces kept:

/Users/me/Downloads/Block  Crown.csv

Observed twice in one session with two different files (.csv and a .modusdb), both in
directories whose names also survived intact. Only & was affected; spaces were preserved.

Impact

The corrupted path still looks right, so it gets used. Tools that fail silently on a missing file
then produce confidently wrong results rather than an error. In my case sqlite3 was handed the
mangled path and, per its normal behaviour, created a new empty database instead of failing —
queries returned "no such table", and a stray empty file was left in the user's folder. It took a
directory listing to notice the real filename differed.

Music libraries make this quite likely to bite: & is extremely common in artist names
("Block & Crown", "Sly & The Family Stone").

Note on which layer is responsible

I could not determine whether the stripping happens in VS Code's integrated-terminal drop handling
or in Claude Code's own input handling. A quick way to isolate it:

  1. Drop the same file at a plain shell prompt in the same VS Code terminal (exit Claude Code

first). If the & is still lost, it is VS Code's drop handling, not Claude Code.

  1. Drop the same file into Claude Code running in Terminal.app or iTerm2. If the &

survives there, it is specific to the VS Code path.

Happy to run those and report back if useful.

View original on GitHub ↗