
Storage Analyzer
This is a read-only disk analyzer that scans your entire macOS or Windows system, identifies space hogs, and categorizes them into green (auto-cleanable caches like npm/Xcode cruft), yellow (needs human judgment, like offline videos or project files), and red (caution, like duplicate apps that should be uninstalled properly). It generates an interactive HTML report with a local server where you can actually delete files with one click, either trashing them or nuking them permanently. The three-tier system is smart about risk. Green items get delete buttons, yellow items get "open in Finder" plus optional trash for safe subdirectories, red items just show you where to uninstall. It's agent-driven, meaning Claude does the analysis after scanning, not a standalone app. Fully tested on macOS, Windows support is coded but not battle-tested yet.
- skills.sh installs
- 1.7K
- GitHub stars
- 22.1K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add kkkkhazix/khazix-skills --skill storage-analyzer --agent claude-codeInstalls into .claude/skills of the current project.
Files
Storage Analyzer
对 macOS / Windows / Linux 做一次只读存储分析,产出交互式 HTML 报告。流程:扫描 → 分析分级 → 生成网页 → 打开。
铁律
- 全程只读。 只能跑扫描/统计/列目录/读元信息(df、du、diskutil、stat、ls)。扫描阶段不执行删除、移动、清空回收站或改权限。
- 清理必须有明确授权。 只请求分析不等于授权删除;用户已批准具体对象时,Agent 可在相同边界内代为操作,无需要求再点一次浏览器。网页按钮保留逐次确认。
- 估算标注清楚。 涉及"可释放空间"一律说明是估算值。
- 路径、命令保留原文不翻译。
执行流程
Step 1 扫描(只读)
从宿主当前加载的 Skill 位置取得实际绝对目录并设为 STORAGE_SKILL_DIR;每个新 shell 都要重新赋值。输出写入当前任务的工作目录,脚本使用带引号的绝对路径:
python3 "$STORAGE_SKILL_DIR/scripts/scan.py" > storage_scan.json
scan.py 自动识别系统(sys.platform):
- macOS:扫 home、library、caches、containers、group_containers、app_support、applications、downloads、dev_caches,用
du -x算大小(不跨卷)。挂载点会被跳过并写进warnings,例如 Xcode 的~/Library/Developer/CoreDevice/DeviceFS:它是模拟器/设备文件系统的虚拟挂载,显示几十 GB 但不占本盘空间,不要当成清理项。二次深入查看时同样用du -x。 - Windows:扫 user_profile、appdata_local、appdata_roaming、temp、downloads、program_files(_x86)、dev_caches,用
os.scandir算大小;system.disks含所有盘符。 - Linux:扫 home、
.cache、.local/share、downloads、/var、/tmp、dev_caches(pip/uv/cargo/npm/go/docker/snap 等),用du算大小,不跳过挂载点(ZFS 数据集、btrfs 子卷和本盘同池);system.disks来自 GNUdf,按 ZFS 池或设备合并,主盘是装着/的那个(解析失败时降级为根分区信息)。
Sponsors
Details
- Repository
- github.com/kkkkhazix/khazix-skills
- Category
- Frontend Development
- First seen
- Jul 14, 2026