Mopup › Guides › Old projects

How to find old coding projects taking up space on your Mac

Every project you've built keeps its dependencies and build output long after you stop working on it. On the Mac Mopup is made on, its Projects section turned up a lot of old projects, a few of them long forgotten, and cleaning them up freed more than 25 GB.

What old projects leave behind

Package managers and build tools fill each project with folders they can make again: installed packages, compiled output and caches. They stay when you move on, and a single one can run to several gigabytes. These are the usual ones, and how each comes back:

FolderWhat it isHow it comes back
node_modulesNode packagesInstall the project's packages again with npm, pnpm, Bun or Yarn.
.next, .nuxt, .svelte-kitNext.js, Nuxt and SvelteKit build outputThe next build or dev run.
targetRust or Maven build outputThe next cargo build or Maven build.
build, .gradleGradle build output and project cacheThe next Gradle build.
build, .dart_toolFlutter build output and Dart tool filesflutter pub get, or the next flutter run.
PodsCocoaPodspod install.
.buildSwift build outputThe next swift build.
.venv, venvPython environmentsOnly if you create it again and reinstall the packages.

Deleting them leaves your code and its git history as they are. A folder's name isn't proof, though: build is only Flutter's with a pubspec.yaml beside it, and target is only Rust's or Maven's next to a Cargo.toml or pom.xml. Check before you delete one with a common name.

Find the projects you've stopped working on

The date that matters is when you last changed a project's own files. Finder's Date Modified isn't it: a folder's date only changes when something directly inside it is added, removed or renamed. For a git repository, the last commit is a good guide. This lists the projects in ~/Projects by their last commit, oldest first, and changes nothing:

for d in ~/Projects/*/; do echo "$(git -C "$d" log -1 --format=%cs 2>/dev/null || echo none) $d"; done | sort

Projects that aren't git repositories show as none. Change ~/Projects to wherever you keep your code.

See how much each one holds

This lists the 20 biggest of those folders under ~/Projects, smallest first, and changes nothing:

find ~/Projects \( -name node_modules -o -name target -o -name .venv -o -name venv -o -name Pods -o -name .build -o -name .gradle -o -name .next \) -type d -prune -exec du -sh {} + 2>/dev/null | sort -h | tail -20

The sizes can mislead. pnpm and Bun don't copy packages into each project: they link or clone them from one shared store, so the same files show up in every project's node_modules, and Finder and du count them each time. Deleting one of those folders frees less than its size suggests.

Finished git worktrees

If you use git worktrees, for example for coding agents that each work in a checkout of their own, every finished one is a whole copy of the project, often with its own node_modules. List them from the main checkout, and remove one with git, which refuses if it holds uncommitted work and keeps its branch and commits:

git worktree list
git worktree remove ../my-app-feature

Before you delete

Mopup's Projects section on a demo developer Mac: finished git worktrees at 12.6 GB, then each project with when it last changed, such as orbit-engine, changed 4 months ago, with 7.8 GB to free, and android-wallet, changed 5 months ago. acme-web, changed yesterday, is left unselected. 13 items selected, 23.5 GB.

Related guides