[BUG] Bug/Feature: Clipboard image paste not working in WSL

Resolved 💬 35 comments Opened Dec 11, 2025 by jfikrat Closed May 8, 2026
💡 Likely answer: A maintainer (claude[bot], contributor) responded on this thread — see the highlighted reply below.

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.

View original on GitHub ↗

35 Comments

github-actions[bot] · 6 months ago

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.

QuokkaPride · 6 months ago

Same thing happens to me. Pasting images into the terminal has never worked running Claude Code in WSL. Works on Windows Claude Code Terminal.

executorrr86 · 6 months ago

Same for me, It's not working.

FaisalHussain95 · 6 months ago

Hi,

This seems similar to what codex has been dealing with

https://github.com/openai/codex/pull/5644

Zate · 5 months ago

Not working for me either.

Akrabut · 5 months ago

Not working for me either using the exact same steps that do work on Mac:

  1. Copy image to clipboard.
  2. Attempt to paste in CC.
  3. Works on Mac, does nothing on Windows 11.
ceniack · 5 months ago

also not working,

Fkscorpion · 5 months ago

Same here.
If someone is looking for a workaround, it currently works for me with Powershell (7) and wsl this way:

  • Install Claude Code for Powershell: https://code.claude.com/docs/en/setup
  • Open Powershell and navigate to the wsl path you want to work in, e.g. cd \\wsl$\Ubuntu-22.04\home\<yourUserName>\projects
  • Start claude code

Now 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

mbrugnoni · 5 months ago

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.

Duskfall · 5 months ago

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

manwithoutsleep · 5 months ago

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.

Turik1 · 5 months ago

Same issue for me, would be really nice to avoid switching to PowerShell or using inconvenient ways like saving to project folder etc.

abacha · 5 months ago

plus one in this. It works on codex

LBranigan · 5 months ago

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's checkImage only greps for png|jpeg|jpg|gif|webp. A background watcher converts BMP→PNG on the Wayland clipboard automatically:

~/.local/bin/clip2pngscript that converts clipboard BMP to PNG via ImageMagick. Run with --watch for a polling daemon.

Auto-start/stop via Claude Code hooks in ~/.claude/settings.json:

"SessionStart": [{"hooks": [{"type": "command", "command": "/home/YOU/.local/bin/clip2png --watch"}]}],
"SessionEnd": [{"hooks": [{"type": "command", "command": "/home/YOU/.local/bin/clip2png --stop"}]}]

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 to alt+v in ~/.claude/keybindings.json:

{
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "alt+v": "chat:imagePaste"
      }
    }
  ]
}

Important: The top level must be an object with a bindings array, 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/bmp to the grep pattern) that would eliminate the need for the conversion workaround.

Zate · 5 months ago

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.

heyhayes · 5 months ago

This is great work; works flawlessly.

SeMmyT · 4 months ago

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.lua keys table:

-- Alt+V: save clipboard image to temp file, paste WSL path
{ key = 'v', mods = 'ALT', action = wezterm.action_callback(function(window, pane)
  local ps = 'powershell.exe'
  local cmd = table.concat({
    "$ErrorActionPreference='Stop';",
    "Add-Type -AssemblyName System.Windows.Forms;",
    "Add-Type -AssemblyName System.Drawing;",
    "$img=[System.Windows.Forms.Clipboard]::GetImage();",
    "if ($null -eq $img) { exit 1 }",
    "$ts=Get-Date -Format 'yyyyMMdd_HHmmss';",
    "$path=\"$env:TEMP\\wez_clip_$ts.png\";",
    "$img.Save($path,[System.Drawing.Imaging.ImageFormat]::Png);",
    "Write-Output $path;",
  }, ' ')
  local ok, stdout, stderr = wezterm.run_child_process({ ps, '-NoProfile', '-NonInteractive', '-Command', cmd })
  if ok and stdout and #stdout > 0 then
    local path = stdout:gsub('%s+$', '')
    local wsl_path = path:gsub('\\', '/')
    wsl_path = wsl_path:gsub('^(%a):', function(drive) return '/mnt/' .. drive:lower() end)
    pane:send_paste(wsl_path)
  else
    pane:send_paste('# No image found in clipboard')
  end
end) },

