image paste in ssh/sftop

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 25 comments · opened Aug 6, 2025 · closed Aug 16, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

hi folks,

im on mac. i run my code on a remote server and connect to it using ssh. i also develop on this remote server since my code needs lot of cpus to compile. i use claude code cli to help development on this remote server.

i want to paste images so that claude code cli can understand the context. remember claude code cli is still running remotely on a remote linux server and im connecting using ssh.

what workaround does exist to paste image right into the claude code cli terminal in vscode/webstorm?

thank you in advance

View original on GitHub ↗

25 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/2500
  2. https://github.com/anthropics/claude-code/issues/1361
  3. https://github.com/anthropics/claude-code/issues/1989

If your issue is a duplicate, please close it and 👍 the existing issue instead.

<sub>This issue will be automatically closed as a duplicate in 3 days if there are no additional comments. To prevent auto-closure, please 👎 this comment.</sub>

🤖 Generated with Claude Code

SergioKingOne · 10 months ago

any updates on this? please provide a way to support this

johnMocingbird · 10 months ago

I would love this...

gurucodersro · 9 months ago

I NEED THIS!

ejc3 · 9 months ago

One silly work around if you use VS Code on a remote server is to paste the image into a markdown file in your home directory. That will add the image there too on the remote server and then you can command click to get the image displayed in VSCode and then get the path and paste that into claude.

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

sandipndev · 7 months ago

I really would love to have this feature

Ridhamz-nd · 7 months ago

Bump!

ShunmeiCho · 7 months ago

I built an open-source tool to solve this: cc-clip

It creates a transparent bridge between your local Mac clipboard and the remote server via SSH tunnel. An xclip shim intercepts only Claude Code's clipboard calls and fetches image data from a local daemon — no changes to Claude Code needed.

Local Mac clipboard → pngpaste → HTTP daemon → SSH RemoteForward → xclip shim → Claude Code

Setup is two commands:

cc-clip serve          # local: start clipboard daemon
cc-clip connect host   # deploy shim + tunnel to remote

After that, Ctrl+V in remote Claude Code pastes images from your Mac as if it were local.

ShunmeiCho · 7 months ago

I built a tool that solves this: cc-clip

It creates a transparent bridge between your local Mac clipboard and the remote server using an HTTP daemon + SSH RemoteForward + an xclip shim. No changes to Claude Code needed.

cc-clip setup myserver

One command handles everything (deps, SSH config, daemon, remote deploy). After that, Ctrl+V in remote Claude Code pastes images from your local Mac.

Works on macOS → Linux (amd64/arm64). MIT licensed — feedback and bug reports welcome.

Sanjeev2487 · 7 months ago

Still seeing this issue happening over a ssh'd terminal.
i ssh from my local windows to remote linux machine.

kasai2210 · 6 months ago

@ShunmeiCho this is an amazing tool, thanks for creating it!

hqhq1025 · 6 months ago

clipaste now supports SSH remote paste (v2.1.0).

It runs an HTTP server locally that serves your latest screenshot. One-time setup:

# Install locally
brew install hqhq1025/clipaste/clipaste
brew services start clipaste

# Configure remote server
clipaste ssh-setup user@your-server

This installs an xclip shim on the remote server and configures SSH RemoteForward. After setup, Ctrl+V in remote Claude Code fetches the screenshot through the SSH tunnel.

No extra tools needed on the server (just curl). Works with any Linux server.

artnikbrothers · 5 months ago

You can try Cmux terminal (based on Ghostty) - it has this feature by default. But before, I used just a script which uploads the image from clipboard to remote server and copies the path of the image to clipboard, so I just paste it to claude code - i.e. Screenshot -> shortcut (cmd+shift+i) -> uploaded to the server -> path copied to clipboard (@~/uploads/clip-20260429-072938.png) -> paste to claude code. I use Raycast to execute the script

samuellawrentz · 5 months ago
8-unlimit · 4 months ago

I really would love to have this feature

MisterD7793 · 3 months ago

I have this same issue:

Clipboard Paste Issue (Claude Code over SSH)

