claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Image Paste Functionality Broken on Windows Platform

Open T1nker-1220 opened this issue 5 months ago • 10 comments

Bug Description The ctrl+v for putting an image is not working at all on windows

Environment Info

  • Platform: win32
  • Terminal: cursor
  • Version: 1.0.59
  • Feedback ID: 554150ff-9be0-44e0-aaa0-a35e9bea1ac7

Errors

[]

T1nker-1220 avatar Jul 24 '25 05:07 T1nker-1220

Same problem with claude running from Ubuntu 24.04 WSL in Windows 11. I can paste the image (CTRL+V) on the clipboard to any other program fine. But in claude pressing CTRL+V does nothing.

hakonhagland avatar Jul 24 '25 14:07 hakonhagland

I just created a windows app to do this, It will copy the current screenshot as path, and you can ctrl+v to claude code: https://github.com/rizrmd/shotpath

rizrmd avatar Jul 31 '25 00:07 rizrmd

I think it only works for MAC - not on windows (WSL). I have to manually drag the image into my repo and from there into the Claude CLI. Ugly but it works. A copy + paste would really be appreciated.

10eputzen avatar Aug 03 '25 21:08 10eputzen

I just created a windows app to do this, It will copy the current screenshot as path, and you can ctrl+v to claude code: https://github.com/rizrmd/shotpath

It is not generating a wsl path for the screenshot it is a normal windows path

neondeex avatar Aug 22 '25 05:08 neondeex

Same here

PierrunoYT avatar Aug 24 '25 19:08 PierrunoYT

CTRL+V stopped working for me around 10 days ago. Alt+V now works. Did nout found any doc or info on that in docs :/

deadeuzesse avatar Sep 02 '25 15:09 deadeuzesse

CONGRATULATIONS : i successfully resolved the issue. basically using ubuntu in wayland makes the image paste by CTRL+V work in claude code while in X11 does not work.

hemangjoshi37a avatar Nov 04 '25 06:11 hemangjoshi37a

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.

github-actions[bot] avatar Dec 09 '25 10:12 github-actions[bot]

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.

Still happening.

khitab avatar Dec 17 '25 17:12 khitab

Python workaround for Windows users (no exe required)

For those who can't use shotpath.exe due to corporate security policies blocking downloads or PowerShell Constrained Language Mode, here's a pure Python alternative:

Setup

  1. Install dependencies:
pip install pillow pyperclip
  1. Save this as shotpath_watch.py in your home folder:
import os
import time
import hashlib
from datetime import datetime, timedelta
from PIL import ImageGrab
import pyperclip

folder = os.path.join(os.environ['TEMP'], 'shotpath')
os.makedirs(folder, exist_ok=True)

def cleanup_old_files(max_age_hours=24):
    """Delete screenshots older than max_age_hours"""
    cutoff = datetime.now() - timedelta(hours=max_age_hours)
    deleted = 0
    for f in os.listdir(folder):
        filepath = os.path.join(folder, f)
        if os.path.isfile(filepath):
            mtime = datetime.fromtimestamp(os.path.getmtime(filepath))
            if mtime < cutoff:
                os.remove(filepath)
                deleted += 1
    if deleted:
        print(f"[cleanup] Deleted {deleted} files older than {max_age_hours}h")

last_hash = None
last_cleanup = datetime.now()
print("ShotPath watcher running... (Ctrl+C to stop)")
print("Take a screenshot with Win+Shift+S - path will auto-copy to clipboard")
print("Auto-cleanup: files older than 24h deleted hourly\n")

cleanup_old_files()  # Initial cleanup

while True:
    try:
        img = ImageGrab.grabclipboard()
        if img:
            img_hash = hashlib.md5(img.tobytes()).hexdigest()
            if img_hash != last_hash:
                last_hash = img_hash
                timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
                filepath = os.path.join(folder, f"shot_{timestamp}.png")
                img.save(filepath)
                pyperclip.copy(filepath)
                print(f"[{timestamp}] Saved: {filepath}")
        
        # Cleanup every hour
        if datetime.now() - last_cleanup > timedelta(hours=1):
            cleanup_old_files()
            last_cleanup = datetime.now()
        
        time.sleep(0.5)
    except KeyboardInterrupt:
        print("\nStopped.")
        break
    except:
        time.sleep(0.5)
  1. For auto-start on Windows login, save this as shotpath.vbs in your Startup folder (%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\):
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "pythonw """ & CreateObject("WScript.Shell").ExpandEnvironmentStrings("%USERPROFILE%") & "\shotpath_watch.py""", 0, False

Usage

  • Win+Shift+S → snip screenshot
  • Path is auto-copied to clipboard
  • Paste path into Claude Code
  • Files older than 24h are auto-deleted

Works around both the clipboard image detection bug and corporate security restrictions that block exe downloads.

titaniumshovel avatar Dec 23 '25 16:12 titaniumshovel