Clearing node_modules and other developer caches safely
Developer tools are some of the biggest space users on a computer. Most of what they store can be rebuilt or downloaded again; the trick is knowing which is which.
Rebuilt from your project
- node_modules next to a package.json:
npm install(ornpm ci,pnpm install,yarn) recreates it from the lock file. Old projects you rarely open are the best candidates. - Rust's target folder next to a Cargo.toml:
cargo cleanremoves it andcargo buildrecreates it. - Web build caches such as .next, .nuxt, .turbo, .parcel-cache and .svelte-kit: rebuilt on the next build.
- Python caches (__pycache__, .pytest_cache, .mypy_cache): recreated automatically.
- Unity's Library folder and Unreal Engine's DerivedDataCache and Intermediate folders: the editor rebuilds them, which can take a while the next time you open the project.
A Python virtual environment (.venv) can be recreated too, but only if the project lists its requirements. Check for a requirements or lock file first.
Downloaded again when needed
- Package caches for npm, pip, Yarn, Gradle, Maven, NuGet and Cargo.
- Xcode's DerivedData and iOS DeviceSupport folders.
- Android emulator system images, which Android Studio's SDK Manager can download again.
Use the tool's own clean-up
- Docker: its data lives in one large disk image. Moving files will not help; use
docker system pruneor Docker Desktop's own settings. - iOS simulators: remove unused ones in Xcode (Window > Devices and Simulators) or with
xcrun simctl delete unavailable. - Android virtual devices: remove them in Android Studio's Device Manager so its list stays correct.
Keep unless you are sure
- Xcode archives: needed to investigate crash reports from app versions you have shipped.
- Downloaded AI models (Ollama, LM Studio, Hugging Face): large and re-downloadable, but only remove the ones you no longer use.
How Tessera helps
Tessera's Smart Scan only suggests a folder when there is evidence for it: node_modules counts only with a package.json beside it, a target folder only with a Cargo.toml, a Unity cache only inside a real Unity project. Each suggestion says why it was flagged and how it comes back, and app-managed data such as Docker's points you to the right tool instead.