← ClaudeAtlas

optimize-claude-mdlisted

Audits CLAUDE.md files (root, nested, `.claude/rules/*.md`) for context bloat and emits ranked suggestions across two levers — (1) shrink inventory entries, (2) flag rarely-used agent-invokable skills that should become slash-only to drop their description from the always-on available-skills list. Triggers on Claude Code's "Large CLAUDE.md will impact performance" warning (> 40k chars), inventory entries duplicating harness-loaded skill descriptions, "CLAUDE.md is too big", "shrink CLAUDE.md", "optimize CLAUDE.md", "/optimize-claude-md". Three modes — `audit` (read-only ranked report + slash-conversion candidates), `trim` (interactive one-line hook + diff approval), `extract` (moves sections to linked files preserving content). Composes with `documentation` (Placement Resolver) and `create-skill` (invocation matrix). Hard rules: refuses files < 10k chars; never deletes silently; never edits any skill's canonical `SKILL.md` frontmatter — routes to `/create-skill`.
mthines/agent-skills · ★ 4 · Data & Documents · score 83
Install: claude install-skill mthines/agent-skills
# Optimize CLAUDE.md Reduces the recurring token cost of `CLAUDE.md` (and its nested + linked siblings) by identifying paragraph-length entries, redundant content, and hot-path bloat — then trimming or extracting them while preserving the canonical source. > **This `SKILL.md` is a thin index.** Detailed rules live in `rules/*.md` > and load on demand. Worked examples live in `references/*.md`. Reading > them all up-front would burn tokens you do not need yet. --- ## When to run Run when **any** of these hold: - Claude Code prints `Large CLAUDE.md will impact performance (Xk chars > 40.0k)` at session start. - The user asks "shrink", "optimize", "reduce", or "trim" CLAUDE.md. - A paragraph in CLAUDE.md exceeds 6 lines and is not a code block. - An inventory section duplicates content already loaded by the harness (e.g. skill `description` frontmatter, which is preloaded automatically). - A nested package `CLAUDE.md` repeats content from the root. Refuse if the target file is < 10k chars — see [`rules/hard-rules.md`](./rules/hard-rules.md). --- ## Mode Detection Parse `$ARGUMENTS` and detect the mode. First positional is mode; second is optional path (default `./CLAUDE.md`). | Mode | Default | Trigger | | --------- | ------- | ---------------------------------------------------------------- | | `audit` | **yes** | Default. Or `audit`, "review", "report", no mode argument. | | `trim` |