Speed up your Mac
How to Speed Up Your Mac for Coding
Xcode, VS Code, Docker, and node_modules slowing your Mac to a crawl? Here's a developer-focused tune-up that reclaims tens of GB and real speed.
You SSH into a server, run git status locally, and Spotlight starts indexing your node_modules. Xcode is consuming 40 GB of DerivedData. Docker volumes have eaten another 60. VS Code helpers are using more RAM than the OS. Sound familiar? Developer Macs accumulate cruft faster than any other workflow because every tool keeps its own multi-gigabyte cache.
Here’s the cleanup pass that reclaims serious disk and serious speed.
Xcode is the biggest offender
If you have Xcode installed, it’s almost certainly the largest single consumer of your disk. Three folders to know:
DerivedData (~/Library/Developer/Xcode/DerivedData/)
Build artifacts for every project you’ve ever built. Safe to delete entirely — Xcode rebuilds what it needs on next build. On a working machine this can hit 50-100 GB.
Archives (~/Library/Developer/Xcode/Archives/)
Every release build you’ve ever made for the App Store. Keep recent ones if you might need to symbolicate crashes. Delete the rest.
iOS Device Support / DeviceSupport (~/Library/Developer/Xcode/iOS DeviceSupport/)
Symbol files for every iOS version you’ve ever connected. Often 30+ GB. You only need the versions of iOS you currently support.
Simulators (~/Library/Developer/CoreSimulator/Devices/)
Old simulator images for iOS versions you no longer test against. Run xcrun simctl delete unavailable to clean up automatically.
Sweep finds and groups all of these in a single scan, with size next to each so you can decide what stays.
Skip the manual huntSweep finds the cache and cruft slowing down your workflow. Try Sweep free →
Clean Docker properly
Docker on a Mac runs through a Linux VM, and that VM has a fixed virtual disk that grows but doesn’t shrink automatically. Old images, dangling containers, and unused volumes can easily eat 50+ GB.
docker system prune -a --volumes
This removes all stopped containers, unused networks, dangling images, and unused volumes. Read the prompt before confirming — it’s aggressive.
If your Docker.raw file (~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw) is still huge after pruning, Docker Desktop has a “Clean / Purge data” option in Preferences > Resources that actually shrinks the underlying disk image.
node_modules and JavaScript caches
A typical Node project’s node_modules is 200-500 MB. Across 30 projects in your Development folder, that’s 10+ GB of dependencies, most of which are duplicated.
Strategies:
- Use
pnpminstead ofnpmoryarn— its content-addressable store deduplicates dependencies across projects - Delete
node_modulesfrom projects you haven’t touched in 6+ months. They reinstall in a minute when you come back. - Clear caches:
npm cache clean --force,yarn cache clean,pnpm store prune
A nice command to see the biggest culprits:
find ~/Development -name "node_modules" -type d -prune -exec du -sh {} \;
Sweep does the same scan with a GUI and one-click delete.
Python virtual environments and pip caches
Every venv carries 50-200 MB of dependencies. Across data science projects with TensorFlow or PyTorch, multiply that by 5-10x.
- Delete venv folders from old projects (
rm -rf .venvorrm -rf venv) - Clear pip cache:
pip cache purge - Conda environments:
conda clean --all
If you use uv, its global cache lives in ~/.cache/uv/ and can be cleared with uv cache clean.
VS Code and JetBrains caches
VS Code stores extensions, workspace data, and its own cache in:
~/.vscode/extensions/(extensions)~/Library/Application Support/Code/Cache/~/Library/Application Support/Code/CachedData/~/Library/Application Support/Code/User/workspaceStorage/
The workspaceStorage folder accumulates entries for every folder you’ve ever opened. Clear out folders for projects you’ve deleted.
JetBrains IDEs (IntelliJ, WebStorm, PyCharm, GoLand) keep caches in ~/Library/Caches/JetBrains/. Each IDE version creates its own folder. After major updates, old folders stick around — delete them.
Homebrew cleanup
Homebrew downloads installers and keeps them around. After a year of installs and updates, the cache and old versions can run several GB.
brew cleanup -s
brew autoremove
-s clears the download cache as well. autoremove removes unused dependencies.
Free RAM before heavy builds
Big iOS builds, Rust compilation, or running Kubernetes locally are RAM-hungry. Before kicking one off:
- Quit browsers (especially Chrome — it’s a memory black hole)
- Quit Slack, Discord, and Spotify
- Run Sweep’s speed boost to free inactive memory
- Start the build
Activity Monitor’s Memory Pressure should be solid green when you start. If you’re already in yellow before the build, you’ll page to swap mid-compile and lose minutes.
Free up RAM in one clickSweep frees inactive memory and pauses runaway processes. Get Sweep free →
Spotlight: exclude development folders
Spotlight indexing your entire ~/Development/ folder is pointless and slow. It tries to index every file in every node_modules and every git pack file you’ve never read.
Exclude it:
System Settings > Siri & Spotlight > Spotlight Privacy- Click
+, add your Development folder, build folders, anything containing node_modules
This both speeds up Spotlight and stops mds_stores from spiking CPU every time you npm install.
Disable unnecessary login items
Run a quick audit of what starts when you log in:
System Settings > General > Login Items- Remove anything you don’t use daily — old auto-launchers from apps you’ve uninstalled often hang around
Common culprits on developer Macs: Docker Desktop, Slack, Postman, ngrok, dropbox helpers, the Adobe daemon (even if you don’t use Adobe apps anymore).
Dock and Finder window count
This sounds trivial but it’s not: Finder windows showing folders with thousands of files (like node_modules) can lock up the Finder and freeze related apps that use NSOpenPanel. Close Finder windows on big project folders before they become a problem.
Same with Terminal tabs left open in huge directories — ls against a 50,000-file folder is slow.
Shut down old VMs and devcontainers
Parallels, VMware Fusion, UTM, and Lima all keep VMs running in the background if you don’t shut them down properly. They reserve RAM and CPU even idle.
- Shut down VMs cleanly when finished, don’t just close the window
- For devcontainers / Lima:
limactl stop <vm>when not in use
Update macOS, Xcode, and your IDE
Apple ships meaningful Xcode performance fixes in nearly every minor release. Same for VS Code and JetBrains. Old versions of Xcode on a new macOS will absolutely feel slower than current.
- macOS:
System Settings > General > Software Update - Xcode: App Store > Updates
- VS Code: Code menu > Check for Updates
- JetBrains: Toolbox app handles them all
A weekly developer Mac maintenance pass
Once a week, run through this:
- Clear Xcode DerivedData (or let Sweep do it)
docker system prune -a --volumes- Delete node_modules from 6-month-old projects
brew cleanup -s- Empty downloads folder
- Reboot if uptime is over a week
The Mac stays fast. Builds that took eight minutes start finishing in five. The whole machine breathes.