cold stack / coldcleaner
coldcleaner
Coding agents leave worktrees, scratch folders and evidence behind until the drive fills up. Coldcleaner reviews your disks every night, removes what is already safe on GitHub, and archives and verifies everything else before it deletes it.
- runs on
- Linux, macOS, Windows
- needs
- Python 3.14, tar, zstd
- licence
- MIT
- source
- TayHCode/coldcleaner ↗
Will it delete my drive?
Not by default.
Out of the box it only writes a report. It acts only on folders you list, and only after you switch that kind of cleanup on.
How it stays safeEvery rule holds on every run.
- dry run by defaultNothing is deleted, moved or pushed unless you pass
--applyand the tier is listed inlivein your rules file. The example rules ship withlive = []. - only what you listIt acts on paths in
rules.tomland nothing else. Big unknown folders show up in the report and are never touched. - worktrees need proofA Git worktree is removed only after a fresh GitHub check shows its head is pushed and either merged or the head of a closed PR. Dirty files, stashes, unpushed commits and open PRs keep it.
- copy before deleteAnything else it removes is archived first, and every file's SHA-256 is compared before the original is deleted. The archive must be an NFS or SMB share, or a separate mounted drive, never the disk being cleaned.
- restore
restore IDputs an archive back, or one file with--member, or somewhere else with--to. It refuses to overwrite an existing path. - unsure means keepIf a protection check cannot finish, the item stays.
Never touchedKept on every run, whatever the rules say.
- machinesVirtual machines, VM disks, containers, Docker volumes and services.
- cachesPackage caches such as pip, npm, uv and cargo.
- in useFiles a running process has open, and paths a scheduler names (cron, systemd, launchd, Task Scheduler).
- marked or recentFolders with a
.keep-localfile, and anything changed within its idle window. - GitHubRemote branches, repositories and anything else on GitHub. It never force-pushes and never creates repositories.
What it cleansOnly the tiers you switch on.
- worktreesGit worktrees under your configured roots, once proven safe on GitHub and idle. It runs
git worktree removeand deletes the local branch. Ignored files inside are archived first. - scratch and tempScratch, evidence, staging and temp folders you list under
archive, once idle. System temp folders must be idle at least 7 days. - a report, every runA timestamped Markdown report: disk use before and after, every action taken or proposed with its path, size and reason, what was skipped and why, and the 20 largest skipped items.
Quick startInstall, then a dry run. This changes nothing.
git clone https://github.com/TayHCode/coldcleaner
cd coldcleaner
uv tool install .
config="${XDG_CONFIG_HOME:-$HOME/.config}/coldcleaner"
mkdir -p "$config" && { [ -e "$config/rules.toml" ] || cp rules.example.toml "$config/rules.toml"; }
coldcleaner check-rules
coldcleaner reclaim --host local --report-dir "$config/reports"
uv fetches Python 3.14 if needed; pipx install . also works when Python 3.14 is present. The last command prints a report path. Read the report, list the folders you want cleaned in rules.toml, then add one tier to live, for example live = ["archive"], and run coldcleaner reclaim --apply. Worktree cleanup needs gh logged in.