Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add davidtoby/agent-skills --skill macos-disk-cleanupgit clone --depth 1 https://github.com/davidtoby/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/davidtoby/agent-skills/macos-disk-cleanup)<a href="https://agentmods.dev/skills/davidtoby/agent-skills/macos-disk-cleanup"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/macos-disk-cleanup/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/davidtoby/agent-skills/macos-disk-cleanup"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/macos-disk-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.01324 |
| Opus 5.5 | $0.00023 | $0.00530 |
| Sonnet 5.5 | $0.00011 | $0.00265 |
| Haiku 4.5 | $0.00006 | $0.00132 |
Grade C, and why
macos-disk-cleanup scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 28d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
`--report-dir` 可指定全新的报告目录,默认 `~/disk-cleanup-reports/<UTC时间戳>/`。先写审计,再删除。脚本拒绝符号链接、挂载点、非当前用户文件及关联活动进程;不要用 `rm -rf` 绕过拒绝。 How it starts
The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.
macOS 磁盘清理
先盘点,再按当前授权范围清理,核对实际可用空间并交付操作记录。占用大不代表可以删除。调用技能本身不授权删除模型或个人资料;过去的删除授权不适用于新的清理任务。
授权和保留范围
- 用户要求“执行磁盘清理”时,可检查后清理下表中的 npm / pip 下载缓存,不重复请求泛泛确认。只要求分析、创建或测试技能时,仅扫描。
- 仅在当前任务明确要求删除时清理 Ollama / LM Studio 模型。已明确授权的项继续执行;未授权的候选项先列出具体路径、占用、用途和后果,等待答复。
- 保留源码、项目 node_modules / 虚拟环境、文档、桌面、下载、媒体、云同步、聊天附件、应用容器、应用支持数据、凭据(包括
~/.key)、系统文件、备份和快照。不要清空废纸篓、卸载应用或删除未知大文件来凑释放量。 - 保留 Ollama 密钥、历史和日志;保留 LM Studio 的 conversations、credentials、config-presets、user-files、bin、extensions 和内部配置。清理模型后重建空模型目录,保留权限。
- 保留 uv 缓存、npx 运行包、pnpm store、Playwright 浏览器、Docker 数据和推理组件,除非当前任务另有明确授权并完成用途检查。这些可能被服务使用或与环境存在链接关系。
- 不删除运行中浏览器、飞书等应用的缓存,不自动退出应用、终止推理或安装任务。有关进程阻挡时,说明进程和具体目标,继续不受影响的只读检查,等待用户关闭或授权停止。
- 不输出密钥、配置密文、对话正文或进程完整参数。脚本只在内存解析进程参数,输出工具名和 PID。不要上传扫描报告或自动发布技能。
流程和脚本
-
确认 macOS 和真实用户主目录。用
df -k /System/Volumes/Data读取 APFS 数据卷可用空间;根卷 Used 不能代表完整数据占用。 -
执行默认只读盘点(脚本路径相对本技能目录):
python3 scripts/disk_cleanup.py列出四类目标及主目录一层占用,不删除文件。大目录扫描可能耗时,保持进展说明。权限不足时记录扫描不完整,不用管理员权限扩大删除范围。
-
按盘点和当前授权选择目标:
标识 唯一删除范围 后果 npm-downloads ~/.npm/_cacache安装包需重新下载,保留 _npxpip-downloads ~/Library/Caches/pip/http和http-v2安装包需重新下载,保留 wheels ollama-models ~/.ollama/models全部本地模型删除,再用需下载 lmstudio-models ~/.lmstudio/models全部本地模型删除,保留推理组件 不按整个
.lmstudio占用承诺模型释放量,其中还包含运行组件和用户资料。 -
执行已授权的下载缓存清理:
python3 scripts/disk_cleanup.py --targets npm-downloads pip-downloads --apply当前任务明确授权删除模型后,选择相应标识并传入授权标志;标志必须反映真实用户授权:
python3 scripts/disk_cleanup.py --targets ollama-models lmstudio-models --apply --authorize-model-deletion--report-dir可指定全新的报告目录,默认~/disk-cleanup-reports/<UTC时间戳>/。先写审计,再删除。脚本拒绝符号链接、挂载点、非当前用户文件及关联活动进程;不要用rm -rf绕过拒绝。 -
读审计记录,再核对
df和目标剩余占用。错误时停止对应项,报告实际状态,不将部分成功说成全部完成。protected_paths_preserved仅验证原有保护路径仍存在,不等于全部文件内容校验或系统稳定性测试。 -
报告本轮实际空间变化、最新可用空间、删除类别、保留项、重新下载影响和本地 Markdown / JSON 链接。GiB 为 1024³ 字节;同时给 GB 时明确十进制含义。后台写入和 APFS 共享块会使目标占用之和与实际增量不同。
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 28d ago First seen · 63 lines · 57 tokens per session scan C 53b013ca3d64
macos-disk-cleanup is a skill published in the GitHub repository davidtoby/agent-skills (11 stars, last pushed 14d ago), licensed MIT. It adds 57 tokens to every session and 1,324 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-06.
macos-disk-cleanup compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| macos-disk-cleanupdavidtoby/agent-skills | Skill | 11 | 14d ago | MIT | C | 57 | Codex |
| morph-pptiOfficeAI/OfficeCLI | Skill | 34k | 3d ago | Apache-2.0 | A | 169 | Claude Code, Codex |
| officecli-academic-paperiOfficeAI/OfficeCLI | Skill | 34k | 3d ago | Apache-2.0 | A | 141 | Claude Code, Codex |
| officecli-pptxiOfficeAI/OfficeCLI | Skill | 34k | 3d ago | Apache-2.0 | A | 106 | Claude Code, Codex |
| mailboxagentscope-ai/QwenPaw | Skill | 38k | today | Apache-2.0 | A | 79 | Claude Code, Codex |
| channel_messageagentscope-ai/QwenPaw | Skill | 38k | today | Apache-2.0 | A | 58 | Claude Code, Codex |
| officecliiOfficeAI/OfficeCLI | Skill | 34k | 3d ago | Apache-2.0 | A | 56 | Claude Code, Codex |