From xcode-disk-cleanup
Audit and safely clean Xcode-related developer storage on macOS. Use whenever a developer mentions low disk space, Xcode storage, DerivedData, simulator devices or runtimes, stale beta platforms in Xcode Settings, DeviceSupport, archives, dSYMs, CocoaPods caches, simulator dyld caches, project .build folders, downloaded Xcode DMGs/XIPs, duplicate Xcode installers, or old Xcode applications. Also use this skill proactively when you hit low storage during other work, such as a build, download, or install failing with an out-of-disk-space error. Always measure first, report recoverable GiB with evidence, and obtain explicit itemized approval before any mutation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/xcode-disk-cleanup:xcode-disk-cleanupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- Treat every cleanup request as permission to audit, not permission to delete.
rm -rf, sudo, SIP changes, or manual deletion
inside system-managed CoreSimulator and MobileAsset directories.Package.resolved, signing assets, credentials, custom DocSets, the
active Xcode, a running simulator, or an Xcode that uniquely provides a required
SDK/toolchain.Read references/safety-model.md before applying cleanup.
xcodebuild, Swift build, test, archive, and
package-resolution processes..build and .derived-data
scanning. Do not crawl the whole home directory.python3 "${SKILL_DIR}/scripts/xcode_disk_cleanup.py" audit \
--output-dir .xcode-disk-cleanup-audit \
[--scan-root /path/to/projects]
Read both generated files:
.xcode-disk-cleanup-audit/report.md.xcode-disk-cleanup-audit/audit.jsonThe script audits DerivedData, documentation caches, CocoaPods caches, simulator devices and runtimes (including stale superseded beta runtimes), orphan runtime volumes, simulator dyld caches, Xcode-managed components, Xcode installers, installed Xcodes, archives (including never-distributed orphans), DeviceSupport for every platform, diagnostic logs, XCTest device clones, legacy DocSets, and explicitly requested project roots.
Shared compiler caches (ModuleCache.noindex, precompiled SDK modules) and the
global SwiftPM download cache are deliberately out of scope: they are always in
use on an active development machine, and clearing them trades real build-time
pain for little lasting space. Do not propose them.
Use the category router:
| Finding | Reference |
|---|---|
DerivedData, module caches, project .build, CocoaPods | references/generated-data.md |
| Simulator devices, runtimes, dyld caches, XCTest clones | references/simulators.md |
| Archives, dSYMs, DeviceSupport, logs, DocSets | references/release-artifacts.md |
| Xcode DMGs/XIPs and installed Xcodes | references/xcode-installations.md |
| Confirmation and deletion behavior | references/safety-model.md |
Do not mechanically accept a scanner classification. Verify uncertain ownership, custom paths, backups, and toolchain requirements.
Sort by recoverable GiB and show:
Keep the proposal scannable:
file:// links so the user can inspect
them before approving.report.md for reference. Do not pad the proposal with a "small items" bucket —
it adds questions, not signal.Include:
Invoke apply only after the user explicitly approves the exact IDs shown in the current audit:
python3 "${SKILL_DIR}/scripts/xcode_disk_cleanup.py" apply \
--audit-file .xcode-disk-cleanup-audit/audit.json \
--ids "<approved-id-1>" "<approved-id-2>" \
--confirm I_APPROVED_THE_SELECTED_ITEMS \
--output .xcode-disk-cleanup-audit/cleanup-result.json
Simulator device and runtime deletions are irreversible and require a second approval plus:
--confirm-irreversible I_APPROVED_IRREVERSIBLE_SIMULATOR_DELETION
A stale runtime is only proposed when simctl reports it deletable, no installed
Xcode SDK resolves to its build, and a newer runtime supersedes it on the same
platform. This is the pattern behind leftover beta platforms in Xcode Settings →
Components after installing a newer Xcode beta.
Do not pass either confirmation phrase unless the corresponding user approval is present in the conversation.
df free space before and after..xip, .dmg, and .zip installers through Spotlight and common
download folders.kMDItemLastUsedDate reflects LaunchServices opens, not command-line
use. Combine it with xcode-select, DEVELOPER_DIR, running processes,
.xcode-version, CI scripts, and unique SDK/toolchain evidence.npx claudepluginhub avdlee/xcode-disk-cleanup-agent-skill --plugin xcode-disk-cleanupGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.