编程

Disk Sweeper

试用

Intelligent disk space analysis and cleanup tool with safety grading, duplicate detection, and Chinese app cache recognition.

它能做什么

Intelligent disk space analysis and cleanup tool with safety grading, duplicate detection, and Chinese app cache recognition.

技能文档

Disk Cleaner (disk-sweeper)

Smart disk space analysis and cleanup. Scans directories, analyzes file usage by type/size/age, detects duplicates, identifies Chinese application caches, and generates safety-graded cleanup recommendations.

Key differentiator: System-critical path protection (never touches /System, /bin, etc.) and deep recognition of Chinese app caches (WeChat, DingTalk, QQ, etc.).

Quick Start

clawhub run disk-sweeper scan --paths ~/

Produces a comprehensive disk analysis report with type distribution, top files, and safety-graded cleanup suggestions.

Features

FeatureDescription
Smart ScanningRecursive with streaming, parallel, auto-skip no-permission dirs
Multi-dimension AnalysisBy type, directory, extension, age, top-N large files
Duplicate DetectionSHA-256 content hash (size-grouped → head hash → full hash)
Chinese App CacheWeChat/DingTalk/QQ/Baidu/WPS/Netease music cache recognition
System Cache AnalysismacOS caches, Xcode, Docker, node_modules, npm/yarn, Homebrew
Safety Grading🟢SAFE / 🟡CLEANABLE / 🟠CAUTION / 🔴PROTECTED with rationale
Cleanup ModesPreview (default), Interactive, Auto-Safe, Custom
Undo SupportMoves to trash instead of permanent delete

Safety Protection