Take a screenshot, hit Alt+V, get something like /mnt/c/Users/Daniel/AppData/Local/Temp/wez_clip_20260218_023003.png pasted in. Works on Win11 + WSL2 Ubuntu, Claude Code v2.1.45.

imurodl · 4 months ago

I built a workaround for this — a wl-paste wrapper that bypasses the WSLg clipboard bridge entirely:

  • Text: reads via win32yank.exe (direct Windows clipboard access)
  • Images: uses powershell.exe with System.Windows.Forms.Clipboard to save the image as PNG to a temp file via UNC path, then serves it back to Claude Code

Combined with a keybinding (alt+vchat:imagePaste), this gives working screenshot paste on WSL.

Repo: https://github.com/imurodl/claude-code-wsl-paste

Install:

git clone https://github.com/imurodl/claude-code-wsl-paste.git
cd claude-code-wsl-paste
bash install.sh
bfishman · 4 months ago

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:

  • @LBranigan's clip2png daemon polls every 2s and mutates your clipboard in-place (BMP gets overwritten with PNG via wl-copy). If you copy a BMP for use outside Claude Code, the original is gone.
  • @imurodl's wrapper replaces the entire clipboard pipeline with win32yank.exe and PowerShell. All text reads, all writes, everything goes through a different path. That means line ending conversion, bypassing WSLg entirely, and breaking anything that relies on Wayland clipboard features.

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:

  1. When something calls wl-paste -l and the clipboard has image/bmp but not image/png, it appends image/png to the output. This is what makes Claude Code's checkImage grep succeed.
  2. When something calls wl-paste --type image/png and the real wl-paste can't provide PNG, it grabs the BMP and pipes it through ImageMagick's convert.

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.

  1. Install Dependencies:
sudo apt install imagemagick
sudo apt install wl-clipboard
  1. Create the wrapper:
cat << 'WRAPPER' | sudo tee /usr/local/bin/wl-paste > /dev/null
#!/usr/bin/env bash
# wl-paste wrapper for WSL2 — adds BMP→PNG conversion for Claude Code
# Delegates everything to the real wl-paste, only intercepts BMP→PNG.
REAL_WL_PASTE="/usr/bin/wl-paste"

# Detect --list-types or -l
if [[ " $* " == *" --list-types "* ]] || [[ " $* " == *" -l "* ]]; then
    output=$("$REAL_WL_PASTE" "$@" 2>/dev/null)
    rc=$?
    echo "$output"
    # If clipboard has BMP but not PNG, advertise PNG too
    if echo "$output" | grep -q 'image/bmp' && ! echo "$output" | grep -q 'image/png'; then
        echo "image/png"
    fi
    exit $rc
fi

# Detect --type image/png
if [[ " $* " == *" --type image/png "* ]] || [[ " $* " =~ --type\ image/png$ ]]; then
    # Try real wl-paste first
    "$REAL_WL_PASTE" "$@" 2>/dev/null && exit 0
    # Fall back: extract BMP, convert to PNG via ImageMagick
    "$REAL_WL_PASTE" --type image/bmp 2>/dev/null | convert bmp:- png:- 2>/dev/null
    exit $?
fi

# Everything else: pass through unchanged
exec "$REAL_WL_PASTE" "$@"
WRAPPER

sudo chmod +x /usr/local/bin/wl-paste
  1. Create the keybinding (needed because Windows Terminal intercepts Ctrl+V):
mkdir -p ~/.claude
cat << 'KEYBIND' > ~/.claude/keybindings.json
{
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "alt+v": "chat:imagePaste"
      }
    }
  ]
}
KEYBIND
  1. Verify:
which wl-paste                        # should show /usr/local/bin/wl-paste
# copy an image on Windows (Win+Shift+S), then:
wl-paste -l                           # should include image/png
wl-paste --type image/png | file -    # should say PNG image data

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:

sudo rm /usr/local/bin/wl-paste