Setup

  • Local machine: connecting via Prompt (Panic) over Tailscale SSH, also reproduced via iTerm2
  • Remote (DevMac): Claude Code running directly (no tmux)

Symptom

Ctrl+V stopped working for both text and images in Claude Code. Error: "No image found on the clipboard." Started failing around 2026-06-17.

Cmd+V works for text (Prompt handles it locally and injects as raw input).

What we know

  • tmux config has allow-passthrough on — tmux is not obviously the culprit
  • Claude Code fully intercepts Ctrl+V and runs its image-paste routine, which tries to read the clipboard on the remote machine (DevMac), not from the SSH client
  • Cmd+V bypasses Claude Code's interception entirely — Prompt injects it as raw stdin
  • Prompt has an "Allow clipboard writing" setting (was off, turned on) — this is the wrong direction; it lets the remote write to the local clipboard, not vice versa
  • Likely a Claude Code regression — Ctrl+V used to pass through to the terminal

Confirmed (2026-06-17)

Tested without tmux — same failure. Tested with iTerm2 instead of Prompt — same failure. Neither tmux nor the SSH client is the culprit. This is a Claude Code regression: Ctrl+V is intercepted by Claude Code and attempts to read the clipboard on the remote machine (which has none over SSH). Previously Ctrl+V passed through to the terminal.

Workarounds

  • Use Cmd+V for text (works — Prompt injects as raw stdin)
  • Images: no working workaround yet — Cmd+V does not forward image data as raw input
btpence · 2 months ago

Has anyone considered a kitty-clipboard style approach to this? A reasonably simple in-band way to support image paste without external configuration, tunnels, daemons, etc.... Originally posted (and closed) here, this seems to be the most elegant solution for terminals that support the protocol....

https://github.com/anthropics/claude-code/issues/42712

