Xcode Disk Cleanup Skill

An audit-first Agent Skill for developers using Xcode. Reclaim development storage without surprising deletions in any AI coding tool that supports the Agent Skills open format. The skill measures cleanup opportunities, explains the cost of each one, reports recoverable GiB with evidence, and waits for your explicit itemized approval before changing anything.
Built by Antoine van der Lee (SwiftLee), known for
RocketSim, which comes with a CLI + Agent Skill for
Simulator interactions, and his other agent skills
like the popular SwiftUI and
Swift Concurrency ones.
Who this is for
- Developers whose Mac keeps running out of space and suspect Xcode is the reason
- Anyone with years of accumulated DerivedData, simulators, runtimes, and archives
- Beta testers who install every Xcode beta and end up with leftover platform runtimes
- Teams that want agents to clean up build machines safely, with an audit trail
What it searches for
The skill runs a read-only audit across every place Xcode quietly accumulates
storage, from build caches to forgotten beta platform runtimes. Each finding is
reported with its size in GiB, supporting evidence, and the cost of regenerating
or permanently losing it.
- Xcode DerivedData for missing or stale workspaces
- Project-local
.build and .derived-data folders
- Available and unavailable Simulator devices
- SwiftUI Preview device sets
- Installed Simulator runtimes, including stale beta runtimes superseded by a
newer platform version that no installed Xcode SDK still uses
- Orphaned Simulator runtime volumes not registered with CoreSimulator
- Simulator dyld caches left behind by removed runtimes
- Simulator clones created by parallel test runs (
XCTestDevices)
- CoreSimulator and iOS device diagnostic logs
- CocoaPods download caches
- Documentation caches and legacy DocSets
- Archives, dSYMs, and per-platform DeviceSupport symbols (iOS, watchOS, tvOS,
visionOS), keeping the newest symbol set per platform
- Orphan archives that were never uploaded or exported and are superseded by a
newer archive of the same app
- Xcode-managed components such as the Metal Toolchain and downloadable
documentation assets
- Downloaded Xcode
.xip, .dmg, and .zip installers
- Installed Xcode applications, active selection, and evidence of recent use
Safety guarantee
As a developer you always need to stay in control of what gets deleted from
your machine: a build cache is cheap to lose, but the wrong archive or
simulator is not. That's why the skill treats “clean Xcode” as permission to
inspect, never as permission to delete.
Before anything is mutated, you get to see for every candidate:
- A stable candidate ID
- Exact path or Simulator identifier
- Measured bytes and GiB
- Risk and regeneration cost
- Evidence supporting the recommendation
- The exact action it proposes
Nothing happens until you approve exact IDs. Ordinary files move to Trash by
default, so you can still recover them. Irreversible Simulator operations ask
you for a second, separate confirmation. Your archives and dSYMs stay preserved
unless you confirm the exact distributed build is safely backed up.
How the audit works
Unlike text-only skills, this repository ships an executable Python script that
does the measuring and the (gated) cleanup, so your agent reasons over
structured JSON instead of ad-hoc shell output.
When it triggers:
- You mention low disk space, Xcode storage, DerivedData, simulators, runtimes,
archives, or old Xcode versions.
- You ask why Xcode Settings → Components still lists old beta platforms.
- Your agent runs into low storage on its own, for example when a build or
download fails with an out-of-disk-space error.
What you can ask:
Audit my Xcode-related disk usage and show how many GB each cleanup could recover.
My Mac is low on storage and Xcode seems to be the reason. Figure out what's safe to remove.
Which simulator runtimes are actually stale after installing the latest Xcode beta?
Find Xcode installers in my Downloads folder that I no longer need.
Under the hood: