build-cache-clean

build-cache-clean is a skill for Claude Code from markdavidgan/apple-dev-skills. It costs 144 tokens per session (1,196 once invoked), scanned C, original, MIT.

A cleanup guide for deleting regenerable build and development caches from Apple projects and common developer tools. It covers Swift Package Manager, Xcode, simulators' caches, npm, pnpm, pip, Homebrew, and Playwright caches while preserving source files and simulator device data.

In plain words
What is it for?
Use it when a development machine or repository is low on disk space and you need to reclaim room without deleting source code, simulator devices, or model data.
Why use it?
Build caches can consume large amounts of disk space even though they can be recreated. This identifies the likely space users and separates safe cache removal from data that should be kept.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the apple-dev-skills plugin — 62 skills, 25 commands, 7 agents shipped together

Good fit Use it when a development machine or repository is low on disk space and you need to reclaim room without deleting source code, simulator devices, or model data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/markdavidgan/apple-dev-skills/build-cache-clean
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add markdavidgan/apple-dev-skills --skill build-cache-clean
Clone the repo
git clone --depth 1 https://github.com/markdavidgan/apple-dev-skills

Made for: Claude Code.

Or install apple-dev-skills, the plugin that ships this one along with the rest of its 62 skills, 25 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for build-cache-clean

README.md
[![agentmods](https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/build-cache-clean/github.svg)](https://agentmods.dev/skills/markdavidgan/apple-dev-skills/build-cache-clean)
Your own site
<a href="https://agentmods.dev/skills/markdavidgan/apple-dev-skills/build-cache-clean"><img src="https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/build-cache-clean/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for build-cache-clean

Your own site · 80×15
<a href="https://agentmods.dev/skills/markdavidgan/apple-dev-skills/build-cache-clean"><img src="https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/build-cache-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,196 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00144 $0.01196
Opus 5.5 $0.00058 $0.00478
Sonnet 5.5 $0.00029 $0.00239
Haiku 4.5 $0.00014 $0.00120

Measured 1mo ago against content hash 0de3d7cdda2b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-04, from the pricing page.

Security

Grade C, and why

build-cache-clean scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf path/to/repo/.build
platforms/claude/skills/build-cache-clean/SKILL.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Build Cache Clean

Frees disk space by deleting regenerable build output, never source, device state, or model data. Every path here is gitignored and safe to delete — the next build/install recreates it.

Find the big offenders first

.build/ and Xcode build/ directories are invisible to a plain top-level du because they're dotfiles or nested — always check explicitly, per repo:

# Overall disk headroom
df -h /

# Per-repo SwiftPM + Xcode build dirs (the usual multi-GB culprits)
find ~/code -maxdepth 4 -type d \( -name ".build" -o -name "build" \) -exec du -sh {} \; 2>/dev/null

# Global Xcode caches (shared across all repos, not per-repo)
du -sh ~/Library/Developer/Xcode/DerivedData
du -sh ~/Library/Developer/Xcode/Archives
du -sh ~/Library/Developer/CoreSimulator/Caches

# Simulator device data (see caution below — usually NOT cache to clear)
du -sh ~/Library/Developer/CoreSimulator/Devices/*/

A repo's .build/ (SwiftPM module cache + resolved build products) and build/ (Xcode build products) commonly dwarf everything else in the tree combined — 50–100+ GB is normal for an actively developed multi-target app after months without a clean.

Safe to delete — regenerates on next build

# Per-repo SwiftPM build cache
rm -rf path/to/repo/.build
rm -rf path/to/repo/apps/<app>/.build

# Per-repo/target Xcode build products
rm -rf path/to/repo/apps/<app>/build

# Global Xcode DerivedData (shared cache across all Xcode projects)
rm -rf ~/Library/Developer/Xcode/DerivedData/*

# Global CoreSimulator caches (not device data — see below)
rm -rf ~/Library/Developer/CoreSimulator/Caches/*

Verify a path is actually gitignored before deleting if you didn't create it yourself:

git -C path/to/repo check-ignore -v .build build

Adjacent dev-tool caches, same trip

These aren't Apple-specific but pile up alongside Xcode caches on the same machine and are equally safe to clear:

npm cache clean --force
pnpm store prune                      # only removes unreferenced packages
pip cache purge
brew cleanup -s

rm -rf ~/Library/Caches/ms-playwright/*      # browser binaries, redownload on demand
rm -rf ~/Library/Caches/<Browser>/*          # e.g. "Microsoft Edge", "Google Chrome" render caches
rm -rf ~/Library/Caches/typescript/*
rm -rf ~/Library/Caches/node-gyp/*

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 97 lines · 144 tokens per session scan C 0de3d7cdda2b

Subscribe to this mod's changes

build-cache-clean is a skill published in the GitHub repository markdavidgan/apple-dev-skills (5 stars, last pushed 1mo ago), licensed MIT. It adds 144 tokens to every session and 1,196 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

asc-revenuecat-catalog-sync

Reconcile App Store Connect subscriptions and in-app purchases with RevenueCat products, entitlements, offerings, and packages using asc and RevenueCat MCP. Use when setting up or syncing subscription catalogs across ASC and RevenueCat.

rorkai/app-store-connect-cli-skills · 51 tokens

asc-localize-metadata

Automatically translate and sync App Store metadata (description, keywords, what's new, subtitle) to multiple languages using LLM translation and asc CLI. Use when asked to localize an app's App Store listing, translate app descriptions, or add new languages to App Store Connect.

rorkai/app-store-connect-cli-skills · 60 tokens

asc-shots-pipeline

Orchestrate iOS screenshot automation with xcodebuild/simctl for build-run, AXe for UI actions, JSON settings and plan files, Koubou-based framing (asc screenshots frame), and screenshot upload (asc screenshots upload). Use when users ask for automated screenshot capture, AXe-driven simulator flows, frame composition…

rorkai/app-store-connect-cli-skills · 79 tokens

asc-metadata-sync

Sync, validate, and apply App Store metadata with the current asc canonical metadata workflow. Use when updating metadata, localizations, keywords, or migrating legacy fastlane metadata.

rorkai/app-store-connect-cli-skills · 39 tokens

asc-release-flow

Orchestrate App Store releases with asc, including staging a version, uploading or building an artifact, publishing, and submitting for review. Use when the user wants to prepare or execute a release. Keep Game Center item preparation in this skill; route other readiness failures, stuck submissions, cancellation, and…

rorkai/app-store-connect-cli-skills · 71 tokens

asc-submission-health

Diagnose App Store submission blockers and operate review health with asc, including readiness validation, repair routing, status monitoring, cancellation, and retry decisions. Use when validation fails, a version is not in a valid state, review status is unclear or stuck, or a failed submission must be repaired and…

rorkai/app-store-connect-cli-skills · 82 tokens