Skip to content
Skills Library
AI & agents · Review & audit

md-composer

/md-composer

Audit, compose, and refactor CLAUDE.md files so they stay under the token budget. Use when the user says "audit my CLAUDE.md", "my CLAUDE.md is too long", "compose a CLAUDE.md", "refactor CLAUDE.md", "CLAUDE.md is eating tokens", "flip negative rules", "extract bloat out of CLAUDE.md", "set up the CLAUDE.md hierarchy", "write a CLAUDE.md for this project", or any request to create, shrink, or reorganize a CLAUDE.md file. Works on the root CLAUDE.md, feature-level CLAUDE.md (in subdirs), user-level ~/.claude/CLAUDE.md, and local CLAUDE.local.md.

Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Audit, compose, and refactor CLAUDE.md files so they stay under the token budget. Use when the user says "audit my CLAUDE.md", "my CLAUDE.md is too long", "compose a CLAUDE.md", "refactor CLAUDE.md", "CLAUDE.md is eating tokens", "flip negative rules", "extract bloat out of CLAUDE.md", "set up the CLAUDE.md hierarchy", "write a CLAUDE.md for this project", or any request to create, shrink, or reorganize a CLAUDE.md file. Works on the root CLAUDE.md, feature-level CLAUDE.md (in subdirs), user-level ~/.claude/CLAUDE.md, and local CLAUDE.local.md.

Triggers from the description

audit my CLAUDE.mdmy CLAUDE.md is too longcompose a CLAUDE.mdrefactor CLAUDE.mdCLAUDE.md is eating tokensflip negative rulesextract bloat out of CLAUDE.mdset up the CLAUDE.md hierarchy
Original author description

Audit, compose, and refactor CLAUDE.md files so they stay under the token budget. Use when the user says "audit my CLAUDE.md", "my CLAUDE.md is too long", "compose a CLAUDE.md", "refactor CLAUDE.md", "CLAUDE.md is eating tokens", "flip negative rules", "extract bloat out of CLAUDE.md", "set up the CLAUDE.md hierarchy", "write a CLAUDE.md for this project", or any request to create, shrink, or reorganize a CLAUDE.md file. Works on the root CLAUDE.md, feature-level CLAUDE.md (in subdirs), user-level ~/.claude/CLAUDE.md, and local CLAUDE.local.md.

How it works

  1. The 200-line rule
  2. When to use this skill
  3. The 4-level hierarchy
  4. Workflow
  5. Anti-patterns
  6. Output
  7. Examples
  8. Inspiration
Original SKILL.md headings · 137 lines, 667 words
SKILL.md preview
---
name: md-composer
description: Audit, compose, and refactor CLAUDE.md files so they stay under the token budget. Use when the user says "audit my CLAUDE.md", "my CLAUDE.md is too long", "compose a CLAUDE.md", "refactor CLAUDE.md", "CLAUDE.md is eating tokens", "flip negative rules", "extract bloat out of CLAUDE.md", "set up the CLAUDE.md hierarchy", "write a CLAUDE.md for this project", or any request to create, shrink, or reorganize a CLAUDE.md file. Works on the root CLAUDE.md, feature-level CLAUDE.md (in subdirs), user-level ~/.claude/CLAUDE.md, and local CLAUDE.local.md.
---

# CLAUDE.md Composer

Treat CLAUDE.md as a **recipe book on the counter**, not a filing cabinet. Every token in CLAUDE.md is loaded into every session — so keep only what's needed for **every** interaction, and push everything else to Skills, `docs/`, or Commands.

## The 200-line rule

The root CLAUDE.md should fit on one screen (~200 lines max). If it doesn't, something belongs elsewhere.

## When to use this skill

1. **Audit** — user has an existing CLAUDE.md and wants it trimmed
2. **Compose** — user wants a fresh CLAUDE.md for a project
3. **Refactor** — split monolith into the 4-level hierarchy
4. **Flip** — convert negative rule lists to positive equivalents

## The 4-level hierarchy

```
Enterprise policy         ← org-wide, IT-managed, highest precedence
       ↓
./CLAUDE.md               ← project memory (committed)
       ↓
~/.claude/CLAUDE.md       ← user memory (personal, all projects)
       ↓
./CLAUDE.local.md         ← project local (gitignored, private)
```

Feature-level CLAUDE.md files in subdirs load **only when Claude touches that subtree** — use them to scope per-folder conventions (`/api`, `/frontend`) without paying the token cost globally.

## Workflow

### Step 1 — Audit existing file

Read the target CLAUDE.md and report:

- Line count (flag if >200)
- Token estimate (~4 chars/token)
- Bloat categories found (see [reference/anti-patterns.md](reference/anti-patterns.md))
- Candidates for extraction (docs dumps, file preloads, step-by-step tutorials, negative rule spirals)

### Step 2 — Classify every section

For each section, decide:

| Keep in CLAUDE.md | Extract |
|-------------------|---------|
| Project identity (2-3 sentences) | API documentation → `docs/api.md` |
| House rules (positive form) | Step-by-step workflows → Skill |
| Output preferences | Reusable prompts → slash command |
| Hard boundaries | File preloads (`@file:…`) — delete |
| Quick reference (paths, entry points) | Detailed reference tables → `docs/` |

