clean clipboard-images
Before you start
- [x] I searched existing issues and this is not a duplicate. 我已搜索过现有 issue。
What problem does this solve? 要解决什么问题?
Should clipboard images be grouped by session, and should a cleanup command be added?
What should Codewhale do? 希望 Codewhale 怎么做?
Same as above
Where? 在哪里?
TUI (terminal interface)
Workarounds or other tools (optional)
No response
Contributing
- [ ] I would like to open a pull request for this. 我愿意提交 PR。
Thanks for raising this. We are tracking it as an enhancement. Pasted images are written by clipboard.rs as flat clipboard-<nanos>.png files under the state directory, and nothing ever prunes them, so they grow without bound.
Any cleanup has to leave saved sessions intact, because transcripts reference these images by absolute path. A maintainer change would use Refs #7221, and age-only pruning that could break resuming an older session is off the table. Grouping files by session is a separate design question and is not implemented.
You do not need to do anything further. If it is easy, your OS and roughly how many files have accumulated would help us size the problem.
Thanks for raising this. We are tracking it as an enhancement. Pasted images are written by
clipboard.rsas flatclipboard-<nanos>.pngfiles under the state directory, and nothing ever prunes them, so they grow without bound.Any cleanup has to leave saved sessions intact, because transcripts reference these images by absolute path. A maintainer change would use
Refs #7221, and age-only pruning that could break resuming an older session is off the table. Grouping files by session is a separate design question and is not implemented.You do not need to do anything further. If it is easy, your OS and roughly how many files have accumulated would help us size the problem.
On Windows, I always use the QQ screenshot tool; over the past month or so, it has accumulated several hundred megabytes of data.
thank you @Asteria1028 - working on a solution!!
Thank you @Asteria1028 for opening this and for the Windows detail about how quickly QQ screenshot pastes add up. Commit c98ea3836e4 on main adds a cleanup command, codewhale sessions prune-images. By default it only lists pasted images that no saved session, checkpoint or history still references and that are older than a grace window (7 days; change it with --older-than-days). Add --apply to delete them. Sessions you can resume keep their images, and a file another process has open is skipped. This is on main but not in a published release yet (npm 0.10.2 does not include it), so we are leaving the issue open until 0.10.3 ships. Once it is out, please run the command on Windows (first without --apply, then with it) and tell us whether it brings the folder size down. Grouping new pastes by session is not part of this change.
Written by Claude Opus 5.5 for the Codewhale maintainers.
Thank you @Asteria1028 for reporting that pasted clipboard images pile up with no way to remove them, and for the Windows numbers. codewhale sessions prune-images shipped in v0.10.3 (c98ea3836e): it lists pasted images that no saved session still references and that are older than 7 days, and --apply deletes them. Upgrade with npm install -g [email protected] and run it while no Codewhale session is open. Grouping new pastes by session is not part of this change; please reopen if the command does not bring the folder size down on Windows.