Skip to main content
The Toolkit disk cleaner recursively scans your project tree for node_modules, .venv, venv, env, and conda directories — the heavyweight dependency folders that accumulate across months of development and can consume tens of gigabytes. It calculates exactly how much space you would recover, surfaces orphaned environments without a matching project manifest, and purges everything in a single command.

toolkit clean scan [targetPath]

Recursively walk a directory tree and report every node_modules and Python virtual-environment folder found. For each directory, Toolkit shows its path, type, size, last-modified date, and whether it appears to be an orphan. At the end you get a total recoverable-size summary broken down by type. The default scan depth is 5 levels. Increase it with --depth if your project tree is deeply nested.
Example terminal output:

toolkit clean purge [targetPath]

Permanently delete the dependency folders discovered during a scan. Purge accepts the same [targetPath] argument and --depth behaviour as scan. Always confirm you know what will be deleted before running a destructive purge.
Always run --dry-run first. Use toolkit clean purge --dry-run to see exactly which directories will be removed and how much space you will recover before committing to deletion. This is especially useful in CI or on shared machines.
Purge is permanent. Deleted node_modules and virtual-environment folders cannot be recovered from the trash. You can recreate them with npm install or pip install -r requirements.txt, but the operation itself is irreversible. Always preview with --dry-run before purging.

Orphan Detection

During a scan, Toolkit checks each discovered environment for a corresponding project manifest in its parent directory:
  • Node.js — looks for package.json
  • Python — looks for pyproject.toml or requirements.txt
If no manifest is found, the environment is flagged as an orphan (isOrphan: true). Orphans are safe cleanup candidates — they belong to projects that have been moved, deleted, or archived — and they are highlighted in both the scan output and the JSON report.

--json Output

The CleanOperationResult shape returned per directory by toolkit clean purge --json: