claude-folder-janitor

claude-folder-janitor is a skill for Claude Code from MSApps-Mobile/claude-plugins. It costs 98 tokens per session (1,202 once invoked), scanned A, original, MIT.

A procedure for finding safe-to-remove clutter in Claude's data folder, such as old backups, empty session folders, stale cache files, and transcripts for missing project folders.

In plain words
What is it for?
Use it to list reclaimable space, confirm the list, delete only those paths, and check the result afterward.
Why use it?
It provides a dry run before deletion, so you can inspect each path, its size, and the reason it was selected. It avoids touching skills, plug-ins, settings, scheduled tasks, or history.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

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 claude-folder-janitor plugin — 1 skill, 1 command shipped together

Good fit Use it to list reclaimable space, confirm the list, delete only those paths, and check the result afterward.

Compare 6 skills 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 MSApps-Mobile/claude-plugins
Claude Code
/plugin install claude-folder-janitor

Made for: Claude Code.

Or install claude-folder-janitor, 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 claude-folder-janitor

README.md
[![agentmods](https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/claude-folder-janitor/github.svg)](https://agentmods.dev/skills/msapps-mobile/claude-plugins/claude-folder-janitor)
Your own site
<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.

agentmods 80×15 button for claude-folder-janitor

Your own site · 80×15
<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>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,202 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.00098 $0.01202
Opus 5.5 $0.00039 $0.00481
Sonnet 5.5 $0.00020 $0.00240
Haiku 4.5 $0.00010 $0.00120

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

Security

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.

plugins/claude-folder-janitor/skills/claude-folder-janitor/SKILL.md · 74 lines

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/projects or ~/.claude/session-env taking real space.

Procedure: plan, confirm, apply, verify

  1. Dry run first, always. Run /janitor (or bash "${CLAUDE_PLUGIN_ROOT}/scripts/janitor.sh"). Nothing is deleted. Each line is rule<TAB>KB<TAB>path<TAB>reason, then one summary line.
  2. Show the user the list grouped by rule, with sizes and the reclaimable total.
  3. Apply only after the user confirms. /janitor apply re-derives the same list and deletes exactly those paths, then prints removed, failed, KB freed and elapsed seconds.
  4. Verify. Report the summary line. If failed is 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.

Read the full file on GitHub · 74 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. 10d ago First seen · 74 lines · 98 tokens per session scan A 30e5d9ef43a7

Subscribe to this mod's changes

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.

Related

claude-folder-janitor compared with skills from other repositories

claude-folder-janitor next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
claude-folder-janitorMSApps-Mobile/claude-pluginsSkill10yesterdayMITA98Claude Code
housecleanSethGammon/CitadelSkill927yesterdayMITA89Claude Code
scheduleSethGammon/CitadelSkill927yesterdayMITA41Claude Code
setupme2resh/apexyardSkill542yesterdayMITA26Claude Code
career-portfoliomodu-ai/moai-coworkSkill31528d agoApache-2.0A124Claude Code
hr-operationsmodu-ai/moai-coworkSkill31528d agoApache-2.0A91Claude Code
cipp-mailboxesWYRE-AI/msp-claude-pluginsSkill52yesterdayApache-2.0A51Claude Code