slim-claude-mdlisted
Install: claude install-skill DmitriyYukhanov/claude-plugins
# Slim a CLAUDE.md
CLAUDE.md loads in full on every session. Past roughly 200 lines it costs context on every request
*and* reduces adherence, so instructions get ignored precisely because there are too many of them.
This moves subsystem detail into `.claude/rules/` files that load only when the matching files are
opened, and proves the move lost nothing.
**Scope:** restructuring an existing file. Writing a CLAUDE.md from scratch is `/init`'s job; auditing
content quality against templates is what `claude-md-management`'s `claude-md-improver` does.
Mechanics (load order, `paths:` syntax, the `@import` trap, `/doctor`, hierarchy) live in
[references/mechanics.md](references/mechanics.md). Read the section you need when you need it.
## Phase 1 — Measure
```bash
python "${CLAUDE_PLUGIN_ROOT}/skills/slim-claude-md/scripts/audit_claude_md.py" CLAUDE.md
```
Reports loaded size (HTML comments excluded, since they are stripped before loading), ranks sections
by size, marks the set whose removal gets you under budget, and flags derivable content plus
staleness hints. Exit 1 means over budget.
Run it on every CLAUDE.md in the repo, not just the root one: `find . -name CLAUDE.md -not -path "*/node_modules/*"`.
**If the file is within budget, stop and say so.** Do not restructure a file that is already fine.
## Phase 2 — Decide what moves
For each section, apply the documented test: **"Would removing this cause Claude to make mistakes?
If not, cut it."** Then sort what remains