npkill alternatives: cleaning node_modules and build folders

Five tools that clean node_modules and other build folders, what each one checks before it deletes, and why an age filter frees less than you'd think.

6 min read · Updated October 9, 2026

At a glance

ToolPriceBest for
kondoFree, open source24 project types and an age filter, on any OS
MoleFree, open sourceBuild folders plus whole-Mac cleanup from one CLI
CleanMyMac CLIPublic beta, proprietaryBuild folders and developer caches, from MacPaw
DevbroomFree; Pro $29 onceBuild folders where coding agents work, checked before they move
DevCleaner for XcodeFree, optional tipsThe Xcode side: DerivedData, Archives, Device Support

npkill is the tool most JavaScript developers try first. You run npx npkill, it lists every node_modules under the current folder with its size and last change, and you delete the ones you pick. It's free, MIT licensed and works on any OS. People look for alternatives when they want one of three things npkill doesn't do in its current release: other project types, a check on what's still in use, or a way back.

npkill's latest release is 0.12.2, from June 2024. It matches one folder name, node_modules by default or another with --target, and deletes with rm -rf. Profiles for Python, Java and other ecosystems, and JSON output, are on its main branch but not released yet.

Age is a weaker signal than it looks

Several tools use age to decide what to offer. kondo has --older 3M. Mole's purge and CleanMyMac CLI's purge leave folders from the last 7 days unselected. That protects work in progress, and it's a sensible default.

The measurement above shows its limit. On one developer's Mac almost all of the space sat in projects changed that week. An age filter offered 0.4 GB and left 21 GB alone. Those big folders were safe to rebuild in most cases, but only if nothing was running from them: a dev server, a test watcher, or a coding agent session working in the project. That's a different check from age.

kondo: more project types

kondo knows 24 project types: Node, Cargo, Gradle, Maven, Python, Swift, Unity, Unreal Engine, Godot, Elixir, Zig, .NET and more. It shows each project's type, age and size, asks, and deletes permanently. Its README calls it "essentially rm -rf with a prompt". It has a dry run and runs on macOS, Linux and Windows. If your projects span engines and languages, kondo covers more of them than anything else here. Our comparison: Devbroom vs kondo.

Mole: build folders and the rest of the Mac

Mole is a free command-line Mac cleaner, GPL licensed, with a very active repository. mo purge finds node_modules, target, .build, build and dist. Folders with file activity in the last 7 days start unselected, and folders with nested git repositories or git-tracked files are protected. mo clean also covers caches including npm and pnpm. Purged items are deleted permanently once you confirm, and every destructive command has --dry-run. Pick Mole if you want one free terminal tool for the whole Mac.

CleanMyMac CLI: MacPaw's take

CleanMyMac CLI went into public beta in July 2026. Its purge covers node_modules, .next, .turbo, target, .venv, Pods, DerivedData, vendor and more, preselecting items older than 7 days. clean dev handles caches from Homebrew and npm to Gradle and Docker. It's proprietary; MacPaw doesn't say what it will cost after the beta. Its docs don't say whether cleaned items go to the Trash.

Devbroom: build folders where agents work

Devbroom finds node_modules, .next, .turbo, target, .venv, __pycache__, DerivedData, dist, build and vendor, and you can add your own in .devbroom.toml (Getting started). It doesn't decide by name or age. A node_modules is Ready only with a package.json beside it, ignored by git, with no tracked files inside. If an agent session, a process or an open file uses the folder, it's Blocked until that ends. The full list is in Rules, and Verdicts explains Ready, Review and Blocked.

Cleaning moves folders to the Trash, and Put back returns them. The devbroom command shows the same verdicts in a terminal, and coding agents can ask Devbroom about a folder before deleting it through MCP. Pro adds rules like "build folders older than 90 days" that run on a schedule. Devbroom is Mac only.

When npkill is still the right tool

If you're on Linux or Windows, or you know a project is finished and just want its node_modules gone in ten seconds, npx npkill is hard to beat: nothing to install, nothing to configure. The same goes for kondo on mixed-language machines. The tools that check more earn their keep on a Mac where something might still be using the folder. The head-to-head is Devbroom vs npkill.

Prices and facts checked on October 9, 2026. Every tool named here is a trademark of its owner; Devbroom isn't affiliated with any of them.

More alternatives