Install
$ agentstack add skill-tsinhzl-disk-cleanup-skill-disk-cleanup-skill ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Workflow
Step 1 — 扫描
bash ~/.claude/skills/disk-cleanup/scripts/scan.sh
单次调用获取全部目标大小与磁盘总览,只读操作,无副作用。
Step 2 — 分级报告
将 scan.sh 输出整理为三级表格:
| 级别 | 含义 | |------|------| | 🔴 安全 | 清理后自动重建,零用户数据丢失风险 | | 🟡 需确认 | 清理后需重新编译或重新下载,影响开发流程 | | 🔵 用户数据 | 仅展示大小,本 Skill 绝不操作 |
报告末行输出:预计可释放 X GB(仅统计 🔴 项合计)。
Step 3 — 确认选择
在 AskUserQuestion 获得明确选择前,禁止执行任何清理或删除命令。 不得以"这些目录显然安全"或"上次已经确认过"为由跳过本步骤。
使用 AskUserQuestion(两个问题):
问题 1 — 安全缓存处理(multiSelect: true,2 个选项):
- 清理全部🔴安全缓存(推荐)— CocoaPods / npm / pip / Homebrew / Go / Chrome / Flutter / Playwright / Gradle / Cargo / Maven / node-gyp / Swift PM / JetBrains / Bun / Xcode ModuleCache
- 仅生成报告,不执行任何清理
问题 2 — 需确认的清理(multiSelect: true,4 个选项):
- 🟡 Xcode DerivedData — 下次编译耗时增加 10–30 分钟,自动重建
- 🟡 Shutdown iOS 模拟器 — 可通过 Xcode 重新添加
- 🟡 Android 模拟器 (AVD) — 可通过 Android Studio 重新创建
- 🟡 Xcode DeviceSupport & Archives — 调试符号和历史归档,可重下载/重打包
问题 1 选"仅报告" 且 问题 2 无任何勾选 → 结束,不调用任何删除工具。
Step 4 — 执行与验证
读取 [references/cleanup-commands.md](references/cleanup-commands.md),按所选分类依次执行:
- 每项前输出:
> 正在清理:(预计 X GB) - 执行对应命令
- 完成后重新运行
df -h /,对比 Step 1 的 Avail 值 - 输出:实际释放 X GB
Constraints
- 🔵 目录绝不操作:
Application Support/Google/Chrome、~/Downloads、~/Documents - rm -rf 安全:执行前用
echo预演路径展开,确认无通配符误扩展后再执行 - 对抗合理化:
- "这个缓存肯定是安全的,跳过确认直接删" → 必须通过 Step 3 AskUserQuestion,无例外
- "已经扫描过了,跳过 Step 1 省时间" → Step 1 每次必须重新运行,获取当前真实状态
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: TsinHzl
- Source: TsinHzl/disk-cleanup-skill
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.