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.
/plugin marketplace add MSApps-Mobile/claude-plugins/plugin install claude-folder-janitorWrote 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.
[](https://agentmods.dev/skills/msapps-mobile/claude-plugins/claude-folder-janitor)<a href="https://agentmods.dev/skills/msapps-mobile/claude-plugins/claude-folder-janitor"><img src="https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/claude-folder-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.
<a href="https://agentmods.dev/skills/msapps-mobile/claude-plugins/claude-folder-janitor"><img src="https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/claude-folder-janitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00098 | $0.01202 |
| Opus 5.5 | $0.00039 | $0.00481 |
| Sonnet 5.5 | $0.00020 | $0.00240 |
| Haiku 4.5 | $0.00010 | $0.00120 |
Grade A, and why
claude-folder-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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Claude Folder Janitor
Purpose and boundaries
~/.claude/ grows quietly. Most of it is session transcripts in projects/, and many of those belong to
folders that no longer exist (deleted git worktrees, scratch directories). Claude Code also leaves empty
session-env/ folders and old .claude.json backups behind. This skill removes only those, and only
after showing the list.
When to use
- The user asks to clean, shrink or tidy
~/.claude, or to remove old or orphaned transcripts. - A disk check shows
~/.claude/projectsor~/.claude/session-envtaking real space.
Procedure: plan, confirm, apply, verify
- Dry run first, always. Run
/janitor(orbash "${CLAUDE_PLUGIN_ROOT}/scripts/janitor.sh"). Nothing is deleted. Each line isrule<TAB>KB<TAB>path<TAB>reason, then onesummaryline. - Show the user the list grouped by rule, with sizes and the reclaimable total.
- Apply only after the user confirms.
/janitor applyre-derives the same list and deletes exactly those paths, then prints removed, failed, KB freed and elapsed seconds. - Verify. Report the summary line. If
failedis not 0, show the stderr lines; a second dry run should list nothing that was just removed.
What is eligible (four rules, nothing else)
| Rule | Path | Eligible when |
|---|---|---|
backup |
~/.claude/backups/.claude.json.backup.* |
not among the newest JANITOR_KEEP_BACKUPS (default 1) |
session-env |
~/.claude/session-env/<id>/ |
empty and untouched for JANITOR_MIN_AGE_DAYS (default 7) |
changelog |
~/.claude/cache/changelog.md |
its newest entry is more than one release behind claude --version (Claude Code fetches it again when needed) |
orphan |
~/.claude/projects/<encoded-path>/ |
the cwd recorded in its transcripts does not exist, and no existing folder encodes to its name, and nothing in it changed for JANITOR_MIN_AGE_DAYS |
The orphan rule needs both checks because a project folder name replaces every non-alphanumeric character
with -, so /a/b-c and /a/b/c encode the same. The janitor walks the disk following every folder
whose encoding matches; if any exists, the project is kept.
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.
- 10d ago First seen · 74 lines · 98 tokens per session scan A 30e5d9ef43a7
claude-folder-janitor is a skill published in the GitHub repository MSApps-Mobile/claude-plugins (10 stars, last pushed yesterday), licensed MIT. It adds 98 tokens to every session and 1,202 once invoked, about $0.0004 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-10-27.
claude-folder-janitor compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| claude-folder-janitorMSApps-Mobile/claude-plugins | Skill | 10 | yesterday | MIT | A | 98 | Claude Code |
| housecleanSethGammon/Citadel | Skill | 927 | yesterday | MIT | A | 89 | Claude Code |
| scheduleSethGammon/Citadel | Skill | 927 | yesterday | MIT | A | 41 | Claude Code |
| setupme2resh/apexyard | Skill | 542 | yesterday | MIT | A | 26 | Claude Code |
| career-portfoliomodu-ai/moai-cowork | Skill | 315 | 28d ago | Apache-2.0 | A | 124 | Claude Code |
| hr-operationsmodu-ai/moai-cowork | Skill | 315 | 28d ago | Apache-2.0 | A | 91 | Claude Code |
| cipp-mailboxesWYRE-AI/msp-claude-plugins | Skill | 52 | yesterday | Apache-2.0 | A | 51 | Claude Code |