[BUG] Windows: Alt+V image paste takes ~2 s because it spawns Windows PowerShell 5.1 twice
What's Wrong?
On Windows, pasting an image with Alt+V takes about 2 seconds. Each paste starts powershell (Windows PowerShell 5.1) twice: once for Clipboard::ContainsImage(), then again for Clipboard::GetImage() and .Save(..., Png).
Almost all of that time is process startup and loading .NET Framework, not the image work. Timings on my machine, with a 544×680 image on the clipboard:
| Step | Time |
| --- | --- |
| powershell -NoProfile -Command "exit 0" | ~155 ms |
| checkImage command | ~210 ms |
| saveImage command | ~1,860 ms |
| The same Add-Type + GetImage + Save inside one running pwsh process | ~130 ms |
What Should Happen?
Image paste should feel instant, the way drag-and-drop does. Two ways to get there:
- Read the clipboard natively, with
OpenClipboardandGetClipboardDataon the registeredPNGformat, falling back toCF_DIBV5/CF_DIB. Browsers and Snipping Tool already put PNG bytes on the clipboard, so this needs no re-encoding. - At least run one PowerShell process instead of two, because
GetImage()returning$nullalready tells you there is no image.
Steps to Reproduce
- Copy an image in a browser or with Snipping Tool.
- Press Alt+V in Claude Code on Windows.
- Wait about 2 seconds for
[Image #1]to show.
Is this a regression?
I don't know.
Claude Code Version
2.1.296
Platform
Anthropic API
Operating System
Windows 11
Terminal/Shell
Windows Terminal, PowerShell 7
Additional Information
#15625 reported the same delay and was closed as not planned. #78395 and #83350 also involve the PowerShell clipboard path.