cleanup-scan
Last verified: 2026-04-17
What it is
A single-file Python script that walks a macOS home directory and reports where disk space is going. It prints a report; it never deletes anything.
Source: apps/macos-utils/cleanup-scan.py.
Run it
python3 apps/macos-utils/cleanup-scan.py
No dependencies beyond the stdlib. Colors are auto-disabled when stdout is not a TTY.
What it scans
- System and user caches (
~/Library/Caches,/Library/Caches) - Homebrew cache
- npm / yarn / pnpm stores
- pip caches and wheel cache
- Docker images, containers, volumes, build cache
- Xcode DerivedData, CoreSimulator devices, archives
- Downloads older than 30 days
- Trash
- Log files
- 20 largest files under
$HOME(skipping.git,node_modules,.venv,Library, etc.) node_modulesdirectories- Python virtualenvs (
.venv,venv) ~/Library/Application Supportsubdirs
Each section shows reclaimable size and the command you would run to clear it — but running that command is left to you.
Safety
cleanup-scan.py has no delete path. It calculates sizes via os.walk
and os.path.getsize; shutil is only used for shutil.which. External
tools (docker system df, brew --cache) are invoked in read-only mode.
Re-running it is free.