Pasting images into remote Codex sessions
My earlier post Seamless remote coding sessions shows how I use Tailscale, Eternal Terminal and tmux to work on a Linux machine at home from my MacBook. The remote sessions appear as regular iTerm2 panes, and reconnect when my network comes back.
Often, I screenshot a window or area on my laptop to instruct codex. With local sessions, pasting the image into codex shows a text like [Image #1] in the codex prompt input, and gives codex access to the image. With remote sessions this doesn’t work out-of-the-box: The screenshots will be stored in a tmp file locally that remote codex can’t access.
cc-clip makes this work. It runs a clipboard service on the Mac and makes it available to the remote machine through a reverse tunnel. For Codex, it also sets up a virtual display on Linux using Xvfb, with a bridge that supplies the clipboard image when Codex asks for it. No desktop session needed.
cc-clip uses an SSH reverse tunnel. For the ET setup, the plan is to carry that clipboard connection through an ET reverse tunnel as well, so it can recover from network interruptions along with the terminal sessions. Tailscale still provides the route to the machine at home.
Connecting the pieces
The Codex setup instructions cover installing cc-clip and selecting its Codex integration. The remote Codex process needs the bridge’s display environment, so start a fresh coding shell after setup. An existing tmux session won’t update the environment of processes already running inside it.
Software running as my user on the remote machine can request my Mac’s clipboard while connected. That’s the access I’m deliberately enabling so Codex can read the image.
The only thing I haven’t managed to set up is transparently using cmd-V in iTerm2 for both ordinary text paste and image paste, so when I want to paste an image to a remote codex session, I have to use ctrl-V.