AGENT SKILL

cleaning-dev-caches

Use when this Mac's disk is nearly full, or the user asks to clear re-downloadable caches (「清缓存」「硬盘满了」, "clear caches") — Homebrew, npm / pnpm / yarn / bun / uv / pip, Gradle, Playwright browsers, Edge and VS Code updater caches, simulator dyld caches, unused Rust toolchains. Not for build output (cleaning-dev-build-artifacts) or personal files.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 76
Forks
17

01 前言 Front Matter

name
cleaning-dev-caches
description
Use when this Mac's disk is nearly full, or the user asks to clear re-downloadable caches (「清缓存」「硬盘满了」, "clear caches") — Homebrew, npm / pnpm / yarn / bun / uv / pip, Gradle, Playwright browsers, Edge and VS Code updater caches, simulator dyld caches, unused Rust toolchains. Not for build output (cleaning-dev-build-artifacts) or personal files.

03 SKILL.md 正文

Clear caches

Everything in the table below is downloaded or rebuilt again the next time it is needed. Before deleting, confirm one thing only: the program that owns it is not using it right now.

Before starting, record free space with df -h /System/Volumes/Data, and record each item's size with du -sh before deleting it. Skip any row whose command does not exist.

Cache Extra precondition Command
Homebrew downloads and old versions none brew cleanup -s --prune=all
npm none npm cache clean --force
npx packages pgrep -f _npx is empty (MCP servers started by npx run from here) rm -rf ~/.npm/_npx; npm cache clean does not touch this directory
pnpm store none pnpm store prune
bun run it in a directory with a package.json, otherwise it deletes nothing (cd <any JS repo> && bun pm cache rm)
yarn / uv / pip none yarn cache clean / uv cache clean / pip3 cache purge
Gradle pgrep -f GradleDaemon is empty rm -rf ~/.gradle/caches
Playwright browsers no e2e run in progress rm -rf ~/Library/Caches/ms-playwright ~/Library/Caches/ms-playwright-go; tell the user to run npx playwright install before the next e2e run
Microsoft Edge pgrep -x "Microsoft Edge" is empty rm -rf ~/Library/Caches/Microsoft\ Edge
VS Code update leftovers VS Code is closed rm -rf ~/Library/Caches/com.microsoft.VSCode.ShipIt
Simulator dyld cache stale ones only, see below xcrun simctl runtime dyld_shared_cache remove <runtime>
Unused Rust toolchains pgrep -x cargo and pgrep -x rustc are empty; keep list below rustup toolchain uninstall <name>

Simulator dyld cache: /Library/Developer/CoreSimulator/Caches/dyld/<host build>/<runtime>/. A cache is stale only when its host build differs from sw_vers -buildVersion or its runtime is no longer in xcrun simctl runtime list. Deleting the current one reclaims nothing: the next simulator launch rebuilds it as it was.

Rust toolchains: keep stable, the default (rustup default), every directory override (rustup override list), custom toolchains linked with rustup toolchain link (they are not re-downloadable), *-sbpf-solana-* (installed by Solana's build tools), and every channel pinned in a rust-toolchain or rust-toolchain.toml anywhere under {{DEV_ROOT}}. The rest of ~/.rustup/toolchains can be uninstalled.

When a precondition fails (Edge is open, say), skip that row and tell the user at the end how to clear it later. When a permission check or classifier blocks an rm -rf, do not route around it; hand the command to the user to run themselves (in Claude Code: ! <command>).

Keep, do not touch

  • ~/.claude/projects: Claude Code's session transcripts; usage tools such as ccusage read them.
  • The conda installation itself (for example /opt/homebrew/Caskroom/miniconda): projects run their environments from it.
  • Installed iOS simulator runtimes: projects run their tests on them.
  • No need for conda clean -a: packages are hard-linked into the environments, so it reclaims almost nothing.

Wrap up

Run df -h /System/Volumes/Data again and report what each item reclaimed, which items were skipped and why, and free space before and after.

04 同仓库更多 Skills

etherfunlab
etherfunlab/workflow

doc-review

Use when reviewing docs in this repo (team version).

★ 76
etherfunlab
etherfunlab/workflow

zh-hant-converter

Use when Simplified Chinese text needs a Traditional Chinese version — internal team docs converted with opencc s2hk, or a product's Simplified Chinese UI copy mirrored into its Traditional Chinese locale — or when the user says 转繁, 同步繁体, or "convert to zh-Hant".

★ 76
etherfunlab
etherfunlab/workflow

cleaning-dev-build-artifacts

Use when this Mac's disk is nearly full, or the user asks to clean build output — Rust target/ dirs or Claude Code worktrees (.claude/worktrees) under {{DEV_ROOT}} (「清编译产物」「清 target」「清 worktree」「硬盘满了」, "clean build artifacts"). Not for package-manager or app caches (cleaning-dev-caches) or personal files.

★ 76
etherfunlab
etherfunlab/workflow

ios-keyboard-page-shift

Use when, on iPhone Safari or an iOS WebView, a page or a full-screen app shell (top bar, scrolling list, bottom input) moves up when a text field is focused and stays up after the keyboard closes, leaving the top bar off-screen, the input mid-screen and an empty band below it, or when an earlier fix for that symptom did not hold.

★ 76
etherfunlab
etherfunlab/workflow

codex-review

Use when the user asks to review a branch, PR or diff with codex ("review this with codex", 用 codex 审一下, "codex review PR N"). Runs `codex exec` from the shell with a hand-written, repo-aware prompt; falls back to one OpenRouter GPT call only when codex is out of quota. Covers the invocation contract and the failure modes that make codex look dead or silently produce no report.

★ 76
etherfunlab
etherfunlab/workflow

doc-review

Use when a document for people to read has been fact-checked and polished and is one step from being pushed or published — the last gate before `git push` — or when the user asks for a final review (终审).

★ 76