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
| Tool | Price | Best for |
|---|---|---|
| kondo | Free, open source | 24 project types and an age filter, on any OS |
| Mole | Free, open source | Build folders plus whole-Mac cleanup from one CLI |
| CleanMyMac CLI | Public beta, proprietary | Build folders and developer caches, from MacPaw |
| Devbroom | Free; Pro $29 once | Build folders where coding agents work, checked before they move |
| DevCleaner for Xcode | Free, optional tips | The 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.
Related
- All the tools for developer disk space, grouped by job: The best Mac disk cleaners for developers.
- Doing it by hand, safely: How to find and clean node_modules and build folders on a Mac.
- What agents keep besides build folders: How to free up disk space taken by Claude Code.
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
- Mac cleaners that need no accountWhich cleaners ask you to sign in and which don't, exactly what Devbroom sends and when, and a one-line command to see what any app connects to.
- DaisyDisk alternatives: when a disk map isn't enoughFree disk maps that do what DaisyDisk does, and tools that go a step further for developers: a verdict on each folder, and the Trash instead of permanent delete.
- Mac cleaners without a subscriptionThree years of each cleaner, worked out from its own price list, and what one-time licenses do and don't include.
- The best Mac disk cleaners for developers in 2026Ten tools, grouped by the job they do, with prices, how each one deletes, and which to pick for the space you actually need back.
- CleanMyMac alternatives for developers in 2026What a developer's Mac fills up with, and which tool sees it: disk maps, build folder cleaners, Xcode tools and cleaners made for coding agents.