Paste local clipboard images into your remote coding agent over SSH.
Screenshot on your laptop, press Ctrl+V in a remote session — works with
Claude Code, Codex, or any terminal app that reads xclip.
Your agent runs on a remote box and reads the remote's clipboard, so a normal
paste never sees the screenshot sitting in your laptop's clipboard. cssh
bridges the two.
One line, on your laptop:
curl -fsSL https://raw.githubusercontent.com/Hackerbone/cssh/main/install.sh | bashThe installer reads ~/.ssh/config, lets you pick which host(s) to enable (or
add a new one), and sets everything up on both ends. Zero runtime dependencies
beyond bash and ssh. It uses gum
for the menus when available, and falls back to a clean built-in menu otherwise.
- Copy or screenshot an image.
- Daemon mode: nothing to do. Hotkey mode: press your bound key.
- In Claude Code on the remote, press Ctrl+V.
Bind the hotkey to ~/.cssh/bin/cssh-push with Raycast, Hammerspoon, macOS
Shortcuts, or Karabiner.
Claude Code — and other terminal agents like Codex — read pasted images on Linux
by shelling out to xclip (verified against the Claude Code binary):
xclip -selection clipboard -t TARGETS -o # is an image available?
xclip -selection clipboard -t image/png -o # give me the PNG
- Remote — a tiny
xclipshim, placed ahead of the real one onPATH. When a fresh image is waiting at~/.cssh/latest.pngit serves it to those calls; otherwise it delegates to the realxclip. The image is one-shot (served once, then deleted) with a TTL guard, so your next paste is normal text. No X server, no Xvfb, no OSC 52. - Local — reads the image from your OS clipboard (macOS
osascript, Waylandwl-paste, X11xclip, Windows PowerShell) and ships the bytes to the remote over a multiplexed SSH connection (a warm socket, so pushes are near-instant).
Two ways to trigger the push, chosen at install — use either or both:
- Daemon — auto-syncs every new clipboard image. Just screenshot, then paste.
- Hotkey — runs
cssh-pushon demand.
| Setting | Location | Default |
|---|---|---|
| Default push target | ~/.cssh/config → REMOTE |
chosen at install |
| Per-push override | cssh-push <host> |
— |
| Image TTL (remote) | ~/.cssh/ttl (seconds) |
300 |
| Daemon poll interval | CSSH_POLL_SECONDS |
1 |
- Laptop — macOS, Linux (X11/Wayland), or Windows via WSL/Git-Bash;
bash+ssh. - Remote — any Linux box you SSH into; the shim needs only
bash,stat,date.
One line — the mirror of install. It removes the remote shim (and its PATH
line), the local ~/.cssh, the login daemon, and every # cssh block from
~/.ssh/config (backing the file up to ~/.ssh/config.cssh.bak first):
curl -fsSL https://raw.githubusercontent.com/Hackerbone/cssh/main/install.sh | bash -s -- --uninstallAdd --yes to skip the confirmation. Any offline host is reported so you can
clean it later; everything on your laptop is removed regardless.
MIT
