PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

CmdPal shows Gigabytes of "writes" even when not used

Open ptnik opened this issue 1 week ago • 6 comments

Microsoft PowerToys version and release channel

0.102.3101 - Stable

Installation method

PowerToys auto-update

Area(s) with issue?

Command Palette

Steps to reproduce

CmdPal is showing over 7 GB of "data writes" even when idle (not used) on a PC that has been running for a few days:

Any reason CmdPal should be writing so much data? It was up 7.7GB on Nov 19th, 3 days later is up to 11.4 GB.

I understand it might not be actual writes to SSD, but being on top 3 processes on I/O writes, above some heavy browser usage, seems a bit off.

P.S. Noticed it while checking if Nvidia driver was writing too much to SSD...

✔️ Expected Behavior

Not writing gigabytes of data, particularly when unused.

❌ Actual Behavior

No response

Upload Bug Report ZIP-file

PowerToysReport_2026-11-22-13-19-42.zip

Additional Information

No response

Other Software

No response

ptnik avatar Nov 22 '26 13:11 ptnik

Hi @ptnik, thank you for reporting this.

Any chance you're running some UI automation, or perhaps a ~smart toaster~ AI agent with computer use enabled? Those seem to be pretty chatty, and I've managed to catch Codex Computer Use red-handed, triggering excessive I/O through the UI automation pipe.

jiripolasek avatar Nov 22 '26 14:11 jiripolasek

No, no automations running. Just an updated Windows 11 and not that many extra stuff installed (Chrome, Brave, Steam with a couple minor games). No strange unknown processes running either (as far as I can tell).

ptnik avatar Nov 22 '26 16:11 ptnik

Hi @jiripolasek and @ptnik, I dug through the CmdPal code on main and checked the bug report zip.

The zip rules out log spam and third-party extensions: CmdPal\Logs\0.102.3101.0\Log_2026-11-14.log is only 10.5 KB over 8 days and only built-in providers loaded at startup.

Looking at the code, ClipboardHistoryListPage.cs stands out after commit 0c35241bcf, CmdPal: Fix clipboard history details image previews #50098. ClipboardHistoryCommandsProvider gets constructed at startup even when CmdPal starts hidden and subscribes to Clipboard.HistoryChanged right away. On every copy event, TrackClipboardHistoryChanged_EventHandler runs LoadClipboardHistoryInSTA and calls GetBitmapAsync and CacheImageAsync for every bitmap entry in clipboard history, opening %TEMP%\PowerToys\CmdPal\ClipboardHistory\<sha256>.png with FileMode.Create without checking if it's already cached. Even plain-text copies rewrite every cached screenshot, which adds up fast if you keep a few screenshots in history.

I don't have Command Palette installed here to verify live, so @ptnik, if clipboard history is on, do the .png timestamps inside %LOCALAPPDATA%\Packages\Microsoft.CommandPalette_8wekyb3d8bbwe\LocalCache\Local\Temp\PowerToys\CmdPal\ClipboardHistory bump when you copy plain text while CmdPal stays in the background? @jiripolasek, if that lines up, I'd be glad to send a PR that holds off background loading in TrackClipboardHistoryChanged_EventHandler until the page is actually opened, just marking dirty and calling RaiseItemsChanged, and checks the cached <sha256>.png path from item.Item.Id before calling GetBitmapAsync or FileMode.Create.

Agodoy31 avatar Nov 24 '26 05:11 Agodoy31

I couldn't find any files in CmdPal cache folders, but indeed I do use quite heavily the copy-paste of images and text throughout the day. I'll be waiting for the updated version to see if the fix has fixed it.

ptnik avatar Nov 24 '26 12:11 ptnik

My bad on the folder path earlier @ptnik. Those cached images actually land in regular %TEMP%\PowerToys\CmdPal\ClipboardHistory instead of LocalCache, and CmdPal deletes them once they roll off the 25-item clipboard history, which explains why yours looked empty.

I built CmdPal from main just now and ran it hidden in the background without ever opening it. With four 1080p screenshots sitting in Windows Clipboard History at roughly 8 MB each, copying three short plain-text strings triggered about 33 MB of disk writes on every copy, almost 100 MB total, and bumped the timestamps on all four .png files every time. @jiripolasek, that confirms it's coming from 0c35241bcf, so let me know if you want me to go ahead and open a PR.

Agodoy31 avatar Nov 24 '26 16:11 Agodoy31

@Agodoy31 Yep, I know. That part of the code is going away with extreme prejudice.

jiripolasek avatar Nov 24 '26 17:11 jiripolasek