mac-agent-hygiene

mac-agent-hygiene is a skill for Claude Code from MSApps-Mobile/claude-plugins. It costs 120 tokens per session (1,890 once invoked), scanned B, original, MIT.

A cleanup procedure for Macs used by coding agents. It checks disk usage, creates a dry-run plan showing what to remove or keep, and applies only a confirmed plan; a dry run previews changes without making them.

In plain words
What is it for?
Use it when the Mac is low on space, when old worktrees or caches need review, or when you want to install or check a daily cleanup task. It covers status checks, cleanup planning, and confirmed cleanup.
Why use it?
It helps free space while protecting uncommitted or unpushed work, active processes, browser profiles in use, and files needed by a current Xcode build.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

Part of the mac-agent-hygiene plugin — 1 skill, 1 command shipped together

Good fit Use it when the Mac is low on space, when old worktrees or caches need review, or when you want to install or check a daily cleanup task. It covers status checks, cleanup planning, and confirmed cleanup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/msapps-mobile/claude-plugins/mac-agent-hygiene
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 MSApps-Mobile/claude-plugins --skill mac-agent-hygiene
Clone the repo
git clone --depth 1 https://github.com/MSApps-Mobile/claude-plugins

Made for: Claude Code.

Or install mac-agent-hygiene, the plugin that ships this one along with the rest of its 1 skill, 1 command.

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 mac-agent-hygiene

README.md
[![agentmods](https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/mac-agent-hygiene/github.svg)](https://agentmods.dev/skills/msapps-mobile/claude-plugins/mac-agent-hygiene)
Your own site
<a href="https://agentmods.dev/skills/msapps-mobile/claude-plugins/mac-agent-hygiene"><img src="https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/mac-agent-hygiene/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 mac-agent-hygiene

Your own site · 80×15
<a href="https://agentmods.dev/skills/msapps-mobile/claude-plugins/mac-agent-hygiene"><img src="https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/mac-agent-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,890 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 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.00120 $0.01890
Opus 5.5 $0.00048 $0.00756
Sonnet 5.5 $0.00024 $0.00378
Haiku 4.5 $0.00012 $0.00189

Measured 4d ago against content hash 996f833f4e4c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

mac-agent-hygiene scanned grade B 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 4d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`cleanupPeriodDays` in `~/.claude/settings.json` (default 30). `hygiene_status` reports the current
plugins/mac-agent-hygiene/skills/mac-agent-hygiene/SKILL.md · 107 lines

How it starts

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

Mac Agent Hygiene

A Mac that runs Claude Code agents all day fills its disk in places no cleanup app looks: linked git worktrees that nobody removed, leftover plugin-install clones, browser-profile caches, Xcode build output. On one 926 GB machine these were 200+ GB while Downloads and Documents together held 2 GB. This skill, the bundled MCP server and the daily LaunchAgent exist so that never happens again on any Mac that installs the plugin.

The routine

Run the four MCP tools in this order. Never skip the plan.

  1. hygiene_status — read the snapshot: disk free, DerivedData size, leftover plugin clones, Playwright profiles (how many, how many locked / in use), worktrees total and stale, whether Xcode is building, whether the LaunchAgent is loaded, and the last log lines.
  2. hygiene_plan — dry run. Every candidate comes back with remove or keep, its size, and a reason. Read the keep reasons as carefully as the remove ones: dirty-uncommitted-work, unpushed-commits, a-process-is-inside, profile-in-use, xcode-building are the routine working. The plan returns a plan_id valid for 30 minutes.
  3. hygiene_apply with that plan_id and confirm: true — each item is re-checked at apply time by the same function that planned it; anything that changed since the plan is refused, not removed. Report removed / refused / MB freed from the result.
  4. hygiene_schedule action: "install" once per Mac — installs the LaunchAgent com.msapps.mac-agent-hygiene (default 04:30 daily); it copies hygiene.sh to ~/.local/share/mac-agent-hygiene/ so the job survives plugin updates — re-run install after an update. action: "status" later. The scheduled run is exactly plan + apply with no human in the loop, which is why the eligibility rules below are conservative by construction.

Without the MCP server (plain shell): bash scripts/hygiene.sh status | plan | run and bash scripts/install-launchd.sh install | status | uninstall.

Read the full file on GitHub · 107 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 107 lines · 120 tokens per session scan B 996f833f4e4c

Subscribe to this mod's changes

mac-agent-hygiene is a skill published in the GitHub repository MSApps-Mobile/claude-plugins (9 stars, last pushed yesterday), licensed MIT. It adds 120 tokens to every session and 1,890 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-08.