And the real /usr/bin/wl-paste will take over automatically.

imurodl · 4 months ago

@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-paste doesn'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.

ZarifS · 4 months ago

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.

ahmad-taha · 4 months ago

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

Nailuu · 4 months ago

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

curl -fsSL https://raw.githubusercontent.com/Nailuu/wsl-screenshot-cli/main/scripts/install.sh | bash

Usage

Option 1 - Auto-start with your shell (add to ~/.bashrc):

wsl-screenshot-cli start --daemon

Option 2 - Auto-start/stop with Claude Code hooks (add to ~/.claude/settings.json):

{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "wsl-screenshot-cli start --daemon 2>/dev/null; echo 'wsl-screenshot-cli started'"
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "wsl-screenshot-cli stop 2>/dev/null"
          }
        ]
      }
    ]
  }
}

Then just take a screenshot and Ctrl+Shift+V in Claude Code - done.

psmux · 4 months ago

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.

chan27-cpa · 4 months ago

Still an issue as of 2026-03. Adding more context:

Competitor comparison — OpenAI Codex CLI already supports this in WSL:

  • Ctrl+Shift+V to paste multiple images from clipboard
  • Full CJK (Chinese/Japanese/Korean) input support

Both 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:

  • Windows 11 + WSL2 (Ubuntu 24.04)
  • Windows Terminal + tmux
  • Claude Code: latest

Please prioritize WSL parity. A significant portion of developers use WSL as their primary dev environment.

chrisxthe · 3 months ago

Additional root cause: ctrl+v keybinding intercepted by Windows Terminal

Beyond the Sharp/bun issue (#32185), there's a second independent blocker for WSL2 users in Windows Terminal:

The imagePaste keybinding is ctrl+v on Linux, but Windows Terminal intercepts Ctrl+V for text paste before it reaches Claude Code.

The irony: Claude Code already has alt+v for native Windows:

// From the binary (minified)
Tf1 = Z8() === "windows" ? "alt+v" : "ctrl+v"

But WSL2 reports as "linux", so it gets ctrl+v — which Windows Terminal swallows.

Suggested fix: Add a WSL2 check to the platform detection, something like:

Tf1 = (Z8() === "windows" || isWSL()) ? "alt+v" : "ctrl+v"
// or simply: use "meta+v" on Linux (Alt key in terminal = meta)

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 a wl-paste wrapper that converts WSLg's BMP output to PNG via ffmpeg (bypassing the broken Sharp module), image paste works end-to-end on WSL2.

Jovlang · 3 months ago

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)

gowanuslobster · 3 months ago

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!

hqhq1025 · 3 months ago

For macOS → remote Linux/WSL: clipaste v2.1.0 now handles SSH remote paste.

brew install hqhq1025/clipaste/clipaste && brew services start clipaste
clipaste ssh-setup user@your-server

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

Joonel · 3 months ago

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 😝

max-programming · 3 months ago

Still nothing on this I see :(

YoanWai · 2 months ago

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:

  1. The original image (so other Windows apps still see it)
  2. The WSL path as Unicode text
  3. A FileDropList pointing at the Windows-side path

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:

  • Use pre-compiled System.Windows.Forms.Clipboard APIs, not Add-Type -TypeDefinition — EDR (SentinelOne, CrowdStrike) blocks runtime csc.exe invocation
  • Pump [System.Windows.Forms.Application]::DoEvents() on the STA thread so other apps' OLE/COM clipboard ops don't time out
  • Fingerprint your own writes (image + text + filedrop all present) so the poller doesn't loop on its own output
  • Skip clipboards from Excel/Sheets that include XML Spreadsheet / Csv / HTML Format — those are cell copies, not screenshots

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

BitCalSaul · 2 months ago
For macOS → remote Linux/WSL: clipaste v2.1.0 now handles SSH remote paste. brew install hqhq1025/clipaste/clipaste && brew services start clipaste clipaste ssh-setup user@your-server 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

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.

claude[bot] contributor · 2 months ago

This is a duplicate of #42440, which was fixed as of version 2.1.136.

github-actions[bot] · 19 days ago

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.