---name: claude-md-slimdescription: Shrinks a bloated CLAUDE.md by moving knowledge-dump content into load-on-demand files and rewriting the always-loaded file as a thin routing layer, with nothing lost. Use when the user says "CLAUDE.md is too big", "clean up CLAUDE.md", "slim CLAUDE.md", "reduce CLAUDE.md tokens", or when a CLAUDE.md is clearly over its token budget (over about 2,000 tokens for a small project, 4,000 medium, 6,000 large). Not for a sparse CLAUDE.md that needs sections added.license: "CC BY 4.0. Credit: CLAUDE.md Slim, a free skill from HumanSpark.ai (https://humanspark.ai/claude-md-slim/)"---# CLAUDE.md SlimShrink a bloated CLAUDE.md by moving content into files that load only when needed, and rewriting thealways-loaded file as a **thin routing layer**.## The mental model**CLAUDE.md is a routing layer, not a knowledge dump.** It should answer two questions and nothing else:1. *What kind of assistant am I on this project?* (identity, non-negotiable rules, design philosophy)
When to use it
Your CLAUDE.md has turned into a knowledge dump.
> CLAUDE.md is too big
Every session starts slower because of the context load.
> reduce CLAUDE.md tokens
You've inherited a project with a sprawling CLAUDE.md.
> clean up CLAUDE.md
You want a routing layer, not a manual.
> slim CLAUDE.md
New to skills? A skill is a saved set of instructions your AI assistant reads whenever the job comes up, so you set it up once and it works the same way every time. AI Skills for Teams explains how they work.
More than a cut-down
Cutting words is easy. CLAUDE.md Slim shrinks a bloated file by moving knowledge-dump content into load-on-demand files and rewriting the always-loaded file as a thin routing layer. Everything that matters stays - just where it belongs.
What it does
It treats CLAUDE.md as a routing layer with one job: answer two questions well. What kind of assistant are you on this project? Where should I look next? Everything else loads on demand, and that's where the tokens go. The only measure that matters is whether the routing layer answers those two questions clearly enough that sessions don't get lost.
It runs a six-phase workflow. First, measure the file and find other always-loaded files - understanding what's loaded matters. Second, find the docs that could already absorb the content. This is the most important phase and the easiest to skip. A section that looks like it needs a new home often has one already. Third, sort every section into buckets: what stays in CLAUDE.md, what moves out, what gets deleted with no destination.
Fourth, show the user the plan and get approval before touching any file. Fifth, make the moves: create archive files first, append to existing docs, rewrite CLAUDE.md last. Sixth, check and report the new size.
One real clean-up went from 277 lines and about 14,000 tokens - more than twice the budget - to 105 lines and about 1,800 tokens. That's an 87% cut with nothing lost because everything that mattered moved somewhere sensible and nothing that works was deleted.
What it won't do
It won't slim a CLAUDE.md that's already under budget. It'll tell you the size and ask what you want to improve instead. It also won't shrink a sparse CLAUDE.md that needs sections added before it gets smaller, and it never deletes knowledge with nowhere to go.
More free skills
To review what belongs in CLAUDE.md and when, CLAUDE.md Discipline covers token budgets and always-loaded tiers. If you're moving content into skills, Skill Authoring shows what makes a skill actually activate. The full set is on the skills page.
How to install it
It's one file with no code in it, so read it first: you'll see exactly what it tells your assistant to do.
Claude Code
Download the skill and unzip it.
Put the folder in ~/.claude/skills/ to use it in every project, or in .claude/skills/ inside one project.
Start a new session. It loads by itself when the job comes up.
Commit a project's .claude/skills/ folder and your whole team gets the skill.
The skill
Download the zip and upload it wherever your assistant takes skills. Or copy the whole block below into any AI assistant: the first lines ask it to save the rest as a skill, so you only do this once.
Please install the skill below for me.
Save everything between the BEGIN SKILL and END SKILL lines as a new skill called "claude-md-slim", exactly as written. If you can't create skills, save it as custom instructions or as a project instead. When it's saved, tell me in one line how to use it.
===== BEGIN SKILL =====
---
name: claude-md-slim
description: Shrinks a bloated CLAUDE.md by moving knowledge-dump content into load-on-demand files and rewriting the always-loaded file as a thin routing layer, with nothing lost. Use when the user says "CLAUDE.md is too big", "clean up CLAUDE.md", "slim CLAUDE.md", "reduce CLAUDE.md tokens", or when a CLAUDE.md is clearly over its token budget (over about 2,000 tokens for a small project, 4,000 medium, 6,000 large). Not for a sparse CLAUDE.md that needs sections added.
license: "CC BY 4.0. Credit: CLAUDE.md Slim, a free skill from HumanSpark.ai (https://humanspark.ai/claude-md-slim/)"
---
# CLAUDE.md Slim
Shrink a bloated CLAUDE.md by moving content into files that load only when needed, and rewriting the
always-loaded file as a **thin routing layer**.
## The mental model
**CLAUDE.md is a routing layer, not a knowledge dump.** It should answer two questions and nothing else:
1. *What kind of assistant am I on this project?* (identity, non-negotiable rules, design philosophy)
2. *Where should I look next?* (a table pointing to docs, skills and code locations)
Everything else loads on demand. **The test for every paragraph: would removing it only hurt one kind of task?**
If yes, it belongs in a subsystem doc, a skill or `docs/HISTORY.md`, not in CLAUDE.md.
## Token budgets
- Small projects: under 2,000 tokens. Medium: under 4,000. Large: under 6,000.
- Tighter targets when good load-on-demand docs exist: small about 800 to 1,500, medium 1,500 to 2,500, large
2,000 to 3,500.
Measure with a real tokenizer where you can. As a rough working estimate, words x 1.4.
## Workflow
### Phase 1: Measure
Measure the file and find the other always-loaded files in one go:
```bash
wc -l -w -c CLAUDE.md
find . -name "CLAUDE.md" -o -name "CLAUDE.local.md"
find . -type d -name ".claude" -exec ls {}/rules/ \;
```
Files in `.claude/rules/*.md` are always loaded too, so they count against the same budget. If CLAUDE.md is already
under budget, tell the user its size and ask whether to slim further or stop.
### Phase 2: Find the homes that already exist
**This is the most important phase and the easiest to skip.** Before planning any new file, find the docs that
could already absorb the content:
```bash
ls docs/
ls .claude/skills/
find docs -name "*.md" -type f | head -30
```
Read the likely candidates (an architecture doc, a reference or gotchas doc, a history file, a doc per subsystem).
A section that looks like it needs a new home often has one already. In one real clean-up, the plan was to create a
new gotchas file, until reading the existing reference doc showed it already covered about 90% of the same gotchas.
The right move was to delete the duplicates and point at the existing doc.
**Rule:** prefer existing docs. Create a new file only when nothing existing can take the content.
### Phase 3: Sort every section
Walk CLAUDE.md top to bottom and put each section in one bucket.
**Stays in CLAUDE.md:**
- **Identity:** the project's name and purpose in a paragraph, its design philosophy and quality bar.
- **Non-negotiable rules** that apply on every turn, whatever the task.
- **Routing:** the "where to look next" table, a module map, a small key-flow diagram.
- **Build and test essentials:** the 2 to 5 commands people run most, plus pointers to `--help` or the README.
- **Security boundaries:** credential locations, ignored paths, what the system can and cannot do.
- **Recent phases:** the last 3 to 5 entries, as a "what's happening now" signal.
**Moves out:**
- **Subsystem gotchas** to the existing reference or gotchas doc.
- **Workflow procedures** ("after running X, always do Y") to a skill or a workflow doc.
- **Reference data** (lists of types, themes, class catalogues) and **long examples** to subsystem docs.
- **Deep architecture detail** to subsystem docs.
- **History past about five entries** to `docs/HISTORY.md`, keeping the last 3 to 5 inline.
**Deleted, with no destination:**
- **Duplicates of your global CLAUDE.md or rules files.** If the global version is the authority, delete the
project copy.
- **Self-evident instructions** ("break large tasks down").
- **Flag lists that repeat `--help`.** Point at `--help` and keep only the 2 or 3 flags with surprising usage.
- **Tables that duplicate another list** in the same file.
- **Anything you can rediscover from the code, the tests or the git history.**
### Phase 4: Show the plan and get approval
Before touching any file, show the user:
1. **Current size against budget:** "CLAUDE.md is about X,XXX tokens; the budget for a medium project is 4,000."
2. **What moves where:** one line per move, with the reason.
3. **What is deleted:** one line per section, with the reason.
4. **Any new files,** each justified against the "prefer existing docs" rule.
5. **The expected size afterwards.**
Let the user override individual moves ("keep that one inline, it bites every session").
### Phase 5: Make the moves
1. **Create archive files first** (for example `docs/HISTORY.md`), with the full content word for word, so nothing is
lost.
2. **Append to existing docs** where content moves into them.
3. **Rewrite CLAUDE.md last,** as one full rewrite.
4. **Leave rules files alone** unless the user asked; they are separate concerns.
### Phase 6: Check and report
Re-measure, and report: lines before and after, words before and after, estimated tokens before and after (with the
percentage cut), files created or changed, and anything flagged for a follow-up.
## The thin CLAUDE.md shape
```markdown
# <Project> - project instructions
Token budget: Y,YYY. Current: ~X,XXX. This file is for the AI; humans read README.md.
<One paragraph: what this project is.>
## Non-negotiable rules
- <A rule that applies on every turn, with the reason if it isn't obvious>
## Design philosophy
<Short: the quality bar, what is strict and what is flexible.>
## Where to look next
| Task | Where |
|---|---|
| <Subsystem detail> | `docs/<SUBSYSTEM>.md` |
| <A workflow> | `docs/<workflow>.md` or a skill |
| <History> | `docs/HISTORY.md` |
| <All CLI flags> | `<tool> --help` |
## Architecture at a glance
<The key flow in one line or a small diagram; one routing line per module.>
## Build basics
<The 2 to 5 most-used commands.>
## Security boundaries
<Credential locations, ignored paths, defensive constraints.>
## Testing
<The run command, test count, and any non-obvious configuration.>
## Recent phases
<The last 3 to 5 entries. The full log is in docs/HISTORY.md.>
```
Write the budget in the body, as above, not in an HTML comment: comments can be stripped before the file reaches
the model. Not every project needs every section; drop the ones that aren't earning their place.
## When to push back
Don't slim a CLAUDE.md if:
- **It is already under budget.** Tell the user its size and ask what they want to optimise for.
- **It is sparse rather than bloated.** It needs sections added, not removed.
- **The user wants content deleted with nowhere to go.** Always move knowledge to a load-on-demand file. Deleting
knowledge that matters is not a clean-up; it is a regression.
## A real result
One large project's CLAUDE.md went from 277 lines and about 14,000 tokens (more than twice its 6,000 budget) to 105
lines and about 1,800 tokens, an 87% cut with nothing lost. The moves that mattered:
1. **A 33-entry history log to `docs/HISTORY.md`.** The biggest single win, because history only ever grows.
2. **A key-files table deleted** as a duplicate of the module list above it.
3. **About 15 subsystem gotchas deleted,** because the existing reference doc already covered them.
4. **The full flag list replaced** with a pointer to `--help`, plus the 3 or 4 flags with non-obvious usage.
5. **Conventions that repeated the global instructions deleted.**
The file that never got created: a new gotchas doc. Don't create new files when existing ones can take the content.
===== END SKILL =====
Let's explore what AI can do for you and your team
Clarity on whether we're a mutual fit
A clear understanding of the path forward
If we're not a fit, I'll point you somewhere useful