the mechanism is DEC private mode 5522 (kitty's OSC 5522 clipboard protocol plus a paste-notification extension). It's fully in-band and opt-in:

  1. Claude Code queries support with CSI ? 5522 $ p, and if present enables it with CSI ? 5522 h.
  2. When the user pastes, the terminal pushes an unsolicited notification listing the available MIME types (e.g. image/png), each carrying a single-use token — MIME list only, no data yet.
  3. Claude Code requests the type it wants: OSC 5522 ; type=read:mime=<b64 image/png>:pw=<token>, and the terminal streams base64 back.
  4. Claude Code attaches the decoded image exactly as it already does for a pasted file path.

Why this beats the daemon / reverse-tunnel workarounds people are using today:

  • In-band over SSH — the local terminal reads the local clipboard and replies inline; nothing to install, no ssh -R, no background process.
  • User-intent-gated — data moves only on an actual paste keypress; no background clipboard polling, which sidesteps the privacy concern with app-initiated clipboard reads.
  • No PTY race — Claude Code reads the reply on its own fd, in-process; no subprocess competing for the terminal (the failure mode of shelling out to xclip).
  • Opt-in, can't regress — terminals without mode 5522 are unaffected.

I maintain a terminal emulator that already implements the kitty clipboard protocol / OSC 5522, so I'm happy to be a conformance test partner for the terminal side if this gets picked up.

Spec: https://rockorager.dev/misc/bracketed-paste-mime/

kitty clipboard protocol: https://sw.kovidgoyal.net/kitty/clipboard/

SerenityTn · 2 months ago

Author here — for macOS users who prefer not to run a clipboard daemon, reverse tunnel, or remote clipboard shim, I built an open-source workaround that automates the script workflow mentioned above:

https://github.com/SerenityTn/ssh-img-paste

SSH Image Paste reads the image or screenshot from the Mac clipboard, uploads it using the existing OpenSSH configuration, and puts the resulting remote path on the clipboard for pasting into remote Claude Code.

Install with:
brew install SerenityTn/tap/ssh-img-paste

It does not make native Ctrl+V image transport work; native in-band support would still be the best long-term solution. This is a Mac-only practical workaround for avoiding the repeated save → scp → copy-path steps.

bcherny collaborator · 1 month ago

When Claude Code runs on a remote machine over SSH, the image is on your local clipboard and the CLI can't see it, so paste won't work. Two options:

  1. Copy the image to the server (for example with scp) and give Claude the path: "Look at /tmp/screenshot.png". See https://code.claude.com/docs/en/common-workflows#work-with-images
  2. Use Remote Control to drive the remote session from claude.ai/code or the Claude mobile app, where you can attach images directly: https://code.claude.com/docs/en/remote-control

Closing as answered.

🤖 Generated with Claude Code

MisterD7793 · 1 month ago

I am trying to reply with my approach, but I'm getting errors from GitHub
and don't know why. Claude and I came up with an alternative: we wrote a
local shell script that calls my Mac's native screenshot app, records the
shot, scp's it over to my development machine and then loads the path onto
my clipboard so I can paste it in to my SSH session. I wired it up as a
Quick Action in Automator and it works like a charm.

-SD

[image: photo]

Seth Dimbert
Consultant, MRD: Education. Technology.

[image: icon] www.misterd.net [image: icon] @.***

[image: facebook] <https://facebook.com/sethdimbert>

[image: linkedin] <https://www.linkedin.com/in/sethdimbert>

[image: twitter] <https://twitter.com/misterd>

[image: __tpx__]
On Sun, Aug 16, 2026 at 6:54 PM Boris Cherny @.***>
wrote:

Closed #5277 <https://github.com/anthropics/claude-code/issues/5277> as completed. — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/5277?email_source=notifications&email_token=A475BZ5RGPRPAGS4R3OARBL5KI3SDA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTEOJVGM2DCOJUGYYTNJTSMVQXG33OU5RW63LNMVXHJJLFOZSW45FMMZXW65DFOJPWG3DJMNVQ#event-29534194616>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/A475BZ2IZHEYOSNI7IEAZFL5KI3SDAVCNFSNUABFKJSXA33TNF2G64TZHM4TGNZSGUZTINZVHNEXG43VMU5TGMRZG44DQOBRGM4KC5QC> . You are receiving this because you commented.Message ID: @.***>
btpence · 1 month ago

I came up with a workaround for AbsoluteTelnet/SSH. If you're using version 14 or above, you can just paste screenshots and files into Claude Code over SSH. Behind the scenes, it uses an SFTP channel across the current already open session and pastes the file location into the Claude chat. Like the other workarounds above, it delivers the file outside of the terminal, but unlike the solutions above, doesn't require additional connection/authentication. Also, it requires no additional setup or configuration. It should 'just work'. I still would prefer Kitty clipboard (OSC 5522) in-band in the tty session, which should work in all terminal sessions, not just SSH....

<img width="725" height="138" alt="Image" src="https://github.com/user-attachments/assets/abd8bdcc-4cb7-4eb7-83d1-0eaa0679275f" />

Brian Pence
Celestial Software

danbopes · 1 month ago

+1 for OSC 5522 support. I hate having to have to spin up daemon's and services to copy over files. OSC 5522 is starting to be implemented in other terminals, and should be included in claude code

nyxsky404 · 1 month ago

The official workaround is basically scp the file over and give Claude the path. I wanted the same thing, just without having to do those steps manually every time.

I ended up building vmup for it. It collects the files locally, uploads them over your existing OpenSSH setup into one ~/vmup/agents-…/ folder, then copies a prompt with that path to your clipboard. It also cleans up old uploads automatically.

Works with multiple files too, so I can send a screenshot, PDF, etc. together:

npm i -g @nyxsky404/vmup
vmup init
vmup ./shot.png ./spec.pdf

https://github.com/nyxsky404/vmup

Native OSC 5522 would still be nicer for directly pasting a single screenshot. I mostly use this when I need to get several files onto the remote machine at once.

btpence · 1 month ago

I created this page to demonstrate how its done in AbsoluteTelnet/SSH. No extra software, no daemons, etc.... If you have SFTP enabled, it 'just works':

https://www.celestialsoftware.net/claude-code-in-absolutetelnet-ssh/