Otimizador de CLAUDE.md
qiaeru/skill-claudemd
Reduz CLAUDE.md cortando redundâncias e economizando tokens de contexto
Ver no GitHubUma skill Claude Code que reduz o arquivo CLAUDE.md ao essencial, eliminando conteúdo duplicado ou derivável e substituindo-o por referências sob demanda. Economiza tokens de contexto e mantém o arquivo sincronizado com a documentação do projeto.
Instalação
npx convez-ai qiaeru/skill-claudemd1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Diminuir tamanho do arquivo de memória CLAUDE.md
- Otimizar uso de contexto em projetos Claude Code
- Manter fonte única de verdade em documentação
Veredito

Skill bem fundamentada em práticas oficiais Anthropic. Endereça problema real de bloat em arquivos CLAUDE.md, com heurística clara (manter ou cortar, copiar ou referenciar). Implementação educada e referências técnicas sólidas.
README
A tradução para o português deste README ainda está na fila.
CLAUDE.md optimization skill
A Claude Code skill that trims a project's CLAUDE.md down to what is strictly necessary.
Claude loads CLAUDE.md in full into the context window at the start of every session, so every line costs tokens for the whole conversation and competes with your instructions. A bloated file wastes context and lowers adherence: when the file runs too long, Claude loses the load-bearing rules in the noise.
This skill applies Anthropic's published guidance for memory files and Claude Code best practices. It scans the project's existing documentation and replaces anything derivable or already written down with an on-demand reference, instead of rewriting it inside CLAUDE.md. The file stays short, saves context tokens, and stops drifting out of sync with the docs it would otherwise duplicate.
Layout
skill-claudemd/
├── .github/
│ └── FUNDING.yml
├── .gitattributes
├── .gitignore
├── README.md
├── CHANGELOG.md
├── LICENSE
└── optimizing-claude-md/
├── SKILL.md
└── references/
├── include-exclude.md
├── referencing-techniques.md
└── examples.md
How it works
The skill runs every block of a CLAUDE.md through two tests, in order:
- Keep or cut. "Would removing this cause Claude to make a mistake?" If not, it goes. The skill drops self-evident advice, standard conventions, and anything Claude already does correctly.
- Copy or reference. For what survives: "Is this already in the code or the docs?" If so, the skill replaces the copy with a pointer to the source, so there is one source of truth and no launch-time token cost.
It then resolves contradictions to a single source of truth, restructures the survivors with headers and concrete phrasing, moves multi-step procedures or path-specific rules out to skills and rules, and reports the before and after line count.
The key distinction the skill teaches is that not every "reference" saves tokens. A prose pointer loads on demand and costs one line; an @path import loads the whole file at launch and saves nothing. The referencing-techniques reference covers all four mechanisms and when to use each.
Installation
Claude Code loads a project's skills from the .claude/skills/ folder at the root of that project, and global skills from ~/.claude/skills/.
The repo keeps the skill as one copyable block. The optimizing-claude-md/ folder already holds SKILL.md and its references/ directory under the exact name Claude Code expects.
To install it in a project, copy the optimizing-claude-md/ folder into that project's .claude/skills/ directory, creating that directory if it does not exist. For an installation that applies to all your projects, copy the same folder into ~/.claude/skills/ instead.
Restart Claude Code so the skill is detected. You can confirm it was picked up by asking Claude for the list of available skills or by invoking it by name.
When you change the skill in this repo, re-copy the optimizing-claude-md/ folder into the target project's .claude/skills/ (or its global equivalent) and restart Claude Code, since skill content is not hot-reloaded.
Usage
Once installed, ask Claude to "optimize the CLAUDE.md" (or trim, audit, shrink, clean up, improve it). Claude recognizes the request from the skill's description and runs the procedure: it reads the current CLAUDE.md, inventories the project's docs, then cuts, references, de-duplicates, and restructures, ending with a before and after line count.
You can also invoke it explicitly by name for a full pass, or point it at a specific file (CLAUDE.local.md, a nested CLAUDE.md, or an AGENTS.md you want wired up by import).
If the project has no CLAUDE.md yet, the skill suggests running /init first to generate a starting point from the codebase, then optimizes the result.
Limits
- The skill optimizes an existing
CLAUDE.md; it does not author one from scratch. Use/initfor that, then optimize. - It only points to documentation that exists. It will not invent references, and it verifies each pointer resolves before writing it.
- It judges form and structure against Anthropic's guidance, not the correctness of your project's rules. If a rule is wrong, the skill keeps it; it only decides whether it belongs in
CLAUDE.mdand how to phrase it. - The 200-line target is a soft ceiling. The skill never deletes a load-bearing rule just to hit a number.
License
MIT, see LICENSE.