Pasting Images into Claude Code on Linux
While I mess with a bunch of different agentic coding setups, Claude Code is my daily driver when I want to be productive. At some point, pasting images into Claude Code was working fine for me on Linux, then it stopped. Honestly don't remember when, but I'm guessing it may have been when I switched back to Debian from Arch Linux.
Fast forward a bit to recent times. I decided to give Ghostty a shot. The TL;DR there is that it seems great, but wasn't for me. One notable issue I ran into was that pasting images into Claude Code didn't work for me in Ghostty on macOS. Wasn't working on Linux either, which cleared the air on whether or not Alacritty and/or Tmux was the issue.
Doing some debugging, I was wondering if perhaps I could tie into xclip
somehow to get things working. Turns out, I didn't even have xclip installed,
which is why I think this probably broke when I started fresh on Debian.
I very much consider myself a command-line guy, but going months without
noticing that I didn't even have xclip installed knocked my street cred down a
bit.
This all sent me down a rabbit hole to figure out what sort of tools the cool
kids are using these days. Seems I missed the memo about wl-clipboard, a
Wayland-specific clipboard utility. I didn't have that one installed either.
And wouldn't you know it, installing either one got Claude Code accepting images
again. Even on Wayland, xclip with whatever magic translation layer is fine.
YMMV on different stacks, but making sure you have some sort of clipboard utilities installed on Linux seems to be the missing piece for Alacritty and Tmux. My assumption is that macOS worked because of the pre-installed pasteboard utilities.
Doesn't explain why it didn't work with Ghostty on macOS though.
:wq
Like this drivel? There's a whole RSS feed of it, or subscribe via email.