The following paths are permanently excluded and cannot be overridden:

  • /System/*, /bin/*, /sbin/*, /usr/bin/*, /etc/*, /dev/*, /proc/*, /core/*
  • Symbolic links crossing into system directories

Sample Prompts

Prompt 1: Quick Scan

clawhub run disk-sweeper scan --paths ~/

Expected output: 📊 Disk analysis report with:

  • 💾 Total usage: 156.4 GB | Free: 89.2 GB
  • 📁 By type: Video 48GB, Images 32GB, Apps 25GB, Cache 18GB...
  • 🔍 Top 10 largest files
  • 🧹 Cleanable: ~12.5 GB

Prompt 2: Duplicate Detection

clawhub run disk-sweeper analyze --detect-duplicates --paths ~/Documents ~/Pictures

Expected output: 🔁 38 duplicate groups, wasting 8.3 GB

  • Group 1: 3 copies of 2025-archive.zip (1.2 GB each)
  • Suggested: disk-sweeper dedupe --group 1

Prompt 3: Safe Cleanup Preview

clawhub run disk-sweeper clean --mode preview

Expected output: All 🟢SAFE cleanup items previewed, then:

clawhub run disk-sweeper clean --mode auto-safe --confirm

✅ Removed 127 files, freed 5.8 GB

Prompt 4: Cache Analysis

clawhub run disk-sweeper analyze --detect-caches

Expected output: Cache breakdown by app with safety ratings:

  • WeChat: 12.3 GB ⚠️ CAUTION (chat attachments)
  • Docker: 8.7 GB 🟡 CLEANABLE (unused images)
  • Xcode: 15.2 GB 🟡 CLEANABLE (DerivedData)
  • npm: 2.1 GB 🟢 SAFE (reconstructable)

Prompt 5: Scheduled Weekly Scan

clawhub run disk-sweeper scan --summary-only --output-format json

First-Success Path

Goal: Valuable disk analysis within 5 seconds of installation.

Step 1: clawhub install disk-sweeper
Step 2: clawhub run disk-sweeper scan
Step 3: Internal pipeline:
  a. scanner.py streams from ~ (real-time progress)
  b. analyzer.py aggregates by type/directory
  c. safety.py grades every item
  d. formatter.py renders Markdown report
Step 4: User sees disk overview + top files + cleanup suggestions
Step 5: User finds a removable 8GB old file → first value

Key Metrics: 100K files scanned in < 5s, zero params sufficient, > 95% chance of valuable discovery.

Architecture

disk-sweeper/
├── SKILL.md
├── scripts/
│   ├── scanner.py         # Filesystem scanner (streaming + progress)
│   ├── analyzer.py        # Space analysis engine
│   ├── duplicates.py      # Duplicate file detection (SHA-256)
│   ├── caches.py          # App cache recognition
│   ├── safety.py          # Safety grading + protection list
│   ├── cleaner.py         # Cleanup executor (trash/delete/undo)
│   ├── formatter.py       # Report formatting
│   └── progress.py        # Progress bar + status output
└── references/
    ├── protected-paths.json   # System path protection list
    ├── cache-patterns.json    # App cache patterns
    └── file-types.json        # Extension → file type mapping

Error Handling

CodeScenarioAction
E001Invalid scan pathExit, list invalid paths
E002Out of memory (large scan)Process in batches
E003Hash calculation failureSkip file, continue
E004File locked during cleanupSkip, log to report
E005Trash unavailable (headless)Fallback to direct delete (with confirm)
E006Write permission deniedError + output to stdout
E007User interrupt (SIGINT)Graceful exit, log completed ops

Security

  • Hardcoded protected paths: /System, /bin, /sbin, /usr/bin, /etc — user cannot override
  • Transparent safety rating: Every cleanup item labeled with grade and reason
  • Preview by default: Cleanup only previews, requires explicit --confirm
  • Trash by default: use_trash: true moves to trash, not permanent delete
  • Zero network: Entire process is offline
  • No content reading: Only filename/size/hash, never file content
  • No symlink traversal: Won't follow symlinks outside scanned scope

相关技能

AI-powered cross-platform disk storage analyzer. Scans system/user/dev space usage, generates interactive HTML report with 3-tier cleanup tiers (立即清/确认后清/保留)...

5 次安装1 星标

会勇禾口王 · 开发环境体检器(第三把 doctor)。扫描 Mac/Linux 上被开发工具占掉的磁盘空间,把每个目录判定成「数据 / 缓存 / 残留」三类,重点识别**你已经换掉但从没卸干净的旧工具**(如还留着 nvm 却早就在用 fnm),逐条给出判定依据、官方清理命令与代价。配交互式清理选择器(空格勾选、数据类锁死勾不上、确认后才执行、支持 --dry-run),删什么由你逐项勾。触发:用户说「磁盘满了 / 硬盘不够了 / 清理缓存 / 电脑越用越满 / 开发环境体检 / 查查什么占空间 / env-doctor / 环境体检 / disk doctor / 我的 Mac 空间去哪了 / node_modules 太大 / 缓存清理 / 残留清理 / 换过 nvm 想清干净」。任何「查/清 本机磁盘被开发工具占用」的请求都应触发。

Watch and explain Mac disk usage. Use when the user asks about Mac storage/disk space ("what's eating my disk?", "disk full", "free up space"), wants a visua...

1 次安装

Mac 磁盘空间盘点与清理建议技能。当用户说「硬盘不够用」「空间不足」「磁盘快满了」「帮我清理 Mac」「扫描大文件」「哪些可以删」时触发。 自动扫描系统、用户目录、开发项目中的空间占用,生成三级清理建议(立即清 / 确认后清 / 保留),提供可直接复制执行的命令。 绝不自动删除任何文件,只出报告和命令,执行前必...

1 次安装

面向电脑小白的 Windows C 盘清理助手(经真机实战验证)。两种模式:①开荒保洁——C盘已爆满时,先只读体检、用大白话讲清每类文件是什么/删了有啥影响,等用户逐条点头才动手,且一律只搬不删、可恢复;②日常保洁——记住你的清理习惯,定期自动体检或你随时喊一声,只清安全项。绝不自行删除任何文件,任何清理动作前必须取得用户明确同意。实战已验证:微信等聊天数据走官方"更改存储位置"迁移、可重建缓存只搬 Cache/Temp 子目录、软件主程序目录绝不碰、搬前检测进程锁防"半搬走"。触发词:"C盘满了""C盘爆红""清理C盘""C盘瘦身""腾空间""定期清理C盘""电脑卡"。

1 次安装

Analyzes Android APKs through the Crawlora API — submit an APK or public URL, inspect static-analysis results, compare versions, build timelines, and compare ownership signals — returning clean JSON. Use for mobile-app security, provenance, SDK, permission, signing, and release-history research.