Skip to content

Hackerbone/cssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cssh — paste local screenshots into your remote coding agent over SSH

cssh

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.

cssh.ssitaraman.com


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.

Install

One line, on your laptop:

curl -fsSL https://raw.githubusercontent.com/Hackerbone/cssh/main/install.sh | bash

The 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.

Usage

  1. Copy or screenshot an image.
  2. Daemon mode: nothing to do. Hotkey mode: press your bound key.
  3. In Claude Code on the remote, press Ctrl+V.

Bind the hotkey to ~/.cssh/bin/cssh-push with Raycast, Hammerspoon, macOS Shortcuts, or Karabiner.

How it works

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 xclip shim, placed ahead of the real one on PATH. When a fresh image is waiting at ~/.cssh/latest.png it serves it to those calls; otherwise it delegates to the real xclip. 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, Wayland wl-paste, X11 xclip, 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-push on demand.

Configuration

Setting Location Default
Default push target ~/.cssh/configREMOTE chosen at install
Per-push override cssh-push <host>
Image TTL (remote) ~/.cssh/ttl (seconds) 300
Daemon poll interval CSSH_POLL_SECONDS 1

Requirements

  • 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.

Uninstall

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 -- --uninstall

Add --yes to skip the confirmation. Any offline host is reported so you can clean it later; everything on your laptop is removed regardless.

License

MIT

About

Paste your local screenshots into you remote coding agent like Claude Code CLI / Codex CLI or any remote terminal app!

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors