cleanup-cache
From davila7
Clean system caches (npm, Homebrew, Yarn, browsers, Python/ML) to free disk space
Install
/cleanup-cacheFacts
- Repository
- davila7/claude-code-templates
- Status
- Actively maintained
- Last commit
- Declared tools
- Bash(df:*), Bash(du:*), Bash(npm cache clean:*), Bash(brew c
- Source file
- .claude/commands/cleanup-cache.md
Source preview
The instructions Claude Code reads when this command runs.
# System Cache Cleanup
Clean temporary files and caches to free disk space: $ARGUMENTS
## Current Disk Usage
- **Disk space**: !`df -h / | tail -1`
- **npm cache**: !`du -sh ~/.npm 2>/dev/null || echo "Not found"`
- **Yarn cache**: !`du -sh ~/Library/Caches/Yarn 2>/dev/null || echo "Not found"`
- **Homebrew cache**: !`brew cleanup -n 2>/dev/null | head -5 || echo "Homebrew not installed"`
## Cleanup Options
Based on the arguments provided, execute the appropriate cleanup level:
### Option 1: Conservative Cleanup (default)
Safe cleanup of package manager caches that can be easily rebuilt:
```bash
# Record starting disk space
echo "Starting cleanup..."
df -h / | tail -1 | awk '{print "Before: " $4 " free"}'
# Clean npm cache
echo "Cleaning npm cache..."
npm cache clean --force
# Clean Homebrew
echo "Cleaning Homebrew..."
brew cleanup
# Clean Yarn cache
echo "Cleaning Yarn cache..."
rm -rf ~/Library/Caches/Yarn
# Show results
df -h / | tail -1 | awk '{print "After: " $4 " free"}'
```
### Option 2: Aggressive Cleanup (--aggressive flag)
Includes all conservative cleanup plus browser and development tool caches:
```bash
# Run conservative cleanup first (from Option 1)
npm cache clean --force
brew cleanup
rm -rf ~/Library/Caches/Yarn
# Clean browser caches
echo "Cleaning browser caches..."
rm -rf ~/Library/Caches/Google
rm -rf ~/Library/Caches/com.operasoftware.Opera
View full source on GitHub →Other slash commands
feature-development
★ 229,918Workflow command scaffold for feature-development in everything-claude-code.
affaan-mupdated 14d agoMITdatabase-migration
★ 229,918Workflow command scaffold for database-migration in everything-claude-code.
affaan-mupdated 14d agoMITadd-language-rules
★ 229,918Workflow command scaffold for add-language-rules in everything-claude-code.
affaan-mupdated 14d agoMITcommit-push-pr
★ 137,934Commit, push, and open a PR
anthropicsupdated 13d agodedupe
★ 137,934Find duplicate GitHub issues
anthropicsupdated 13d agotriage-issue
★ 137,934Triage GitHub issues by analyzing and applying labels
anthropicsupdated 13d ago