[BUG] Bug/Feature: Clipboard image paste not working in WSL
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
## Summary
Ctrl+V image paste works on native Windows/macOS but not in WSL.
## Environment
- OS: Windows 11 + WSL2 (Ubuntu)
- Terminal: Windows Terminal
## Current Behavior
- Native Windows: Ctrl+V pastes image ✓
- WSL: Ctrl+V with image in clipboard → nothing happens ✗
## Expected Behavior
WSL should detect Windows clipboard image and save it to a temp file,
then paste the path.
## Technical Details
WSL can access Windows clipboard via PowerShell:
```powershell
$img = Get-Clipboard -Format Image
$img.Save("path.png")
Workaround
Manual script that saves clipboard image and copies path:
# pimg script using PowerShell from WSL
powershell.exe -Command "Get-Clipboard -Format Image..."
Related
Codex (in WSL) supports Ctrl+Alt+V for this functionality.
What Should Happen?
Expected Behavior
WSL should detect Windows clipboard image and save it to a temp file,
then paste the path.
Error Messages/Logs
Steps to Reproduce
Technical Details
WSL can access Windows clipboard via PowerShell:
```powershell
$img = Get-Clipboard -Format Image
$img.Save("path.png")
Workaround
Manual script that saves clipboard image and copies path:
# pimg script using PowerShell from WSL
powershell.exe -Command "Get-Clipboard -Format Image..."
Claude Model
Other
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.065
Platform
Other
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Related
Codex (in WSL) supports Ctrl+Alt+V for this functionality.
35 Comments
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Same thing happens to me. Pasting images into the terminal has never worked running Claude Code in WSL. Works on Windows Claude Code Terminal.
Same for me, It's not working.
Hi,
This seems similar to what codex has been dealing with
https://github.com/openai/codex/pull/5644
Not working for me either.
Not working for me either using the exact same steps that do work on Mac:
also not working,
Same here.
If someone is looking for a workaround, it currently works for me with Powershell (7) and wsl this way:
cd \\wsl$\Ubuntu-22.04\home\<yourUserName>\projectsNow you can use Drag & Drop and Alt + V for image pasting and still work in the directory of your project. The downside is of course that you now use windows + powershell and don't have access to the wsl terminal and it's tools
Same issue as above with same WSL environment. This has become a big blocker as I've become accustomed to using this feature on my linux desktop for making UI code changes.
codex has solved this apparently, just tested it. I think it's because they use a different cli implementation for WSL, looks like opencode equivalent
Same issue for me. It works in PowerShell, but so many other features are inconvenient in PowerShell that I don't intend to return to that CLI. Workaround: Save the image in my project folder and tell CC to read it from there. Less than ideal but it works.
Same issue for me, would be really nice to avoid switching to PowerShell or using inconvenient ways like saving to project folder etc.
plus one in this. It works on codex
Working WSL2 Image Paste Solution
I got Alt+V image paste working on WSL2 with two fixes:
Fix 1: Clipboard format (BMP → PNG)
Windows copies images as
image/bmp, but Claude Code'scheckImageonly greps forpng|jpeg|jpg|gif|webp. A background watcher converts BMP→PNG on the Wayland clipboard automatically:~/.local/bin/clip2png— script that converts clipboard BMP to PNG via ImageMagick. Run with--watchfor a polling daemon.Auto-start/stop via Claude Code hooks in
~/.claude/settings.json:Fix 2: Keybinding (Ctrl+V intercepted by Windows Terminal)
The default Linux binding is
ctrl+v, but Windows Terminal intercepts that for text paste. Rebind toalt+vin~/.claude/keybindings.json:Important: The top level must be an object with a
bindingsarray, NOT a bare JSON array.Result
Copy image on Windows → wait ~2s → Alt+V in Claude Code → image pastes.
Filed #25935 requesting the one-line fix (add
image/bmpto the grep pattern) that would eliminate the need for the conversion workaround.Cool idea, and it works. I added a plugin to add it to my wsl2. Add marketplace Zate/cc-plugins and install the wsl-clipboard-fix plugin if you want to try it.
This is great work; works flawlessly.
Got this working on WezTerm + WSL2 with a custom keybind. Alt+V saves the clipboard image to a temp file via PowerShell, converts the path to WSL format, and pastes it into the terminal. Claude Code picks it up from there.
Add this to your
.wezterm.luakeys table:Take a screenshot, hit Alt+V, get something like
/mnt/c/Users/Daniel/AppData/Local/Temp/wez_clip_20260218_023003.pngpasted in. Works on Win11 + WSL2 Ubuntu, Claude Code v2.1.45.I built a workaround for this — a
wl-pastewrapper that bypasses the WSLg clipboard bridge entirely:win32yank.exe(direct Windows clipboard access)powershell.exewithSystem.Windows.Forms.Clipboardto save the image as PNG to a temp file via UNC path, then serves it back to Claude CodeCombined with a keybinding (
alt+v→chat:imagePaste), this gives working screenshot paste on WSL.Repo: https://github.com/imurodl/claude-code-wsl-paste
Install:
Lighter-weight alternative: thin wl-paste wrapper (no daemon, no clipboard mutation)
The existing solutions in this thread work, but both have tradeoffs I wanted to avoid:
I was looking to avoid any side effects, so here's a hybrid implementation that achieves that: a wl-paste wrapper that delegates to the real /usr/bin/wl-paste for everything and only intercepts the BMP-to-PNG conversion case.
It does two things:
That's really it. Text paste, wl-copy, other mime types, all flags -- everything else hits the real wl-paste via exec with no changes.
Install
Do this from a WSL terminal, not from PowerShell or a Windows-mounted path. Writing the script from Windows will give you \r\n line endings, which breaks the shebang.
Then start Claude Code, copy an image on Windows, and press Alt+V.
Note: The format bmp detection issue seems to have been fixed upstream in #25935 (merged Feb 16). Once a Claude Code release includes that fix, the wrapper becomes unnecessary. (Alt+V keybinding likely still required).
So to uninstall:
And the real /usr/bin/wl-paste will take over automatically.
@bfishman Thanks for the clean approach! I've updated my repo to use your thin wrapper as the primary path when WSLg clipboard works.
However, on my setup (WezTerm + WSL2), the real
/usr/bin/wl-pastedoesn't function properly — it returns garbled data instead of clipboard types. This seems to be a WezTerm-specific issue (filed here).So the wrapper now auto-detects: if WSLg clipboard works, it uses your BMP→PNG approach via ImageMagick. If it's broken, it falls back to
win32yank.exe+ PowerShell.Even on version 2.1.51 which is supposed to include the fix for the bmp format issues I still cannot paste png screenshots into claude code when I take a screenshot with windows. I've added the keybind so hitting alt+v brings up the error message in claude
No image found in clipboard...- so it seems even though the fix is merged and supposedly released it doesn't seem to work without the scripts above.@ZarifS I am facing the same issue. I've commented on #25935 (it was closed and mentioned in changelog for v2.1.47)
It should work in latest version, and I've tried everything and i still can't get the paste to work. It shows
No image found in clipboard.I built a CLI tool that solves this exact problem - wsl-screenshot-cli
Unlike other workarounds that hijack the clipboard, this tool preserves full Windows paste functionality. After taking a screenshot, your clipboard contains three formats simultaneously:
| Where you paste | What you get |
|---|---|
| WSL terminal (Ctrl+Shift+V) | File path -> Claude Code picks it up |
| Windows apps (Paint, Teams, Slack...) | The image, as usual |
| Explorer / file dialogs | The PNG file (paste-as-file) |
No broken clipboard. No choosing between WSL and Windows. Everything just works.
Quick Install
Usage
Option 1 - Auto-start with your shell (add to
~/.bashrc):Option 2 - Auto-start/stop with Claude Code hooks (add to
~/.claude/settings.json):Then just take a screenshot and
Ctrl+Shift+Vin Claude Code - done.or you could try psmux : https://github.com/marlocarlo/psmux , a native tmux on powershell. Claude code and claude code agent teams works great on powershell.
Still an issue as of 2026-03. Adding more context:
Competitor comparison — OpenAI Codex CLI already supports this in WSL:
Ctrl+Shift+Vto paste multiple images from clipboardBoth work out of the box in the exact same WSL2 environment where Claude Code fails. This is not a WSL limitation — it's an implementation gap.
Technical note: Windows interop (
powershell.exe Get-Clipboard -Format Image,clip.exe) provides full clipboard access from WSL, including image data. The workaround exists, but it should be built-in.CJK input is also broken in Claude Code on WSL — this may deserve its own issue, but it's part of the same "WSL is a second-class citizen" pattern.
Environment:
Please prioritize WSL parity. A significant portion of developers use WSL as their primary dev environment.
Additional root cause:
ctrl+vkeybinding intercepted by Windows TerminalBeyond the Sharp/bun issue (#32185), there's a second independent blocker for WSL2 users in Windows Terminal:
The
imagePastekeybinding isctrl+von Linux, but Windows Terminal intercepts Ctrl+V for text paste before it reaches Claude Code.The irony: Claude Code already has
alt+vfor native Windows:But WSL2 reports as
"linux", so it getsctrl+v— which Windows Terminal swallows.Suggested fix: Add a WSL2 check to the platform detection, something like:
Workaround
Binary patch
"ctrl+v"→"meta+v"in the Tf1 keybinding definition (same byte length). This makes Alt+V trigger image paste on Linux/WSL2. Combined with awl-pastewrapper that converts WSLg's BMP output to PNG via ffmpeg (bypassing the broken Sharp module), image paste works end-to-end on WSL2.As for Windows Terminal swallowing Ctrl+v by default, that key binding can be changed in WT settings, to avoid the conflict with Claude (and nvim's visual block mode)
to note, codex CLI running under WSL already handles this: ctrl-alt-v pastes an image from the clipboard. Claude team - keep up with codex please at least!
For macOS → remote Linux/WSL: clipaste v2.1.0 now handles SSH remote paste.
It runs a local HTTP server, tunnels through SSH
RemoteForward, and installs an xclip shim on the remote. Ctrl+V in remote Claude Code/Codex fetches the image from your local Mac. No extra tools needed on the server.GitHub: https://github.com/hqhq1025/clipaste
Funny we actually able to paste images using Claude Code Web connected to my local Claude Code cli session on the same machine and observe [#1 Image] being added to a message in wsl cli 😝
Still nothing on this I see :(
Hitting this on WSL2 (Ubuntu) with Claude Code 2.1.121. Win+Shift+S → Ctrl+V drops the image silently — BMP from the Windows clipboard never makes it through the Linux image filter.
Workaround that's been working for me for months: a small Go daemon polls the Windows clipboard via PowerShell, writes any new image as a PNG to
/tmp/.wsl-screenshot-cli/<sha>.png, then re-writes the clipboard with three formats simultaneously:Claude Code's Ctrl+V then picks up the text path and resolves it as an image attachment. Feels like native paste, no UX change.
Key implementation notes for anyone building their own:
System.Windows.Forms.ClipboardAPIs, notAdd-Type -TypeDefinition— EDR (SentinelOne, CrowdStrike) blocks runtimecsc.exeinvocation[System.Windows.Forms.Application]::DoEvents()on the STA thread so other apps' OLE/COM clipboard ops don't time outXML Spreadsheet/Csv/HTML Format— those are cell copies, not screenshotsNative fix would be much nicer (the BMP exclusion in the Linux clipboard filter is the actual gap), but in the meantime this closes the loop end-to-end.
Hi,
Claude works fine on my setup (both local and over SSH), but Codex does not.
When I try to paste an image in Codex, I get the following error:
Failed to paste image: clipboard unavailable: Unknown error while interacting with the clipboard: X11 server connection timed out because it was unreachable
I’ve verified that the clipaste SSH setup is working correctly — the xclip shim and tunnel both work, and I can manually fetch the image via xclip. So this seems specific to Codex’s clipboard backend not using xclip.
This is a duplicate of #42440, which was fixed as of version 2.1.136.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.