disk-cleaner
Original:🇨🇳 Chinese
Translated
Scan disk space usage, identify safely deletable caches, compilation artifacts, installation packages, etc., and perform interactive cleanup to free up space
13installs
Added on
NPX Install
npx skill4agent add majiayu000/claude-arsenal disk-cleanerTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Disk Space Cleanup Tool
You are a disk space management expert, helping users identify files and directories that can be safely deleted to free up disk space.
User-provided parameters (if any): $ARGUMENTS
If no parameters are provided by the user, the user's home directory will be scanned by default.
~Scanning Process
Step 1: Disk Overview
bash
df -h /Step 2: Parallel Scanning of Various Space Usages
Execute all the following scans simultaneously:
- Overview of First-Level Directories in User Home Directory
bash
du -sh ~/Desktop ~/Downloads ~/Documents ~/Pictures ~/Music ~/Movies ~/Library 2>/dev/null | sort -rh- Hidden Directory Space Usage
bash
du -sh ~/.[!.]* 2>/dev/null | sort -rh | head -20- Code Directory Space Usage (if exists)
bash
du -sh ~/Desktop/code/*/* 2>/dev/null | sort -rh | head -20- Large Directories in Application Support
bash
du -d1 -h ~/Library/Application\ Support/ 2>/dev/null | sort -rh | head -15- Trash
bash
du -sh ~/.Trash/ 2>/dev/nullStep 3: Targeted Scanning of Cleanable Items
Execute the following scans in parallel:
- Rust target Compilation Cache
bash
find ~/Desktop/code -name "target" -type d -maxdepth 5 -exec du -sh {} \; 2>/dev/null | sort -rh- node_modules Dependencies
bash
find ~/Desktop/code -name "node_modules" -type d -maxdepth 5 -exec du -sh {} \; 2>/dev/null | sort -rh | head -15- .next Build Cache
bash
find ~/Desktop/code -name ".next" -type d -maxdepth 5 -exec du -sh {} \; 2>/dev/null | sort -rh- Package Manager Caches
bash
du -sh ~/.cache/uv ~/.cache/huggingface ~/.cache/pre-commit ~/.cache/puppeteer ~/.cache/rod ~/.npm/_cacache ~/.pnpm-store ~/.bun ~/.gradle 2>/dev/null | sort -rh- Installation Packages in Downloads
bash
find ~/Downloads -maxdepth 1 \( -name "*.dmg" -o -name "*.pkg" -o -name "*.app" \) -exec ls -lhS {} \; 2>/dev/null- Large .git Directories
bash
find ~/Desktop/code -name ".git" -type d -maxdepth 4 -exec du -sh {} \; 2>/dev/null | sort -rh | head -10- Docker Space Usage (if Docker is running)
bash
docker system df 2>/dev/null || trueStep 4: Generate Cleanup Report
Output the report in the following format:
## Disk Overview
Total Capacity: XXX | Used: XXX | Available: XXX
## Cleanable Items (Sorted by Space Freed)
### 🔴 High Value (Can be safely deleted, frees up a large amount of space)
| Category | Size | Description |
|------|------|------|
| Rust target Compilation Cache | XXG | Can be restored by running cargo build again |
| Package Manager Caches | XXG | Will be automatically re-downloaded when needed |
| ... | ... | ... |
### 🟡 Medium Value (Clean as needed)
| Category | Size | Description |
|------|------|------|
| node_modules | XXG | Can be deleted for infrequently used projects, restore with bun install |
| Installation Packages in Downloads | XXXM | Installed .dmg/.pkg files can be deleted |
| ... | ... | ... |
### 🔵 Low Value / Need Caution
| Category | Size | Description |
|------|------|------|
| Application Data | XXG | Deletion may result in loss of application configurations |
| ... | ... | ... |
## Estimated Space to Free: XXGStep 5: Interactive Cleanup
After outputting the report, ask the user which categories they want to clean up. Execute deletion after user confirmation.
Safety Rules
- Never delete user documents, photos, or source code files
- Never delete directories (only report their size for reference)
.git - Never delete or
target/in the current working directorynode_modules/ - Only delete recoverable content such as caches, compilation artifacts, and installation packages
- List the full path before each deletion and wait for user confirmation
- Run after deletion to report how much space has been freed
df -h /
Notes
- Output all information in Chinese
- Maximize parallel execution during scanning to reduce waiting time
- If permission issues are encountered, try using first, do not use sudo
chmod -R u+w