Maintain development hardware performance, reclaim bloated disk space (Docker caches, node_modules), monitor CPU/RAM bottlenecks, and execute automated backups.
A developer workstation choked by bloated Docker images, thousands of orphan `node_modules` folders, forgotten build caches, and RAM leaks will suffer sluggish compile times and unexpected system crashes.
Master routine developer maintenance routines: `docker system prune -a`, `brew cleanup`, `ncdu` disk analysis, Time Machine / Restic automated backups, and CPU temperature monitoring.
Reclaim 50GB+ of wasted SSD storage by clearing Docker, Xcode, build caches, and orphaned dependencies.
Diagnose memory leaks and CPU thermal throttling using native Activity Monitor and `top/htop` tools.
Automate local and off-site backup protocols (3-2-1 backup strategy) for code and keys.
Maintain package manager hygiene with Homebrew, npm, and Docker volume management.
Free disk space and clear RAM enable maximum CPU compilation speed.
Automated 3-2-1 backups protect uncommitted code, SSH keys, and local DB dumps.
Proper thermal management prevents battery swelling and hardware degradation.
30 minutes before a major client demo, a developer’s local build failed with `No space left on device`. Running `docker system prune -af` freed 64GB of disk space in 10 seconds, saving the build.
Impact: Fixed the build error immediately and successfully delivered the client demo.
✗ Bad Approach
Restarting the computer repeatedly without checking active processes.
Why it failed: Doesn't identify the rogue process or background memory leak.
✓ Better Approach
Opening Terminal, running `htop` (or Activity Monitor), sorting by `%CPU`, and identifying an orphaned Node/Java process consuming 100% CPU.
Why it works: Allows targeted process termination (`kill -9 <PID>`) in 5 seconds.
Key Takeaway: System monitoring tools pinpoint exact process resource hogs instantly.
❯ Developer Disk Reclamation & Cache Cleanup
docker system prune -a --volumes --forcePurge all stopped containers, unused networks, images, and volumes.
$ docker system prune -afCan reclaim 30GB-100GB of wasted SSD storage.
npx npkillInteractive TUI to scan for and delete all node_modules folders in old projects.
$ npx npkillbrew cleanup -s && rm -rf $(brew --cache)Remove old formula downloads and cache files in Homebrew.
$ brew cleanup -srm -rf ~/Library/Caches/CoreSimulator/CachesClear bloated iOS Simulator caches on macOS Xcode.
$ rm -rf ~/Library/Caches/CoreSimulator/*pnpm store pruneRemove unreferenced package files from global pnpm content store.
$ pnpm store prunecargo cleanClear target build artifacts folder in Rust projects.
$ cargo cleanbrew autoremoveUninstall formula dependencies that are no longer needed by any package.
$ brew autoremovenpm cache clean --forceBlow away the entire npm cache; handy after corrupted installs.
$ npm cache clean --forceAlso run `yarn cache clean` and `pnpm store prune` after switching package managers.
rm -rf ~/Library/Developer/Xcode/DerivedDataDelete the bloated Xcode derived data folder on macOS.
$ rm -rf ~/Library/Developer/Xcode/DerivedDatapip cache purgeClear the Python pip cache of downloaded wheels.
$ pip cache purge❯ CPU, RAM & System Diagnostic Commands
htopInteractive process viewer sorting by CPU%, Memory%, and process tree.
$ htopkill -9 <PID>Force kill a hung background node/java process by Process ID.
$ kill -9 84920df -hDisplay disk space utilization across all mounted drives.
$ df -hlsof -i :3000Identify which process is holding a specific port (e.g., port 3000).
$ lsof -i :3000killall -9 nodeEmergency force kill for all orphaned background Node.js processes.
$ killall -9 nodeps aux --sort=-%cpu | head -n 15Snapshot the top 15 processes consuming the most CPU.
$ ps aux --sort=-%cpu | headtop -b -n 1 | head -n 20One-shot full system load snapshot without entering interactive mode.
$ top -b -n 1vm_statShow macOS virtual memory pressure and page-out statistics.
$ vm_statHigh "Pages swapped out" counts mean the system has been starved of RAM.
netstat -an | grep LISTENList every port your machine is currently listening on.
$ netstat -an | grep LISTENdu -h -d 1 ~ | sort -rh | head -n 10Find the biggest folders in your home directory to spot storage bloat.
$ du -h -d 1 ~ | sort -rh | head -n 10Pair with `ncdu ~` for an interactive walk-through of the same data.
pmset -g battCheck battery health, charge state, and power source on macOS.
$ pmset -g batt❯ Network & Connectivity Diagnostics
ping -c 4 8.8.8.8Verify network connectivity and measure packet loss and latency.
$ ping -c 4 8.8.8.8nslookup github.comResolve a domain to its IP and spot check DNS health.
$ nslookup api.github.comcurl -so /dev/null -w "%{http_code} %{time_total}s\n" https://api.github.comMeasure the HTTP status code and total response time of an endpoint.
$ curl -so /dev/null -w "%{http_code} %{time_total}s" https://github.comtraceroute -m 6 github.comShow every network hop and its latency between you and a host.
$ traceroute -m 6 github.comsudo lsof -i -P -n | grep LISTENList all listening ports with owning processes, numeric and unfiltered.
$ sudo lsof -i -P -n | grep LISTENRunning `docker system prune -a --volumes` to purge unused container layers, images, build caches, and volumes.
Can instantly free 30GB–100GB of storage on developer laptops.
Using tools like `npkill` or `ncdu` to scan directories and delete outdated `node_modules` folders across old projects.
Reclaims tens of thousands of unused small files that slow down file indexing.
3 total copies of data, across 2 different media types, with 1 copy stored off-site (e.g. encrypted cloud backblaze/AWS S3).
Guarantees total disaster recovery if your laptop is stolen or destroyed.
Prevents low disk space errors when compiling large C++/Java academic assignments on older laptops.
Prevents system crashes or slow build times during high-intensity 24-hour hackathon coding sessions.
Ensures company laptops run smoothly without requiring IT support intervention for basic disk bloat.
Optimizes Docker and local kubernetes clusters so microservices start up in seconds.
Protects remote work hardware against sudden disk corruption or hardware failure.
How to recover 30GB+ of space in under 3 minutes:
Clean developer disk bloat like a pro.
Commands to reclaim dozens of gigabytes of wasted SSD storage.
Never lose code or SSH keys again.
Protect local databases, custom configurations, and credentials.
Allowing SSD disk space to drop below 10% capacity
Keep at least 15–20% of your SSD storage free to maintain high read/write speeds and swap memory health.
SSDs degrade in performance significantly when near 100% capacity due to wear leveling overhead.
Set a 15-minute monthly calendar reminder to run `brew cleanup`, `docker system prune`, update OS security patches, and test backup restore validity.
Tip: Proactive maintenance prevents emergency crashes during critical release cycles.
Automated Dev Cleanup Shell Script
#!/usr/bin/env bash # Weekly Developer Machine Maintenance Script echo "🧹 Cleaning Homebrew..." brew cleanup -s brew autoremove echo "🐳 Pruning Docker Cache..." docker system prune -f echo "📦 Clearing Yarn/NPM Cache..." npm cache clean --force 2>/dev/null || true yarn cache clean 2>/dev/null || true echo "✅ System Cleanup Complete!"
Save as `~/bin/cleanup.sh` and run weekly to maintain high system performance.
Use terminal tools like `top` or `htop`, or macOS Activity Monitor, sorting processes by `%CPU` or `Memory` to identify and terminate (`kill -9`) rogue processes.
Proactive disk and system maintenance keeps compilation speeds fast and prevents system freezes.
Use dedicated cleanup tools to reclaim gigabytes of Docker and node_modules cache bloat.
Protect your work and keys with the 3-2-1 automated backup strategy.
SYSTEM OPS: STABILIZED
“A tuned machine is a quiet mind. Performance is maintenance.”