Managing Local Storage in the AI Development Era
How to identify, clean, and monitor the hidden storage consumers that come with AI-assisted development tools like Claude Code and Kiro
Table of Contents
- The Problem
- Storage Breakdown: Where Does It Go?
- Finding the Storage Consumers
- Quick Audit Commands
- Package Manager Caches
- Docker Storage
- AI Tool Storage
- Cleaning Up
- Python Cleanup
- Node.js Cleanup
- Docker Cleanup
- Homebrew Cleanup
- IDE and Tool Caches
- Automation: The Cleanup Script
- Monitoring: Stay Ahead of the Problem
- Quick Status Alias
- Set Disk Space Alerts
- Key Takeaways
- Quick Reference
The Problem
You’re building with Claude Code, Kiro, and other AI-assisted development tools. Your projects are thriving. Then one day: “No space left on device.”
Where did 50GB go? AI-assisted development introduces hidden storage consumers that traditional developers never worried about:
- Package manager caches grow faster with AI suggesting more dependencies
- MCP servers download Python packages, models, and tools
- IDE and tool caches multiply across multiple AI assistants
- Logs and conversation history accumulate silently
This guide shows you exactly where your storage is going and how to manage it.
Storage Breakdown: Where Does It Go?
A typical AI-assisted development environment consumes storage across these categories:
| Category | Typical Size | Growth Rate |
|---|---|---|
| Python (uv/pip) | 5-20 GB | Fast |
| Node.js (npm/pnpm) | 2-10 GB | Medium |
| Docker | 10-50 GB | Fast |
| Homebrew | 5-15 GB | Slow |
| IDE Caches | 2-5 GB | Medium |
| AI Tool Data | 1-5 GB | Medium |
| Logs | 1-10 GB | Slow |
AI development accelerates this growth because:
- AI assistants suggest more packages to try
- MCP servers install their own dependencies
- Multiple Python environments for different agents
- Large ML/AI packages (numpy, torch, transformers)
Finding the Storage Consumers
Quick Audit Commands
# Overall disk usage
df -h
# Find large directories in home
du -sh ~/* 2>/dev/null | sort -hr | head -20
# Find hidden directories (caches live here)
du -sh ~/.* 2>/dev/null | sort -hr | head -20
Package Manager Caches
Python (uv):
# Check uv cache size
du -sh $(uv cache dir)
# See what's inside
ls -la $(uv cache dir)/wheels/ | head -20
Python (pip):
# Check pip cache
du -sh ~/.cache/pip
pip cache info
Node.js (npm):
# Check npm cache
du -sh ~/.npm
npm cache ls 2>/dev/null | wc -l
Node.js (pnpm):
# Check pnpm store
du -sh ~/.local/share/pnpm
Homebrew:
# Check Homebrew cache
du -sh $(brew --cache)
Docker Storage
# Docker disk usage summary
docker system df
# Detailed breakdown
docker system df -v
AI Tool Storage
Claude Code:
# Claude Code stores data in ~/.claude
du -sh ~/.claude
Kiro:
# Kiro configuration and cache
du -sh ~/.kiro 2>/dev/null
MCP Servers:
# MCP servers may create their own caches
# Check common locations
du -sh ~/.cache/mcp* 2>/dev/null
du -sh ~/Library/Caches/*mcp* 2>/dev/null
Cleaning Up
Python Cleanup
# uv - clean everything
uv cache clean
# uv - prune old entries only (safer)
uv cache prune
# pip - clean cache
pip cache purge
# Remove orphaned virtual environments
# First, list them:
find ~ -type d -name ".venv" -o -name "venv" 2>/dev/null
# Remove unused ones manually after review
Node.js Cleanup
# npm - clean cache
npm cache clean --force
# pnpm - clean store
pnpm store prune
# Remove orphaned node_modules (be careful!)
# First, find them:
find ~ -type d -name "node_modules" -prune 2>/dev/null | head -20
Docker Cleanup
# Remove unused containers, networks, images
docker system prune
# More aggressive - remove all unused images
docker system prune -a
# Remove build cache
docker builder prune
# Nuclear option - remove everything
docker system prune -a --volumes
Homebrew Cleanup
# Remove old versions
brew cleanup
# Remove all cached downloads
brew cleanup -s
# See what would be removed
brew cleanup -n
IDE and Tool Caches
VS Code:
# Clear VS Code cache (macOS)
du -sh ~/Library/Application\ Support/Code/Cache
rm -rf ~/Library/Application\ Support/Code/Cache/*
JetBrains IDEs:
# Check JetBrains caches (macOS)
du -sh ~/Library/Caches/JetBrains
Automation: The Cleanup Script
Create a script to run periodically:
#!/bin/bash
# cleanup-dev-storage.sh
echo "=== AI Dev Storage Cleanup ==="
echo ""
# Python
echo "Cleaning Python caches..."
uv cache prune 2>/dev/null || echo "uv not installed"
pip cache purge 2>/dev/null || echo "pip cache empty"
# Node.js
echo "Cleaning Node.js caches..."
npm cache clean --force 2>/dev/null
pnpm store prune 2>/dev/null || echo "pnpm not installed"
# Docker (conservative)
echo "Cleaning Docker..."
docker system prune -f 2>/dev/null || echo "Docker not running"
# Homebrew
echo "Cleaning Homebrew..."
brew cleanup -s 2>/dev/null || echo "Homebrew not installed"
echo ""
echo "=== Cleanup Complete ==="
Make it executable and run weekly:
chmod +x ~/scripts/cleanup-dev-storage.sh
# Add to crontab (weekly on Sunday at 2am)
# crontab -e
# 0 2 * * 0 ~/scripts/cleanup-dev-storage.sh >> ~/logs/cleanup.log 2>&1
Monitoring: Stay Ahead of the Problem
Quick Status Alias
Add to your ~/.zshrc or ~/.bashrc:
# Check dev storage status
alias dev-storage='echo "=== Dev Storage ===" && \
echo "uv: $(du -sh $(uv cache dir) 2>/dev/null | cut -f1)" && \
echo "npm: $(du -sh ~/.npm 2>/dev/null | cut -f1)" && \
echo "Docker: $(docker system df 2>/dev/null | grep "Images" | awk "{print \$4}")" && \
echo "Homebrew: $(du -sh $(brew --cache) 2>/dev/null | cut -f1)"'
Set Disk Space Alerts
Create a simple monitor script:
#!/bin/bash
# check-disk-space.sh
THRESHOLD=85
USAGE=$(df -h / | awk 'NR==2 {print $5}' | sed 's/%//')
if [ "$USAGE" -gt "$THRESHOLD" ]; then
echo "WARNING: Disk usage at ${USAGE}%"
echo "Run: cleanup-dev-storage.sh"
# Optional: send notification
# osascript -e 'display notification "Disk space low!" with title "Storage Alert"'
fi
Key Takeaways
-
Know your storage consumers: AI development tools add layers of caching you might not expect. Python packages for MCP servers, conversation logs, and model caches add up fast.
-
Schedule regular cleanups: Don’t wait for “disk full” errors. Run cleanup commands weekly or set up automation.
-
AI tools require storage discipline: The convenience of AI-assisted development comes with a hidden cost. New tools need new habits - add storage monitoring to your workflow.
Quick Reference
| What | Check Size | Clean |
|---|---|---|
| uv cache | du -sh $(uv cache dir) | uv cache prune |
| pip cache | pip cache info | pip cache purge |
| npm cache | du -sh ~/.npm | npm cache clean --force |
| Docker | docker system df | docker system prune |
| Homebrew | du -sh $(brew --cache) | brew cleanup -s |
Have questions? Connect with me on LinkedIn or check out more posts on agiusalexandre.com.
Related Posts
Building ReachyArchi: A Voice-Driven Robotic AWS Solutions Architect
How we combined a Reachy humanoid robot with Amazon Bedrock Nova Sonic to create an AI-powered Solutions Architect for AWS Summits
DevelopmentBrowser Automation Agents - Amazon Bedrock AgentCore
Enterprise workflows often require interacting with web applications that lack APIs. Traditional automation scripts are brittle and break when UIs change.
DevelopmentAWS Backup Cost Analysis
EBS snapshot costs were growing month-over-month with no clear explanation or optimization strategy.
