Mac Cleanup for Developers
2026-05-132 turns5,851 charsgpt-5-5
Summary
The user wants to free up disk space on their Mac by cleaning up programming-related files like node packages and virtual environments.
Messages
I want to free up as much space on my mac as I can, help me do so, I do a lot of programing and have a lot of node packages and venv and other things just all over my computer, how can I clean it up
You can usually reclaim **tens to hundreds of GB** on a development machine by targeting a few specific areas:
- Node/npm/pnpm/yarn caches
- Old virtual environments (`venv`)
- Docker images/volumes
- Local LLM/model files
- Xcode/iOS simulator junk
- Python/pip caches
- VSCode extensions
- Downloads/Desktop archives
- Duplicate repos
- Old build artifacts
Since you do a lot of programming and local AI work, your biggest wins are probably:
1. package caches
2. unused repos/venvs
3. Docker
4. Ollama/model files
5. node_modules everywhere
---
# First: See What’s Actually Huge
Install a disk usage visualizer:
- urlGrandPerspectivehttps://grandperspectiv.sourceforge.net/
- urlDaisyDiskhttps://daisydiskapp.com/
These instantly show where the massive folders are.
Also run:
```bash
df -h
```
and:
```bash
sudo du -xh / | sort -rh | head -40
```
(Will take awhile but shows biggest directories.)
A safer/faster version:
```bash
du -sh ~/* 2>/dev/null | sort -hr
```
---
# Biggest Developer Cleanup Targets
## 1. Find Massive `node_modules`
This is usually the #1 offender.
Find them:
```bash
find ~ -name "node_modules" -type d -prune -exec du -sh {} + 2>/dev/null | sort -hr | head -50
```
Delete all `node_modules` from old projects:
```bash
find ~/Projects -name "node_modules" -type d -prune -exec rm -rf '{}' +
```
Or selectively remove old ones.
You can always restore with:
```bash
npm install
```
or
```bash
pnpm install
```
---
# 2. Clean npm/pnpm/yarn Caches
## npm
Check size:
```bash
du -sh ~/.npm
```
Clean:
```bash
npm cache clean --force
```
---
## pnpm
Check:
```bash
du -sh ~/Library/pnpm
```
Prune:
```bash
pnpm store prune
```
---
## yarn
```bash
yarn cache clean
```
---
# 3. Remove Old Python Virtual Environments
Find them:
```bash
find ~ -type d \( -name "venv" -o -name ".venv" \) -prune -exec du -sh {} + 2>/dev/null | sort -hr | head -50
```
Delete old ones:
```bash
rm -rf path/to/venv
```
You can recreate them later with:
```bash
python -m venv venv
```
---
# 4. Clean pip Cache
Check size:
```bash
du -sh ~/Library/Caches/pip
```
Clean:
```bash
pip cache purge
```
---
# 5. Docker Cleanup (Often HUGE)
Check Docker usage:
```bash
docker system df
```
Aggressive cleanup:
```bash
docker system prune -a --volumes
```
This can free **50GB+** easily.
Warning:
- removes stopped containers
- unused images
- build cache
- unused volumes
---
# 6. Ollama / Local LLM Models
You mentioned local models before — these are enormous.
Check:
```bash
du -sh ~/.ollama
```
List models:
```bash
ollama list
```
Remove unused models:
```bash
ollama rm modelname
```
Models like Qwen, DeepSeek, Llama, Mixtral, etc. can each be 5–70GB.
---
# 7. Clear Xcode Junk (If Installed)
This is infamous.
Check:
```bash
du -sh ~/Library/Developer/Xcode
```
Delete derived data:
```bash
rm -rf ~/Library/Developer/Xcode/DerivedData
```
Delete old simulators:
```bash
xcrun simctl delete unavailable
```
---
# 8. Homebrew Cleanup
```bash
brew cleanup -s
```
Remove old downloads:
```bash
rm -rf ~/Library/Caches/Homebrew
```
---
# 9. VSCode Extensions
Check:
```bash
du -sh ~/.vscode/extensions
```
Remove unused extensions inside:
- urlVisual Studio Code Marketplacehttps://marketplace.visualstudio.com/vscode
---
# 10. Downloads Folder
Often absurdly large.
Check:
```bash
du -sh ~/Downloads/*
```
Sort largest:
```bash
find ~/Downloads -type f -exec du -h {} + | sort -rh | head -50
```
---
# 11. Remove `.DS_Store` Files
Not huge, but cleans clutter:
```bash
find ~ -name ".DS_Store" -delete
```
---
# 12. Git Repo Cleanup
Large `.git` histories accumulate.
Find largest repos:
```bash
find ~/Projects -name ".git" -type d -prune -exec du -sh {} + 2>/dev/null | sort -hr | head -30
```
You may have:
- duplicated repos
- forks
- abandoned experiments
- cloned LLM repos
---
# 13. macOS Storage Management
Open:
```text
Apple Menu → About This Mac → Storage → Manage
```
Enable:
- Optimize Storage
- Empty Trash Automatically
- Review Files
---
# 14. Find the Largest Files on Entire Machine
This is extremely useful:
```bash
sudo find / -type f -size +1G 2>/dev/null
```
Or sorted:
```bash
sudo find / -type f -exec du -h {} + 2>/dev/null | sort -rh | head -100
```
---
# Safe “Big Win” Cleanup Sequence
If you want the fastest reclaim with minimal risk:
```bash
npm cache clean --force
pnpm store prune
yarn cache clean
pip cache purge
brew cleanup -s
docker system prune -a --volumes
```
Then manually remove:
- old `node_modules`
- old `venv`
- old Ollama models
- Downloads junk
---
# My Guess For Your Machine
Given your background with:
- Ollama
- local LLMs
- coding agents
- React/Django repos
- Docker experimentation
- hackathon projects
- cloned AI repos
You probably have:
- dozens of abandoned repos
- huge node_modules duplication
- multiple venvs
- multi-GB model files
- Docker image buildup
Those alone can easily exceed:
- 100GB
- sometimes 300GB+
---
# If You Want a More Advanced Setup
You could also reorganize your machine into:
```text
~/Projects
~/Archive
~/Models
~/Datasets
~/Temp
```
And keep:
- all repos centralized
- one global model directory
- archived inactive projects compressed
That makes future cleanup dramatically easier.
If you want, I can also help you:
- create an automated cleanup script
- safely identify deletable programming junk
- move giant folders to external storage
- deduplicate node_modules with pnpm
- set up better disk hygiene for development workflows
- audit your Mac step-by-step interactively without risking important files
gpt-5-5