consuela is a macOS cleanup script that removes leftover Xcode data and developer caches. It scans the groups you selected, prints how much this run will remove, and asks before it deletes anything.
The script permanently deletes the data it lists. It asks for confirmation unless you pass -y. Do not run it if you need to keep any listed data.
Do not run the Xcode group while Xcode is testing or building.
Xcode (--xcode)
- Throwaway test clones in
~/Library/Developer/XCTestDevices - Simulator devices whose runtime is gone (
xcrun simctl delete unavailable) - Unavailable simulator runtimes (
xcrun simctl runtime delete) - Contents of DerivedData, CoreSimulator caches, simulator logs, xcodebuild cache
- SwiftPM cache and CocoaPods cache
Available simulators, source code, and installed runtimes that Xcode still uses stay in place.
Caches (--cache)
Package-manager caches only. See Cleanup policy for the exact command on each plan line.
Docker (--docker / --docker-all)
- Unused images, including tagged images that no container uses
- Stopped containers and build cache (
docker system prune -af)
Docker dangling (--docker-dangling)
- Dangling images, stopped containers, and build cache (
docker system prune -f)
Reclaimable size for Docker comes from docker system df. prune -a can free more than that figure because unused tagged images are included in the delete but not always in the df reclaimable column.
If DOCKER_HOST is set, consuela prints it and asks for confirmation even when you passed -y.
Run the installer:
curl -fsSL https://raw.githubusercontent.com/exddc/consuela/main/install.sh | shRun the full cleanup:
consuela-y skips the confirmation prompt. --dry-run prints the plan and exits without deleting.
consuela --xcode
consuela --cache
consuela --docker
consuela --docker-dangling
consuela --xcode --cache
consuela --dry-run --cacheWith group flags, consuela scans only those groups.
Disk Utility may still report the old free space until Time Machine local snapshots expire. The delay is not a failed cleanup.
Each plan line names the operation that will run.
- Wipe directory contents (
clear_dir): delete everything inside a cache directory, keep the directory. Used for DerivedData, CoreSimulator caches, simulator logs, xcodebuild, SwiftPM, Bun's install cache, Homebrew's download cache, and for npm/Yarn/pip/uv/CocoaPods when that tool is not on PATH. The path must resolve under an allowlist (~/Library/Caches,~/Library/Developer,~/Library/Logs,~/Library/pnpm,~/.npm,~/.local,~/.cache,~/.bun,~/.yarn, orbrew --cache)./and$HOMEare refused. - npm / Yarn / pip / uv / CocoaPods: when the tool is installed, run its own cache command (
npm cache clean --force,yarn cache clean,pip cache purge,uv cache clean,pod cache clean --all). - pnpm:
pnpm store pruneonly. That removes packages no project references. It does not delete the store directory. If pnpm is not installed, consuela leaves the store alone. - Homebrew: delete the contents of
brew --cache(downloaded bottles and source archives). This is notbrew cleanup --prune=all; old installed formula versions stay. - Docker:
docker system prune -affor--docker/--docker-all, ordocker system prune -ffor--docker-dangling. Neither command removes volumes.
Pull requests are welcome if you have a command that you think would be useful to add to the collection.
These are commands that I use with my development setup, so commands for other setups, languages, and tools may be missing. You are welcome to add them, but please include a description of the command and why it is useful in the pull request.
MIT. This is a collection of scripts, so do what you want with it.
