Macos Disk Cleanup

診斷並清理 macOS 磁碟空間,特別是「系統資料 / System Data」這類看不出內容的用量。涵蓋開發者工具殘骸(Xcode iOS DeviceSupport、Simulator runtime、DerivedData)、套件管理器快取(Homebrew、pnpm、pip、npm、cargo、go、uv)、容器與 VM 磁碟(Docker、podman、lima)、瀏覽器 profile、以及已移除 app 的孤兒 container。使用時機:(1) 使用者說磁碟快滿了、System Data 佔太多、想清空間 (2) 詢問某個資料夾或快取能不能刪 (3) 移除 app 後想清乾淨殘留檔案、完整解除安裝 (4) 想知道 Docker.raw、Group Containers、Library/Caches 這些是什麼、佔了多少。Also triggers in English — disk full, startup disk almost full, free up disk space, clean up Mac storage, what is System Data on my Mac, what is taking up space, safe to delete this cache, uninstall app leftovers, reclaim disk

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add himynameisben/macos-disk-cleanup --skill macos-disk-cleanup
Manual install
git clone --depth 1 https://github.com/himynameisben/macos-disk-cleanup.git /tmp/macos-disk-cleanup
mkdir -p ~/.claude/skills
cp -r /tmp/macos-disk-cleanup/. ~/.claude/skills/macos-disk-cleanup

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# macOS 磁碟清理

## 核心原則

**刪除不可逆。** 每一次刪除前都要能回答:這是自動重建的快取,還是使用者唯一的副本?答不出來就先看內容,再問使用者。

分三級處理:

| 等級 | 判準 | 動作 |
|---|---|---|
| **SAFE** | 自動重建、不含使用者資料 | 合併成一個選項提案,確認後刪 |
| **CONFIRM** | 可重新下載但代價高(GB 級),或改變 app 行為 | 列出大小與後果,問過再刪 |
| **DANGER** | 含使用者資料(文件、聊天記錄、憑證、書籤) | **先列出實際內容**,逐項確認 |

分類對照表在 `references/locations.md`。

## 流程

### 1. 掃描

```bash
scripts/disk_scan.sh          # 標準掃描,約 40 秒
scripts/disk_scan.sh --deep   # 追加各語言套件管理器快取
```

唯讀,不刪任何東西。輸出含:磁碟總量、`~/Library` 各層排名、Xcode/Simulator 用量、**稀疏 VM 磁碟的實佔 vs 宣告值**、以及**孤兒 container**(app 已不在但 container 還佔著空間)。

### 2. 分類與呈現

對照 `references/locations.md` 把發現分成上述三級,用表格呈現「項目 / 大小 / 是什麼 / 刪掉的後果」。

要點出使用者自己看不出來的東西,例如:`Docker.raw` 是整台 Linux VM 的虛擬硬碟、`iOS DeviceSupport` 每個 iOS 小版本各存一份 5 G。

### 3. 確認

把所有待刪項目整理成一則提問,一次問完,並把預估回收量寫進每個選項。不要每刪一項問一次。有結構化提問工具(例如 AskUserQuestion)就用,沒有就用一則清楚的條列訊息。

SAFE 等級可以合併成單一選項(「套件快取共 N G」),但**仍然要出現在選項裡**。重抓數十 GB 對計量網路、即將離線、或正在趕工的人是實質代價,這個取捨屬於使用者,不該由 skill 代為決定。

### 4. 執行

**進 DANGER 等級的 container 之前,一定先跑:**

```bash
ls -la ~/Library/Containers/<bundleid>/Data/
```

`Downloads`、`Desktop`、`Movies`、`Music`、`Pictures` 是**指向真實家目錄的 symlink**。`du -sh Data/*/*` 會穿過它們,把使用者的 `~/Downloads` 列成 app 資料——照著刪就是災難。細節見 `references/gotchas.md` 第 1 節。

執行時:

- 每個階段刪完立刻跑 `df -h /System/Volumes/Data`,用前後差值歸因
- 刪除腳本**不要用 `set -e`**(`rm -rf` 遇到權限錯誤會回傳非 0 而中止後續指令)
- 靠重新量測驗證,不要靠 exit code

