Skip to content
kkkkhazix avatar

Storage Analyzer

Cross-platform storage analyzer that scans disks read-only, tiers items for cleanup, and serves an interactive HTML report.

CCM score
75 of 100
skills.sh installs
1.7K
GitHub stars
22.7K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers macOS, Windows, and Linux disk usage, ranking the largest space consumers into categories with scan.py
  • Sorts findings into three tiers: auto-cleanable caches, items needing manual review, and items to clean carefully
  • Serves a local report where each cleanup step can be run, moved to the Trash, or deleted outright with a confirmation prompt
  • Designed for users reporting a full disk or storage shortage, not for RAM or process memory questions

Install

$ npx -y skills add kkkkhazix/khazix-skills --skill storage-analyzer -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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 来自 GNU df,按 ZFS 池或设备合并,主盘是装着 / 的那个(解析失败时降级为根分区信息)。

Details

Repository
github.com/kkkkhazix/khazix-skills
First seen
Jul 14, 2026

Questions

What does the storage-analyzer skill do?

It runs a read-only scan of the whole disk on macOS, Windows or Linux and sorts each large item into green (safe to auto-clean), yellow (needs manual judgment) or red (clean with care) tiers. It then builds an interactive HTML report with copyable cleanup commands.

How do I install the storage-analyzer skill?

Run npx -y skills add kkkkhazix/khazix-skills --skill storage-analyzer -y in your project. Once installed, the agent can scan storage and produce the cleanup report when you ask it about a full disk or low space.

Can storage-analyzer delete files for me?

Yes, through the optional local server mode, which adds buttons in the report to move items to the trash or delete them directly. Every click asks for browser confirmation, and the scan itself never deletes anything.

What does storage-analyzer need to run?

It uses only Python 3 standard library scripts with no third-party dependencies, so no pip install is needed. On Windows you need Python 3 installed, and on Linux the trash feature needs gio or trash-cli.

More from kkkkhazix/khazix-skills

All 5

Similar to Storage Analyzer