disk-cleaner

Cross-platform disk space management toolkit with intelligent optimization. REQUIREMENTS: Python 3.7+. UNIVERSAL COMPATIBILITY: Works with ALL AI IDEs (Cursor, Windsurf, Continue, Aider, Claude Code, etc.). PLATFORM-INDEPENDENT: Works at any location - global, project, or user level. SELF-CONTAINED:

By open-agent-power · 796 installs

npx skills add open-agent-power/oh-my-disk-cleaner --skill disk-cleaner

Source repository · Upstream listing

Disk Cleaner Skill Complete Feature Guide for All Agents 🚨 IMPORTANT: Emoji Usage Policy For Script Output (Cross Platform Safety) NEVER use emoji in script output All scripts use ASCII safe characters Scripts use: [OK] , [X] , [!] , [ ] , [i] , [DIR] , [FILE] , [PKG] , [x] This ensures compatibility with Windows GBK and other non UTF 8 consoles DO NOT modify script output to add emoji This will break cross platform compatibility For Agent to Human Communication (Recommended) SHOULD use emoji when reporting results to humans Makes output more readable Use these emoji in your final reports to users: ✅ (Success) Completed operations, successful scans ❌ (Error) Failed operations, critical errors ⚠️ (Warning) Warnings, issues that need attention 🔍 (Scanning) Search/scan operations 📊 (Statistics) Analysis results, statistics 📁 (Directory) Directory related information 📦 (Package) Package/module information 🎉 (Success) Celebratory messages for successful completion 🚨 (Critical) Critical warnings 💡 (Tip) Suggestions, recommendations 📋 (List) Checklists, summaries 🔧 (Tool) Tools, utilities 🌐 (Global) Cross platform, universal features 🛡️ (Safety) Safety related information ⚡ (Performance) Performance improvements 📝 (Document) Documentation 🎓 (Learning) Educational content 📞 (Support) Help, support information 📈 (Growth) Improvements, gains 🎯 (Target) Goals, objectives 🚀 (Launch) Quick start, fast operations 🛠️ (Tools) Tool related features Example: 📦 COMPLETE FEATURE LIST (READ THIS FIRST!) 🚨 CRITICAL: Progressive Scanning (MANDATORY for Large Disks) ✅ Quick Sample Mode : 1 second estimation of disk size and scan time ✅ Progressive Scan Mode : Get partial results in 30 seconds for large disks ✅ Smart Time Limits : Prevent users from waiting hours ✅ Real time Feedback : Progress updates every 2 seconds ✅ Interruptible : Ctrl+C to get partial results 🔧 Intelligent Bootstrap (Auto Detection & Import) ✅ Auto Location Detection : Searches 20+ common skill package locations ✅ Environment Variable Support : DISK CLEANER SKILL PATH override ✅ Auto Module Import : Automatically imports diskcleaner modules ✅ Fallback Mechanisms : Works even if some features unavailable ✅ Cross Platform Python Detection : Tries both 'python' and 'python3' 🌐 Universal Compatibility ✅ All AI IDEs : Cursor, Windsurf, Continue, Aider, Claude Code, etc. ✅ All Platforms : Windows, macOS, Linux (including Windows GBK console) ✅ All Installation Levels : Global, project, user level ✅ No Configuration Needed : Works out of the box ✅ Cross Platform Encoding : All scripts use ASCII safe output (v2.0+) 🛡️ Safety & Reliability ✅ Diagnostic Tool : check skill.py verifies all functionality ✅ Safe Encoding : All scripts use ASCII characters (no emoji in output) ✅ Safe Defaults : dry run for cleaning, smart limits for scanning ✅ Protected Paths : Never deletes system directories or executables ✅ Error Handling : Graceful degradation on errors ✅ GBK/UTF 8 Compatible : Works on Windows GBK, UTF 8, and all other encodings ⚡ Performance Optimizations (ALL INCLUDED) ✅ QuickProfiler : Fast sampling to estimate scan characteristics ✅ ConcurrentScanner : Multi threaded I/O for 3 5x speedup ✅ os.scandir() Optimization : 3 5x faster than Path.glob ✅ IncrementalCache : Cache scan results for faster repeat scans ✅ Memory Monitoring : Auto adapts based to available memory ✅ Early Stopping : Configurable file/time limits ✅ Enhanced Cache Detection : 26+ cache paths (was 8) 225% improvement 🆕 v2.2+ New Features ✅ Duplicate File Detection : Find and remove duplicate files with adaptive strategies ✅ Growth Trend Analysis : Track disk usage over time, predict when disk will be full ✅ Interactive Wizard : Step by step guided cleanup with safety confirmations ✅ File Organization : Intelligent file archival and organization (4 strategies) ✅ Enhanced Scan Limits : 500K files (was 50K), 120s timeout (was 30s) ✅ Deep Scan Mode : deep scan for unlimited scanning ✅ Windows Directory Support : include windows for system directory scanning 📊 Available Scripts (13+ Total) Core Analysis: 1. analyze disk.py Disk analysis with smart sampling (enhanced v2.2) 2. analyze progressive.py Progressive scanning for large disks 3. find duplicates.py Duplicate file detection (NEW v2.2) 4. analyze growth.py Growth trend analysis (NEW v2.2) Cleaning & Organization: 5. clean disk.py Safe junk file cleaning (enhanced cache detection) 6. interactive wizard.py Interactive guided cleanup (NEW v2.2) 7. organize files.py File archival and organization (NEW v2.2) Monitoring & Diagnostics: 8. monitor disk.py Disk usage monitoring 9. check skill.py Diagnostic tool Developer Tools: 10. skill bootstrap.py Intelligent bootstrap module 11. package skill.py Package creation tool 12. scheduler.py Automated scheduling macOS QQ media cleanup Use scripts/qq cleanup macos.zsh when QQ pictures or emojis consume excessive space on macOS and chat records must remain intact. 1. Audit QQ storage without changing files: 2. Preview pictures and emojis older than 90 days: 3. Report the preview and obtain explicit approval. Quit QQ, then repeat the approved command with execute . Never select nt db , account roots, preferences, voice messages, videos, or received files. The script accepts only Pic and Emoji , defaults to preview, and refuses execution while QQ is running. Warn that removed local media might no longer be available in old conversations. 🚀 Multi Agent Acceleration (CRITICAL FOR PERFORMANCE) 🎯 KEY INSIGHT: Use Sub Agents for Parallel Processing This is one of the MOST POWERFUL features of disk cleaner when used by AI Agents! Why Use Multiple Agents? Single threaded scanning: Multi Agent parallel scanning: When to Use Multi Agent Mode? ✅ ALWAYS use when: Scanning multiple top level directories (e.g., C:\, D:\, E:\) Cleaning multiple user profiles Processing large file sets ( 100K files) Time critical operations ❌ Don't use when: Single small directory (<10K files) Quick analysis (<30 seconds) Simple cleanup tasks How to Implement Multi Agent Scanning Option 1: Use Agent Tool (Recommended for Claude Code) Option 2: Parallel Subprocess (Platform Independent) Option 3: Multi Platform Agent Team (Advanced) For Agent capable systems (Claude Code, Cursor with Agent support): Performance Comparison Scenario Single Agent 3 Sub Agents Speedup 3 disks (1TB each) ~15 minutes ~5 minutes 3x 10 user profiles ~20 minutes ~4 minutes 5x 1M files ~30 minutes ~6 minutes 5x Cache cleanup (26 locations) ~8 minutes ~2 minutes 4x Recommended Agent Count Small job (<50K files): 1 agent (not worth overhead) Medium job (50K 500K files): 2 3 agents Large job (500K 2M files): 3 5 agents Massive job ( 2M files): 5 8 agents Sweet spot: 3 4 agents (best balance of speed vs overhead) Best Practices 1. Divide work logically : By disk, by user profile, by directory type 2. Use consistent parameters : All agents use same scan limits 3. Merge results carefully : Deduplicate, sort, format 4. Handle failures gracefully : If one agent fails, continue others 5. Monitor progress : Track which agents completed ⚠️ IMPORTANT : Not all AI IDEs support sub agents. Fall back to parallel subprocess if unavailable. 📚 Documentation (Essential Files Only) SKILL.md This complete guide (READ THIS FIRST) README.md Project overview and quick start README zh.md Chinese documentation CHANGELOG.md Version history and changes AGENT QUICK REF.txt One page reference for agents INSTALL.md Detailed installation guide NO PYTHON GUIDE.md Help for users without Python references/temp locations.md Platform specific cache locations 🎯 AGENT CHECKLIST (Must Follow) For ANY Disk Analysis Request: For ANY Clean Request: ⚡ PROGRESSIVE SCANNING (CRITICAL FOR LARGE DISKS) 🚨 CRITICAL INFORMATION (Read First) Universal Compatibility ✅ Works with ALL AI IDEs : Cursor, Windsurf, Continue, Aider, Claude Code, etc. ✅ Platform Independent : Windows, macOS, Linux ✅ Installation Agnostic : Works at global, project, or user level ✅ Self Contained : No external dependencies, just Python 3.7+ The Only Requirement ⚡ PROGRESSIVE SCANNING (CRITICAL FOR LARGE DISKS) 🚨 AGENT MUST USE FOR LARGE DISKS ( 100GB) Problem : Full disk scan on large disks (500GB+) can take HOURS. Users will lose patience. Solution : Use progressive scanning get results in seconds, not hours! 📋 Three Scanning Modes Mode 1: Quick Sample (⚡ FASTEST 1 Second) When to use : Get instant estimate of directory size and scan time Output : Agent Decision Logic : Mode 2: Progressive Scan (🎯 RECOMMENDED FOR LARGE DISKS) When to use : Get partial results in 30 seconds for large disks Features : ✅ Real time progress updates every 2 seconds ✅ Shows partial results as they're discovered ✅ Can interrupt with Ctrl+C and keep results ✅ Smart file count limit (50,000 by default) Agent Usage : Mode 3: Limited Scan (📊 FAST RESULTS) When to use : Get results quickly with file/time limits 🎯 AGENT DECISION TREE (CRITICAL FOLLOW THIS) 📝 Required Response Templates When Quick Sample Shows < 30 Seconds When Quick Sample Shows 30 120 Seconds When Quick Sample Shows 120 Seconds 💡 COPY PASTE CODE (USE THIS) ⚠️ COMMON MISTAKES TO AVOID ❌ DON'T : Always run full scan without checking disk size first ✅ DO : Always run sample first to estimate ❌ DON'T : Let users wait hours for large disk scan ✅ DO : Use max seconds 30 for large disks ❌ DON'T : Ignore estimated time from sample ✅ DO : Use estimate to choose appropriate scan mode ❌ DON'T : Run analyze disk.py on 1TB disk without limits ✅ DO : Use analyze progressive.py with max seconds 📊 Command Reference Card Situation Command Time Result Unknown size sample 1s Estimate + recommendation < 30 seconds analyze disk.py <30s Full results 30 120 seconds time limit 60 60s Most results 120 seconds analyze progressive.py max seconds 30 30s Partial results Very large disk analyze progressive.py max seconds 60 60s More results 🔍 How Progressive Scan Works 1. Quick Sample (1 second) Scans as many files as possible in 1 second Calculates scan rate (files/second) Estimates total scan time Gives immediate feedback 2. Progressive Scan (N seconds) Scans continuously for N seconds Shows progress every 2 seconds Collects results as it goes Returns whatever it found when time is up User can interrupt and keep partial results 3. Smart Stopping Stops automatically when time/file limit reached Graceful handling of interruption Partial results are still useful 🎯 BEST PRACTICE FOR AGENTS 1. ALWAYS run sample first 2. ALWAYS check estimated time before choosing mode 3. ALWAYS inform user about expected scan time 4. ALWAYS use progressive mode for large disks ( 2 minutes) 5. NEVER let users wait more than 2 minutes without feedback 🎯 UNIVERSAL AGENT WORKFLOW This workflow works on ANY platform, in ANY AI IDE, at ANY location. STEP 1: Verify Python STEP 2: Locate Skill Package STEP 3: Verify Skill Package STEP 4: Execute Operation 📋 QUICK REFERENCE (All IDEs