Skip to main content

remove stale dev cache directories

Project description

cull

I ran WinDirStat one afternoon because my SSD was at 94% and found 74 GB of node_modules from projects I hadn't touched in over a year. Deleting them by hand is tedious. This does it for you.

devcull TUI demo

$ cull ~/projects
found 23 stale cache dirs totaling 61.3 GB

#    path                                        size      last commit
1    ~/projects/old-saas/node_modules           18.2 GB   14mo ago
2    ~/projects/prototype-v2/node_modules        9.4 GB   11mo ago
3    ~/projects/prototype-v2/.next               2.1 GB   11mo ago
...

> a
delete 23 dir(s) (61.3 GB)? [y/N]: y
freed 61.3 GB

install

pip install devcull

usage

cull [PATH]                  scan PATH (default: current dir)
  --older-than DAYS          only show caches untouched for N days (default: 90)
  --min-size MB              skip caches smaller than N megabytes
  --delete                   interactively pick what to remove
  --all                      delete everything found without asking
  --dry-run                  show what would go, don't touch anything
  --report FILE              write findings to a JSON file

.cullignore

Drop a .cullignore file in your projects root to protect specific directories:

# keep this one — it's a monorepo with shared deps
my-shared-lib/node_modules

# ignore all .venv dirs
.venv

Patterns match against the directory name or its path relative to the scan root.

what it looks for

  • node_modules, .next, .nuxt, .svelte-kit, .parcel-cache, .turbo
  • .venv, venv, .virtualenv, .tox
  • __pycache__, .pytest_cache, .mypy_cache, .ruff_cache
  • dist, build, out (inside project directories)
  • .gradle, .angular, .sass-cache
  • target (only inside Rust or Maven projects)

what it won't do

It won't scan for "large files" generically. It won't suggest you delete your Downloads folder or anything outside the above list. The whole point is that it only removes things you can safely recreate by running npm install or pip install again.

It also won't run automatically or add itself to your startup. You run it when you want to run it.

"last commit" column

cull tries to find the last git commit in the parent project. If there's no git repo, it falls back to the directory's modification time. The commit date is more reliable — copying files around updates mtime but doesn't change when you actually worked on the project.

license

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devcull-0.3.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devcull-0.3.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file devcull-0.3.0.tar.gz.

File metadata

  • Download URL: devcull-0.3.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for devcull-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7a82fd4d370f45c150e1117311659c853bbc0469cc753cdc77ce2c7ea6897491
MD5 1008747fbd84df1800a97a694f2891c7
BLAKE2b-256 beced998c8768875a307a9ed91508716c4227a9533cc80a73e384838827238ce

See more details on using hashes here.

File details

Details for the file devcull-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: devcull-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for devcull-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51a73db0ca0ae63aae6c5cceb5d0719430cc8c25a006e8e3e399f4a2049dc72f
MD5 29a59130a6fa32a10c061d417d23e186
BLAKE2b-256 7ac11d5d1c3833ddb59867105e62b6e330b65031bbcdb524266f07f6f6a1c766

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page