mise-clean

mise-clean is a command for Claude Code from emadd/mise-en-claude. It costs 56 tokens per session (1,371 once invoked), scanned A, original, MIT.

A consent-first project cleanup command that finds tracked junk, temporary files, stale branches, and unused Git worktrees.

In plain words
What is it for?
Use it to review build output, editor clutter, backups, logs, scratch files, branches, worktrees, and outdated project guidance.
Why use it?
It makes cleanup safer by reporting findings first, preserving user files where possible, and requiring approval before deletion or untracking.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md.

Good fit Use it to review build output, editor clutter, backups, logs, scratch files, branches, worktrees, and outdated project guidance.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/emadd/mise-en-claude/mise-clean
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.

Clone the repo
git clone --depth 1 https://github.com/emadd/mise-en-claude

Made for: Claude Code.

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 mise-clean

README.md
[![agentmods](https://agentmods.dev/badge/commands/emadd/mise-en-claude/mise-clean/github.svg)](https://agentmods.dev/commands/emadd/mise-en-claude/mise-clean)
Your own site
<a href="https://agentmods.dev/commands/emadd/mise-en-claude/mise-clean"><img src="https://agentmods.dev/badge/commands/emadd/mise-en-claude/mise-clean/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 mise-clean

Your own site · 80×15
<a href="https://agentmods.dev/commands/emadd/mise-en-claude/mise-clean"><img src="https://agentmods.dev/badge/commands/emadd/mise-en-claude/mise-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,371 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.00056 $0.01371
Opus 5 $0.00028 $0.00685
Sonnet 5 $0.00011 $0.00274
Haiku 4.5 $0.00006 $0.00137

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

Security

Grade A, and why

mise-clean 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.

commands/mise-clean.md · 71 lines

How it starts

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

You are running the hygiene sweep — "clean as you go, sweep the line at close." Same mise ethos as everything else: consent-first, non-destructive, snapshot-first. Report first, then act on a yes, one category at a time. Never blind-delete, never git clean -fdx, never rewrite history to "tidy," and never touch a file that might hold a secret (defer to the secret protocol — do not ingest the value). Focus: $ARGUMENTS if given, otherwise sweep it all.

Survey, then present findings grouped, each with a one-line "why it's cruft" and the exact fix:

  1. Junk tracked in git that shouldn't be. Build output (DerivedData/, build/, .next/, dist/, target/), dependencies (node_modules/), OS/editor cruft (.DS_Store, *.xcuserstate). Fix = untrack but keep on disk: git rm --cached and add the pattern to .gitignore in the same step (untracking without ignoring isn't durable — a later git add re-tracks it). Removes bloat from the repo without deleting the user's files.
  2. Backup & scratch cruft. mise's own .bak-* files and .mise-backup/, a resolved HANDOFF.md, stray *.log, temp/scratch dirs. These are deletable — list them and delete only on a yes.
  3. Git detritus. Local branches already merged into the main line (offer to delete), orphaned worktrees (especially leftover mise-cook brigade lanes — git worktree list, then prune the stale ones), stale stashes (report; never auto-drop). Branch and worktree removals are recoverable from the reflog for a while — say so.
  4. Untracked files. Separate real-looking work from junk. Never delete untracked files blindly — they may be the user's uncommitted work. List them, sort into "looks like junk" vs "looks like work," and let the user decide per item or per category.

Optional — the CLAUDE.md audit (opt-in; don't run it by default). The four sweeps above are cheap surveys of files that shouldn't be there. This one is different: the file should be there, but its contents rot — and verifying that means reading the code, which is a real context spend. So it runs only when asked (a focus arg like "audit CLAUDE.md" / "check the brain"), or when the user takes you up on the one-line offer at close. Never bundle it into a routine sweep.

It belongs in the hygiene lens because CLAUDE.md is cruft's worst hiding place: it's written once and then read by every future session — by an agent that believes it. A stale line doesn't just sit there like a .DS_Store; it actively misinforms every run that follows, and every surplus line is a tax on every session's context. Same consent contract as the rest of this sweep — fix what you can prove wrong, propose the rest, never blind-delete.

  • Stale — names a path, script, flag, or command that changed or vanished. Verify it (ls the path, run or grep the command; don't reason about whether it's probably still true). Verified stale is a fact, not a judgment: fix it and report it in a line.
  • Duplicated — restates the README/ARCHITECTURE/docs, and has since drifted from them. The doc is the source of truth: propose replacing it with a one-line pointer.
  • Generic — advice a competent model already has ("write tests", "use types"). Pure context tax: propose the cut.
  • Unearned — a rule the code doesn't actually follow. Flag it, never cut it — it may be a live intent rather than dead weight.

Weigh every cut by what it costs to be wrong: a wrong trim silently removes a guardrail and nobody notices until it bites; a wrong keep costs some tokens. So the default is keep and flag, and "I don't see why this is here" is a reason to ask, not to delete. Watch the one real failure mode: stripping the odd, hyper-specific gotchas — the highest value-per-token lines in the file — because they look like one-offs out of context. A weird rule is evidence of a scar. Group findings into a few real decisions with the diff and the reason, never a line-by-line checkbox cart. A tight, accurate brain earns a one-sentence "it's current" — not a manufactured trim.

Read the full file on GitHub · 71 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 · 71 lines · 56 tokens per session scan A acc863cd8ded

Subscribe to this mod's changes

mise-clean is a command published in the GitHub repository emadd/mise-en-claude (51 stars, last pushed 1mo ago), licensed MIT. It adds 56 tokens to every session and 1,371 once invoked, about $0.0003 per session on Opus 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-30.