Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By MSApps-Mobilev0.1.10MITIn 1 marketplace
Frees disk space on a Mac running Claude Code agents by clearing regenerable caches and reaping stale git worktrees, after a dry run you confirm. A daily LaunchAgent can run it on schedule; it keeps worktrees with uncommitted or unpushed work.
Trending plugins
7-day copy clicks
You run one by typing its /name in Claude Code.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Keeps a Mac that runs Claude Code agents from filling its disk. A daily LaunchAgent plus an MCP server that clear regenerable caches and reap stale git worktrees — after a dry run, with per-item reasons, and only for things that are already somewhere else.
Home page: https://claudeservices.ai/plugins#mac-agent-hygiene
On one 926 GB Mac running Claude Code agents, free space had fallen to 16 GB. Downloads, Documents and Desktop together held 2 GB. The space was in:
| Where | Size | What it was |
|---|---|---|
~/code/*wt-* | most of the 233 GB under ~/code | 774 linked git worktrees (up to 1 GB each) agents created per task and never removed |
~/.claude/plugins/cache/temp_git_* | 34 GB | 937 leftover clones from plugin installs |
~/.cache/playwright-* | 7 GB | agent browser profiles — half of it Chromium's regenerable caches |
~/Library/Developer/Xcode/DerivedData | 6 GB | build output |
~/.claude/projects | 13 GB | session transcripts (Claude Code prunes these itself) |
This plugin turns the fix into a routine any Mac can install:
hygiene_status — read-only snapshot.hygiene_plan — dry run: every candidate with remove / keep, size and reason.hygiene_apply — removes only the planned items, re-checking each one at apply time; needs the
plan_id and confirm: true.hygiene_schedule — install / inspect / remove the daily LaunchAgent (com.msapps.mac-agent-hygiene,
04:30 by default).A worktree is removed only when it is untouched for 7 days, clean, nobody's current directory, and
its HEAD is pushed (or is the head of a merged pull request, or every local-only commit of a rebased
branch appears in that branch's merged pull request). Browser profiles are logins: only their
cache subfolders go; cookies and local storage stay. DerivedData is skipped while Xcode builds. The
full reasoning is in skills/mac-agent-hygiene/references/safety-model.md.
First real run on the reference machine: 420 worktrees removed (133 GB), 80 kept because they were dirty, unpushed or in use; disk went from 16 GB free to 219 GB free.
gh, authenticated — enables the merged-PR check for squash-merged worktrees.
Without it the routine keeps any worktree whose HEAD is not on a remote ref.sudo. Nothing is installed outside ~/Library/LaunchAgents, ~/Library/Logs and
~/.local/share/mac-agent-hygiene (a stable copy of hygiene.sh the LaunchAgent runs, so a plugin
update never leaves the scheduled job pointing at a moved file — re-run install after updating).Claude Code:
/plugin marketplace add MSApps-Mobile/claude-plugins
/plugin install mac-agent-hygiene@msapps-plugins
Cowork: Settings → Plugins → Marketplaces → Add → MSApps-Mobile/claude-plugins → search
mac-agent-hygiene → Install.
Ask Claude: "hygiene status" — then "plan a cleanup". Read the keep reasons; they are the
routine protecting work in progress.
"apply the plan" removes the planned items. "install the hygiene agent" schedules the daily run.
The log is ~/Library/Logs/mac-agent-hygiene.log.
~/.config/mac-agent-hygiene/config.env:
HYG_WT_ROOT="$HOME/code" # where agent worktrees live
HYG_WT_GLOB="*wt-*" # how they are named
HYG_WT_NESTED="wt _worktrees" # also ~/code/wt/*/... and ~/code/_worktrees/*/... (agent worktrees); "" = off
HYG_WT_DEPTH=3
HYG_WT_AGE_DAYS=7
HYG_MODEL_CACHES="$HOME/.cache/whisper $HOME/.cache/codex-runtimes"
HYG_MODEL_CACHE_AGE_DAYS=7 # model caches go only when idle this long
HYG_SCAFFOLD_ARCHIVE="$HOME/.local/state/mac-agent-hygiene/scaffold-archive" # where agent scaffolding is tarred before its worktree goes
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub msapps-mobile/claude-plugins --plugin mac-agent-hygienePlugins from other owners that cover similar ground