### Step 3 — Apply the recipe-book template

See [reference/template.md](reference/template.md) for the canonical ~40-line shape. Sections:

1. `# Project: <Name>` — one line
2. `## What This Is` — 2-3 sentences
3. `## Tech Stack` — bullet list
4. `## Code Conventions` — positive-form rules
5. `## Output Preferences` — how Claude should present work
6. `## Boundaries` — never-touch files, always-run commands
7. `## Quick Reference` — pointers to `docs/`, entry points, test layout

### Step 4 — Flip negatives to positives

Negative lists burn tokens telling Claude what NOT to do. Replace:

```
Don't use var. Don't use any. Don't use console.log. Don't use ==.
```

With:

```
Use const/let, strict TypeScript, triple equals.
```

Same rules, ~40% fewer tokens.

### Step 5 — Reference, don't include

Replace `@file:` preloads and inlined docs with pointers:

```
## API Reference
See docs/api-reference.md. Read it when working with API endpoints.
```

### Step 6 — Split across hierarchy

Move content to the correct level:

- **Personal taste** (verbose vs terse, emoji preference) → `~/.claude/CLAUDE.md`
- **Project standards** (stack, conventions, boundaries) → `./CLAUDE.md`
- **Secret/local overrides** (local DB URL, personal notes) → `./CLAUDE.local.md` (gitignored)
- **Subdir-specific conventions** (API style, frontend style) → `./<subdir>/CLAUDE.md`

### Step 7 — Verify

- Line count ≤ 200
- Zero `@file:` preloads at root
- Zero "Don't …" rules (all flipped)
- Every inlined doc >10 lines replaced with a `See docs/…` pointer
- Title is `# Project: <Name>` format

## Anti-patterns

See [reference/anti-patterns.md](reference/anti-patterns.md) for the full taxonomy:

- The documentation dump (entire API specs inlined)
- The negative spiral (Don't X, Don't Y, Don't Z)
- The kitchen sink (30+ file preloads)
- The everything-tutorial (step-by-step workflows inlined)

## Output

When running an audit, return:

1. **Before/after line count + token estimate**
2. **Slim CLAUDE.md** (applied template)
3. **Extraction plan** — what moved to `docs/`, what became a Skill, what went to user/local level
4. **Diff** — clear delta for review

## Examples

See [examples/](examples/):

- [examples/audit-before-after.md](examples/audit-before-after.md) — 500-line file → 40-line file
- [examples/fresh-compose.md](examples/fresh-compose.md) — new project from scratch
- [examples/negative-flip.md](examples/negative-flip.md) — rule-list transformation

## Inspiration

This skill is based on Kjramsy's Medium article *"Your CLAUDE.md is eating your token budget (here's how to fix it)"* (Jan 2026): <https://medium.com/@kjramsy/your-claude-md-is-eating-your-token-budget-heres-how-to-fix-it-b8d6c4d1c986>
Files in this package (6)
  • SKILL.md 5 KB
  • examples/audit-before-after.md 2 KB
  • examples/fresh-compose.md 2 KB
  • examples/negative-flip.md 1 KB
  • reference/anti-patterns.md 3 KB
  • reference/template.md 2 KB

Versions

The database has no other skills named md-composer.

Database snapshot: 13.11.2026 · package version e6e660c2a463 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100claude-md-refactor
    Refactor, audit, or bootstrap a repository's CLAUDE.md so it stays lean and acts as an index of pointers to /docs/ files instead of bloating session context. Use this skill whenever the user mentions their CLAUDE.md being too long, bloated, eating context, "collapsing context",…
  • 90writing-project-instructions
    Use when authoring, editing, updating, trimming, or adding rules to a CLAUDE.md, AGENTS.md, CLAUDE.local.md, or other project-level instruction file for an AI coding agent — including small one-line changes. Triggers on "write a CLAUDE.md", "audit my CLAUDE.md", "trim my…
  • 100agents-md-optimizer
    Audit bloated agent-instruction files (CLAUDE.md, AGENTS.md, and their local/user-level variants) and rewrite them lean, or author a new one from scratch following the 200-line "recipe book" principle. Use this skill whenever the user mentions CLAUDE.md, AGENTS.md, agent…
  • 84audit
    Audit the Claude Code instruction/memory layer covering CLAUDE.md, a root AGENTS.md, CLAUDE.local.md, .claude/rules/, and auto-memory against a codified checklist derived from official Claude Code documentation. Use when: 'audit CLAUDE.md', 'audit AGENTS.md', 'memory health',…
  • 100usage-audit
    Audit a Claude Code setup for token waste and context bloat. Checks MCP servers, CLAUDE.md, skills, and settings against bloat filters. Triggers on: "audit my context", "usage audit", "token audit", "context bloat". NOT for codebase audits.
  • 100update-claude-md
    Analyse codebase and generate a hierarchical CLAUDE.md system optimized for Claude Code. Use when the user wants to update, regenerate, or create CLAUDE.md files, set up project documentation for Claude Code, or optimize the CLAUDE.md hierarchy. Triggers on "/update-claude-md",…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.