Option to paste an image file path as literal text (don't auto-attach)
Feature request: option to paste an image file PATH as literal text (don't auto-attach)
Summary
When you paste a file path that points to an image (e.g. /tmp/cover-opts/cover-repeat.png) into
the prompt input, Claude Code auto-detects it and attaches the image ([Image #N]) instead of
inserting the literal path text. There is currently no way to override this — no setting, no
env var, and no modifier/alternate paste. Please add a way to paste the raw path text.
Why you'd want the literal path
- Referencing the file by path in a request ("what does
/tmp/x.pngweigh / when was it
generated / compare it to /tmp/y.png") without pushing the pixels into context.
- Building a shell command or a message that just needs the path string.
- Saving context/tokens when the image content isn't needed — only its location.
Requested behavior (any one of these)
- A setting — e.g.
imagePathAutoAttach: false(or a per-session toggle) so pasted image
paths insert as text.
- A modifier / alternate paste — e.g. a
chat:pasteAsTextaction (Shift+paste or a bindable
key) that inserts the clipboard as literal text, bypassing image-path detection.
- A prompt on paste — "Attach image or insert path?" when a pasted string is an image path.
Option 2 (a paste-as-text keybinding) is the most general and matches how many editors let you
paste-without-formatting.
Notes
- Behavior is specific to image file extensions; non-image paths already paste as text.
- Confirmed there is no existing setting/keybinding for this in the current Claude Code docs
(settings, CLI reference, keybindings); the only image action is chat:imagePaste for clipboard
images.
- This is separate from (but related to) the request to emit OSC 8 hyperlinks for file paths — both
are about treating displayed/handled file paths as first-class text/links.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