Engineering · November 2026

How Fibo lets Claude Code on the other end of ssh take a pasted screenshot

On your own machine, you take a screenshot, press ⌘V in Claude Code, and [Image #1] shows up in the prompt. Over ssh, the same key pastes nothing, because Claude Code reads the clipboard of the computer it runs on. We tried 20 kinds of paste and found the rule Claude Code follows: a paste that is nothing but one absolute image path becomes an attachment. Fibo builds on that rule: it saves the picture on the other computer first, then pastes only the path over there.

Real Claude Code screens: Ctrl+V finds no picture on that computer's clipboard and pastes nothing; with Fibo's approach the picture is saved there first and its absolute path pasted, the prompt shows [Image #1], and Claude Code describes the picture
Real screens from Claude Code v2.1.332; keys and pastes were sent by a script. For the recording, “the other computer” is Claude Code in a local tmux session with no picture on the clipboard. First half: Ctrl+V pastes nothing. Second half: the picture is saved, and only its absolute path is pasted.
What Fibo is: a native Mac workbench for coding agents such as Claude Code and Codex, open source under MIT. It can reach another computer running Fibo over SSH and open that computer's terminals in the same window; the previous post, One Window for Terminals on Every Machine, explains how. Install: download the DMG or brew install --cask majiayu000/tap/fibo. Both computers need it.

01 The problem: ⌘V sends only a Ctrl+V

A local Claude Code gets your screenshot by reading the clipboard itself. When you press ⌘V in a terminal and the clipboard holds only a picture, the terminal writes one byte, 0x16, which is Ctrl+V. Claude Code reads that byte and asks its own operating system for the clipboard image. Between a terminal and a program there is only a byte stream, and no common way to say “a PNG follows”.

When the terminal runs on another computer, that path breaks. The picture is on the clipboard of computer A in front of you, but 0x16 goes to computer B, and Claude Code on B reads B's clipboard, which doesn't have it. Dragging a file in fails the same way: the terminal pastes the file's path on A as text, and B has no such file.

Fibo's window reaches another computer through ssh -L, which forwards the Unix socket of that computer's fibo serve host to this one, and then speaks the same protocol as it does locally (the previous post covers this). So Fibo had the same problem. Before PR #625, pasting a picture or dropping a file on another computer's terminal was refused with a note that files and pictures couldn't be sent to another computer yet.

Why OSC 52 doesn't help

People often suggest OSC 52, which lets a remote program read and write your local clipboard. According to kitty's documentation, OSC 52 carries plain text only; pictures need kitty's OSC 5522 extension, which few terminals support. Someone asked Claude Code for image paste over ssh via OSC 52/5522 in issue #42712, which is closed; the v2.1.332 we tested still reads its own computer's clipboard on Ctrl+V. Terminal image protocols (kitty's, iTerm2's) go the other way: they let a program draw a picture in the terminal.

02 The observation: a lone image path is an attachment

Locally, dragging a screenshot file into Claude Code also produces [Image #1]. Nothing private is involved: the terminal just pastes the file's path (Fibo wraps it in a bracketed paste, \x1b[200~…\x1b[201~). When one paste is nothing but the path of an image file, Claude Code reads that file from disk and attaches it.

Fibo's phone app already relied on this to send pictures to agents on a computer: the phone uploads the picture to fibo serve on that computer, the host saves it as a file, and the path is pasted into the terminal on its own. Before writing code, we mapped the edges: in Claude Code v2.1.332, we did one bracketed paste per case, 20 in all. Where text was involved we used 看看这个 (“look at this”).

Already in the promptWhat this one paste containedResult
emptyabsolute path /tmp/fibo-edge/shot.png[Image #1]
emptyabsolute path plus a trailing space[Image #1]
emptypath then text /tmp/…/shot.png 看看这个kept as text
emptytext then path 看看这个 /tmp/…/shot.pngkept as text
emptyspace in the file name, escaped my\ shot.png[Image #1]
emptyspace in the file name, not escaped my shot.png[Image #1]
emptypath in single or double quotes (2 pastes)[Image #1]
emptystarting with ~: ~/fibo-edge-shot.pngkept as text
emptyrelative path shot.png (file in the current folder)kept as text
emptyabsolute path to a JPEG, GIF or WebP (3 pastes)[Image #1]
emptyabsolute path to a TIFF or BMP (2 pastes)kept as text
emptyright format, but no such filekept as text
emptytwo absolute paths, one space between[Image #1] [Image #2]
typed 看看这个 absolute path plus a space看看这个 [Image #1]
typed 看看two absolute paths, space between看看[Image #1] [Image #2]
empty, typing afterabsolute path plus a space, then typed 图里是什么 (“what's in it”)[Image #1] 图里是什么

What counts is the single paste, not what the prompt already holds: a path and text in the same paste stay text, while a path pasted on its own works with text typed before or after it. The table gave Fibo four rules:

Without Fibo, you can do it by hand: save the screenshot as a file (⌘⇧4 saves to the Desktop by default), copy it over, then paste its absolute path on its own in Claude Code over there.

# on the computer in front of you
scp ~/Desktop/screenshot.png other-computer:/tmp/shot.png
# a TIFF first: sips -s format png shot.tiff --out shot.png

# then, in Claude Code on the other computer, paste just this line
/tmp/shot.png

You can type before or after it, as long as the path and your text aren't in the same paste.

03 The design: the picture goes around the terminal, only the path goes in

Fibo's job is to hide those manual steps behind one ⌘V: the window hands the picture to the other computer's host, which saves it as a file and answers with its absolute path, and the window pastes that path into the terminal.

Computer A · Fibo window ① ⌘V: a picture on the clipboard TIFF / BMP become PNG ② This terminal is on B Upload instead of Ctrl+V ⑤ Paste just that path shell-escaped, bracketed paste one fails: none is pasted Computer B · fibo serve ③ Check the file header PNG / JPEG / GIF / WebP only saved as phone-images/uuid.png mode 600, cleared after 7 days Computer B · Claude Code ❯ [Image #1] SaveImage { data: base64 } over the existing ssh -L forward ④ Absolute path on B ⑥ One image path = one attachment
The picture never enters the terminal; only its path does. Upload and answer travel over the ssh -L forward the window already has.

The window already talks to that host over a protocol, and we added one request, SaveImage { data }, where data is the picture in base64. On ⌘V, the window checks which computer the terminal is on: if it's this one, it sends 0x16 as before and Claude Code reads the clipboard itself; if it's another, the picture is uploaded. Dropping a picture file on the terminal goes through the same upload function.

On the other computer, the host decodes, saves and answers with the path (simplified code):

Request::SaveImage { data } => {
    let bytes = base64::engine::general_purpose::STANDARD
        .decode(data)
        .map_err(io::Error::other)?;
    let path = crate::pictures::save(&supervisor(shared)?.socket(), &bytes)?;
    Ok(Reply::Text(path.to_string_lossy().into_owned()))
}

pictures::save is shared with the phone's pictures, which go to phone-images/ beside the host's socket. The window escapes the returned path the same way as a dropped file and pastes it; when the terminal has bracketed paste mode on, it is wrapped in \x1b[200~…\x1b[201~, and a space follows the path.

The upload runs on a background thread, over a new connection to the forwarded socket each time. ssh -L gives every connection its own channel, so an upload doesn't sit on the connection your typing goes through. The whole change is 12 files, 278 lines added and 92 removed.

04 Details and trade-offs

Why not the phone's upload protocol

The phone reaches a computer through a different protocol (ssh host fibo remote --stdio) that can already send pictures. But the window already has an ssh -L forward to that computer; opening the phone protocol as well would mean two SSH links to one computer, each with its own disconnects and errors. One more request was simpler.

base64 and the 11 MB limit

The protocol is JSON. A plain Vec<u8> would be written as an array of numbers, 3 to 4 characters per byte; base64 adds only a third. A frame holds at most 16 MB, so one picture may be at most 11 MB (about 14.7 MB encoded). A bigger one is stopped on this computer with a note and never sent.

Formats: by header, not by extension

The window looks at the bytes' header. PNG, JPEG, GIF and WebP go as they are; another format that decodes as a picture (TIFF, BMP) goes as PNG, whether it came from the clipboard or a dropped file; anything that doesn't decode (a PDF, source code) is refused, with a note to copy the file over first. The host on the other side also keeps only those four headers and writes nothing else to disk.

Several pictures: one fails, none is pasted

When several pictures are dropped at once, the window uploads them one by one, and if one fails, no path is pasted, so the prompt never gets half of them. The ones already uploaded stay on the other computer and are cleared after 7 days, as below.

Storage: yours only, kept 7 days

Only you can enter phone-images/; files are mode 600 with random UUID names. Each new save deletes pictures older than 7 days. Seven days because resuming a session from a few days ago may have the agent read a picture from its history again.

Older hosts: no major protocol bump

A common case: your Fibo is updated, the other computer's isn't. Had we bumped the protocol's major version for SaveImage, the new window's handshake with the old host would fail and none of that computer's terminals would open. So the version stays: a host from v0.1.4 on answers an unknown request with a line starting unsupported or invalid request: …, and the window shows “Fibo on that computer is too old to receive images. Update it, then try again.” instead. A host from v0.1.3 or earlier closes the connection on an unknown request, and the window shows the raw error.

05 How we checked it

Limits: what we haven't tested

Summary: three things we did