Paste a screenshot into Claude Code over SSH
Updated 3 October 2026. What it says about other tools was checked that day.
When Claude Code runs on a server you reach over SSH, Ctrl+V doesn't paste your screenshot. Every fix comes down to the same two steps: put the image file on the server, then give the agent its path.
Why Ctrl+V doesn't work
Claude Code reads a pasted image from the clipboard of the machine it runs on. Over SSH, that's the server. Your screenshot is on your Mac's clipboard, and your terminal only sends the server text, so the image never arrives. Anthropic closed the request to make it work over SSH as not planned (#42712).
What every fix relies on: a path becomes the picture
Paste the path of an image file on the server, such as
/tmp/shot.png, and Claude Code attaches the image itself, exactly
as if you had pasted the picture. Codex, Gemini CLI and OpenCode do the same. So the whole job
is getting the file onto the server and its path into the prompt.
1. By hand, with scp
Fine when it happens once a day. Press ⌘⇧4 to save a screenshot to
the Desktop, rename it shot.png (macOS names it with spaces), then:
scp ~/Desktop/shot.png myserver:/tmp/shot.png
Paste /tmp/shot.png into Claude Code. Replace
myserver with the host you SSH into.
2. A shell function
To skip the file on the Desktop, copy the screenshot instead (⌃⌘⇧4)
and let pngpaste write it out
(brew install pngpaste). Put this in your
~/.zshrc:
shot() {
local name="shot-$(date +%s).png"
pngpaste "/tmp/$name" &&
scp -q "/tmp/$name" "${1:-myserver}:/tmp/$name" &&
printf '/tmp/%s' "$name" | pbcopy
}
Run shot, or shot otherhost, and your
clipboard holds the path, ready to paste. If there's no image on the clipboard or the upload
fails, it stops and leaves your clipboard alone.
It covers the everyday case. It doesn't send several screenshots at once or a file from Finder, show you which host you're about to send to, or work from your phone.
3. Let your terminal do it
- cmux, a free, open-source Mac terminal for coding agents: drop an image or a file into a remote session and it uploads it with scp over the session's own connection.
- kitty: its clipboard
kitten works over SSH, so
kitten clipboard -g shot.pngrun on the server saves your clipboard image there. - Termius on iPhone and Android uploads an image you paste into a session.
These work inside that one app, so you're tied to it.
4. Keep the agent's window on your Mac
- Claude Desktop can run Claude Code on a remote machine over SSH, with the app as the interface. You attach or drop a screenshot into its prompt as you would locally.
- Remote Control lets you follow a Claude Code session from the Claude app or claude.ai/code and attach photos there. It needs a Pro, Max, Team or Enterprise sign-in, and isn't available with an API key, on Amazon Bedrock, Google Cloud or Microsoft Foundry, through an LLM gateway, or in Zero Data Retention organizations.
Both are Claude only.
5. Hostbeam
Copy a screenshot, press ⌘⇧7, and Hostbeam beams it to the host you
picked, over your own SSH, and copies its path. Paste it into any agent, in any terminal.
- Any file too: copy it in Finder and press the shortcut, or drop it on the menu-bar icon.
- Several screenshots at once arrive as several pictures in Claude Code.
- The host key is checked before anything is sent, a name never overwrites a file, and a failed beam leaves your clipboard as it was.
- From the iPhone, through the share sheet, once the app is on the App Store.
- With the free MCP server on the host, the agent fetches your latest beam itself, with nothing to paste.
Which one to use
| If you | Use |
|---|---|
| send a screenshot now and then | scp by hand |
| want it free and don't mind a script | the shell function |
| already live in cmux or kitty | your terminal |
| use only Claude, signed in with a plan | Claude Desktop or Remote Control |
| want one shortcut for any agent and any terminal | Hostbeam |
Try Hostbeam
Free, with no limit and no account, on macOS 13 and later. It uses the SSH keys and
~/.ssh/config you already have, and installs nothing on the
server.