← All projects
Project record1 mention
Originally shared on Hacker News

Dev-prune

Dev-prune (devp) is a disk cleaner that only deletes dependency and build directories it can verify are rebuildable: it removes files only when the lockfile matches the manifest and the package manager can rebuild them, and it can restore exactly what a previous run deleted using each project's own package manager.

Last shared
01 / The problem

What it addresses

Existing cleanup tools like npkill delete dev caches fine, but none could tell whether the deleted thing would come back; dev-prune checks first and only deletes what it can rebuild.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Dev-prune

    Dev-prune (devp) is a disk cleaner that only deletes dependency and build directories it can verify are rebuildable: it removes files only when the lockfile matches the manifest and the package manager can rebuild them, and it can restore exactly what a previous run deleted using each project's own package manager.

    Problem: Existing cleanup tools like npkill delete dev caches fine, but none could tell whether the deleted thing would come back; dev-prune checks first and only deletes what it can rebuild.

    Posted by @VKrishna04 · Original source ↗

    Story title · @VKrishna04 · · Source ↗

    Show HN: Dev-prune, a disk cleaner that only deletes what it can rebuild

    Submitted URL · @VKrishna04 · · Source ↗

    https://github.com/Life-Experimentalist/dev-prune

    Source text · @VKrishna04 · · Source ↗

    Tools like npkill delete them fine, but none could tell me whether the thing would come back.

    Source text · @VKrishna04 · · Source ↗

    It only removes a dependency or build directory in an idle repo if the lockfile matches the manifest and the package manager can rebuild it. If the lockfile is out of sync it frees 0 bytes and says why.

    Source text · @VKrishna04 · · Source ↗

    devp restore --last-run rebuilds exactly what the last pass deleted, in every repo it touched, with each project’s own package manager (npm ci, pnpm install --frozen-lockfile, uv sync and so on).

    Source text · @VKrishna04 · · Source ↗

    It also never crosses .git, refuses symlinks, and writes its state atomically.