macos-dev-disk-space-sweep
Skill0 starsChanged 5 days agoMITView on GitHub
Use when the user asks what is consuming disk, needs to free space, mentions DerivedData, CoreSimulator, Xcode caches, Docker, Homebrew, Codex or Claude Code storage, runner machines, or wants cleanup candidates. Runs a read-only macOS developer disk-space audit and ranks safe cleanup candidates before deletion.
In this repository7 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill for space investigations on local or SSH-accessible macOS developer machines.
- Distinctive: line 12
Do not delete on the first pass unless the user explicitly approves exact paths or categories.
- Distinctive: line 13
Treat CI runner workspaces as hot unless the user confirms the runner is paused or the target is disposable.
- Distinctive: line 16
Verify ownership before attempting to remove another user's files.
- Distinctive: line 17
If a command requires sudo or another account, report the exact permission blocker and the handoff command instead of retrying noisily.
- Distinctive: line 21
Start with filesystem pressure:
- Distinctive: line 87
When deleting after approval:
- Distinctive: line 91
Run the narrow cleanup.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
macOS Dev Disk Space Sweep
Use this skill for space investigations on local or SSH-accessible macOS developer machines. Start read-only, rank candidates, and ask before deleting anything.
Safety Rules
- Do not delete on the first pass unless the user explicitly approves exact paths or categories.
- Treat CI runner workspaces as hot unless the user confirms the runner is paused or the target is disposable.
- Preserve Metal toolchains and current simulator runtimes unless the user says otherwise.
- For simulator cleanup, distinguish unavailable devices/runtimes from active named devices used for app testing.
- Verify ownership before attempting to remove another user's files.
- If a command requires sudo or another account, report the exact permission blocker and the handoff command instead of retrying noisily.
Read-Only Sweep
Start with filesystem pressure:
df -h / /System/Volumes/Data 2>/dev/null || df -h /Scan common developer storage sinks:
du -sh \
"$HOME/Library/Developer/Xcode/DerivedData" \
"$HOME/Library/Developer/CoreSimulator" \
"$HOME/Library/Developer/Xcode/iOS DeviceSupport" \
"$HOME/Library/Developer/Xcode/UserData/Previews" \
"$HOME/Library/Caches" \
"$HOME/.cache" \
"$HOME/.npm" \
"$HOME/Library/Containers/com.docker.docker" \
"$HOME/.codex" \
"$HOME/.claude/projects" \
"$HOME/.claude/file-history" \
"$HOME/Downloads" \
"$HOME/Developer" \
"$HOME/workspace" 2>/dev/null | sort -hrDrill into the largest buckets only:
du -sh "$TARGET"/* 2>/dev/null | sort -hr | head -30Useful targeted checks:
xcrun simctl list devices unavailable 2>/dev/null
xcrun simctl runtime list 2>/dev/null
brew cleanup -n 2>/dev/null
docker system df 2>/dev/null
du -sh "$HOME/.codex"/* 2>/dev/null | sort -hr
du -sh "$HOME/.claude/projects" "$HOME/.claude/file-history" 2>/dev/null # report-onlyAgent Storage (Codex and Claude Code)
~/.claude/projectsand~/.claude/file-historyare report-only. They hold Claude Code session history and memory. Report their size; never propose them as deletion targets or give a cleanup command for them.~/.codexlocations (sessions,worktrees) can grow large. Old worktrees may hold uncommitted work, so checkgit statusin each first, and propose archiving sessions to a location the user chooses rather thanrm.
Ranking Cleanup Candidates
Group findings by confidence:
- Usually safe after confirmation: Xcode DerivedData, module caches, old build folders, Homebrew cleanup, package manager caches, stale agent worktrees with no uncommitted work, old Downloads.
- Needs app/tool context: CoreSimulator devices, iOS DeviceSupport, Docker Desktop data, Hugging Face/Whisper model caches.
- Avoid by default: Claude Code history (
~/.claude/projects,~/.claude/file-history; report-only), active runner workspaces, current simulator devices, current Metal toolchains, repo checkouts with uncommitted work.
Report Format
Return a compact table or bullets:
- path/category
- size
- why it is likely safe or risky
- exact cleanup command, marked
read-only estimateorrequires approval - expected reclaim if known
When deleting after approval:
- Re-list the exact target.
- Confirm ownership/permissions.
- Run the narrow cleanup.
- Re-check
df -h. - Report before/after free space and any failures.
Common Large Sinks
- On iOS development Macs the biggest are usually Xcode DerivedData, CoreSimulator devices and runtimes,
~/.cache/huggingface, Docker Desktop storage, and agent sessions and worktrees (~/.codex/sessions,~/.codex/worktrees). - On runner hosts, old simulator runtimes can be removed with
xcrun simctl runtime delete, but runner workspaces may be actively used. - Permission-denied cascades usually mean the target belongs to another user; stop and verify with
ls -ldeOorstat.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

