Paste Images into Claude Code Over SSH with a Raycast Script
A small Raycast Script Command that copies a clipboard image to a remote machine via Tailscale SSH and puts the bare file path back on your clipboard — so you can paste images into Claude Code sessions running on a remote box.
The Problem
Claude Code running on a remote machine over SSH can read local files on that machine. It cannot receive images pasted from your Mac's clipboard — the paste never crosses the SSH boundary.
The workaround: upload the image to the remote machine first, then paste the file path. Claude reads the path, loads the file.
The Script
A single Raycast Script Command handles the whole thing:
- Copy an image to your clipboard (
Cmd-Ctrl-Shift-4for a region, or copy from anywhere) - Trigger the hotkey
- The image is streamed to
/tmp/on the remote machine via Tailscale SSH - The bare remote path replaces your clipboard contents
- Paste into your Claude Code session
Cmd-Ctrl-Shift-4
→ hotkey
→ Copied: /tmp/cc-paste-20260617-143201-12345.png
→ ⌘V into SSH session
Claude picks up the path with its Read tool. No extra steps.
Setup
brew install pngpaste
Grab the script from the agents-in-a-box repo, drop it into your Raycast Script Commands directory, and update REMOTE_HOST to match your SSH alias.
In Raycast: Settings → Extensions → Script Commands → add your scripts directory → bind a hotkey.
What it checks before transferring
pngpasteinstalledtailscalerunning- Remote peer online
- Clipboard actually contains an image (aborts with a HUD error if not)
- Remote file is non-empty after write (verifies the transfer)
Local temp file is cleaned up via trap on exit regardless of outcome.