### 5. 驗證與回報

回報實際的前後數字和每項的貢獻。踩到已知的預期性失敗(container 空殼、simctl 非同步)時,說明那是正常的,不要當成錯誤回報。

## 開工前必讀
Read the full skill on GitHub

Details

Skill name
macos-disk-cleanup
License
MIT
Repo updated
6 August 2026

FAQ

What does the Macos Disk Cleanup skill do?

診斷並清理 macOS 磁碟空間,特別是「系統資料 / System Data」這類看不出內容的用量。涵蓋開發者工具殘骸(Xcode iOS DeviceSupport、Simulator runtime、DerivedData)、套件管理器快取(Homebrew、pnpm、pip、npm、cargo、go、uv)、容器與 VM 磁碟(Docker、podman、lima)、瀏覽器 profile、以及已移除 app 的孤兒 container。使用時機:(1) 使用者說磁碟快滿了、System Data 佔太多、想清空間 (2) 詢問某個資料夾或快取能不能刪 (3) 移除 app 後想清乾淨殘留檔案、完整解除安裝 (4) 想知道 Docker.raw、Group Containers、Library/Caches 這些是什麼、佔了多少。Also triggers in English — disk full, startup disk almost full, free up disk space, clean up Mac storage, what is System Data on my Mac, what is taking up space, safe to delete this cache, uninstall app leftovers, reclaim disk

How do I install the Macos Disk Cleanup skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add himynameisben/macos-disk-cleanup --skill macos-disk-cleanup. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Macos Disk Cleanup popular?

It lives in himynameisben/macos-disk-cleanup, which has 40 GitHub stars and 0 forks.

Related skills

Nixos

33

marceloeatworld/nixos-ai-skill

Use when the user asks about NixOS, Nix language, flakes, nixpkgs, configuration.nix, nixos-rebuild, modules, options, overlays, derivations, mkDerivation, callPackage, home-manager, nix-darwin, devenv, packaging, cross-compilation, binary caches, garbage collection, NixOS containers, networking, firewall, systemd services, filesystems, LUKS, Wayland, X11, kernel, profiles, NixOS testing or VM tests, ISO images, Docker images, Raspberry Pi, Terraform, distributed builds, remote machines, pinning nixpkgs, rollback, generations, Nix Pills, or any topic related to configuring, packaging, deployin

DevOps & Cloud

Omarchy

35

robzolkos/omarchy-skill

Manage and configure Omarchy Linux systems. Use when user asks about Omarchy, Hyprland, themes, keybindings, system config, or any omarchy-* commands.

DevOps & Cloud

R00 Travisvn Awesome Claude Skills Devops

37

TopCoppersmithRuin/r09-travisvn-awesome-claude-skills-devops

☁️ DevOps & Cloud Infrastructure skill suite derived from travisvn/awesome-claude-skills. CI/CD pipelines, container orchestration, IaC, monitoring and incident response. Provides 10 specialised commands for devops, cloud, docker workflows.

DevOps & Cloud

D1v

25

d1vai/d1v-cli

Operate d1v.ai projects and container workspaces with the d1v CLI. Use when a task involves D1V authentication, project binding, workspace synchronization, container commands, environment metadata, preview deployments, deployment status, or a user-confirmed production release.

DevOps & CloudIn 1 list

Dotnet Performance

36

wieslawsoltes/Performance-Skill

Evidence-first performance engineering workflow for coding agents combining portable .NET diagnostics with platform-native profiling, BenchmarkDotNet, application benchmarking, statistical validation, deployment, container, graphics, and GPU procedures.

DevOps & Cloud

R00 BehiSecc Awesome Claude Skills Devops

43

centiofficermultiply/r17-behisecc-awesome-claude-skills-devops

☁️ DevOps & Cloud Infrastructure skill suite derived from BehiSecc/awesome-claude-skills. CI/CD pipelines, container orchestration, IaC, monitoring and incident response. Provides 10 specialised commands for devops, cloud, docker workflows.

DevOps & Cloud

Browse the most popular Claude skills, all devops & cloud skills, or write your own with the skills generator.