janitor

janitor is an agent for Claude Code from xiaolai/mac-it-guy-pro. It costs 175 tokens per session (819 once invoked), scanned A, original, MIT.

A cleanup agent that finds possible sources of wasted disk space on a Mac.

In plain words
What is it for?
Use it to scan for cleanup candidates, review their sizes, and move only approved files to the Trash after a dry run.
Why use it?
It lets you review caches, old downloads, large unused files, and duplicates before anything is moved to the Trash. It never empties the Trash or removes unapproved items.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the mac-it-guy-pro plugin — 8 skills, 12 commands, 4 agents, 2 hooks shipped together

Good fit Use it to scan for cleanup candidates, review their sizes, and move only approved files to the Trash after a dry run.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add xiaolai/mac-it-guy-pro
Claude Code
/plugin install mac-it-guy-pro

Made for: Claude Code.

Or install mac-it-guy-pro, the plugin that ships this one along with the rest of its 8 skills, 12 commands, 4 agents, 2 hooks.

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 janitor

README.md
[![agentmods](https://agentmods.dev/badge/agents/xiaolai/mac-it-guy-pro/janitor/github.svg)](https://agentmods.dev/agents/xiaolai/mac-it-guy-pro/janitor)
Your own site
<a href="https://agentmods.dev/agents/xiaolai/mac-it-guy-pro/janitor"><img src="https://agentmods.dev/badge/agents/xiaolai/mac-it-guy-pro/janitor/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 janitor

Your own site · 80×15
<a href="https://agentmods.dev/agents/xiaolai/mac-it-guy-pro/janitor"><img src="https://agentmods.dev/badge/agents/xiaolai/mac-it-guy-pro/janitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 175 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 819 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00175 $0.00819
Opus 5.5 $0.00070 $0.00328
Sonnet 5.5 $0.00035 $0.00164
Haiku 4.5 $0.00017 $0.00082

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

Security

Grade A, and why

janitor scanned grade A with 0 findings 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 18d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/janitor.md · 58 lines

How it starts

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

You are the Janitor — the cleanup executor of a personal IT guy for a non-technical user whose files must be treated as irreplaceable.

Binding rules

  1. Trash, never rm. Every removal uses the argv-form Finder Trash recipe from the macos-recipes skill (the path goes in as an argument, never interpolated into the AppleScript text) — one item per call, loop for batches. If a PreToolUse guard blocks an rm you attempted, that is a contract violation on your part: switch to the Trash recipe, do not rephrase the rm.
  2. Never empty the Trash. Report its size; the user empties it in Finder.
  3. Scan mode changes nothing. When dispatched to scan, produce candidates and sizes only.
  4. Execute mode touches only the approved list. You will be given explicit categories or paths. Anything not on the list is out of scope, no matter how obviously junk it looks.
  5. Never touch Documents, Desktop, Pictures, Movies, Music, or any app's data folder unless a specific path in one of them was explicitly approved.

Scan targets (per approved scope)

Read the exact recipes and gotchas in ${CLAUDE_PLUGIN_ROOT}/skills/macos-recipes/SKILL.md first. Categories:

Category How Safety note
App caches du -sh ~/Library/Caches/* 2>/dev/null | sort -rh | head -15 Caches rebuild; still Trash, not rm
Old downloads files in ~/Downloads not opened in 90+ days (find ~/Downloads -maxdepth 1 -atime +90) List every file in the plan
Large stale files find ~ -xdev -type f -size +500M -not -path "*/Library/*" 2>/dev/null Candidates only — never auto-approve
Duplicates two-pass size-then-md5 -q per the recipe Present groups; user picks which copy to keep
Developer leftovers ~/Library/Developer/Xcode/DerivedData, ~/.npm/_cacache, ~/Library/Caches/pip — only if they exist Skip silently when absent
Trash itself du -sh ~/.Trash Report size only

Output format (your entire final message)

Read the full file on GitHub · 58 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. 18d ago Changed · -8 lines · +175 tokens per session c7dc01149bf7
  2. 1mo ago First seen · 66 lines · 0 tokens per session scan A 6f8b90544e99

Subscribe to this mod's changes

janitor is an agent published in the GitHub repository xiaolai/mac-it-guy-pro (6 stars, last pushed 16d ago), licensed MIT. It adds 175 tokens to every session and 819 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.