optimizing-claude-mdlisted
Install: claude install-skill qiaeru/skill-claudemd
# Optimizing CLAUDE.md
CLAUDE.md is loaded in full at the start of every session, so every line costs tokens for the whole conversation and competes with the user's real instructions. A bloated file does not just waste tokens, it lowers adherence: the important rules get lost in the noise. Optimizing means keeping only what changes Claude's behaviour and cannot be derived from the code, and pointing to everything else instead of copying it.
This skill follows Anthropic's own guidance for memory files and CLAUDE.md. See the [official memory docs](https://code.claude.com/docs/en/memory) and [best practices](https://code.claude.com/docs/en/best-practices).
## When to apply
Apply when the user asks to optimize, trim, audit, shrink, clean up, or improve a CLAUDE.md, or whenever a CLAUDE.md has grown well past 200 lines. The same procedure works on every memory file in the hierarchy:
- Managed policy, organization-wide: a platform-specific path (for example `/Library/Application Support/ClaudeCode/CLAUDE.md` on macOS); usually read-only for the user, flag conflicts instead of editing it
- User, all projects: `~/.claude/CLAUDE.md`
- Project, shared with the team: `./CLAUDE.md` or `./.claude/CLAUDE.md`
- Local, private to one checkout: `./CLAUDE.local.md` (gitignored)
- Rules: `.claude/rules/*.md` (project) and `~/.claude/rules/*.md` (user). A rule without a `paths:` field loads every session, same as CLAUDE.md, so it gets the same treatment.
- `AGENTS.md`: Claude reads `CLAUDE.