Claude Md Optimizer
Description
Claude Code skill for optimizing oversized CLAUDE.md files using progressive disclosure
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
claude-md-optimizer
A Claude Code skill that optimizes oversized agent instruction files using progressive disclosure. Handles **CLAUDE.md** (Claude Code), **AGENTS.md** (OpenAI Codex / GitHub Copilot agents), and **copilot-instructions.md** (GitHub Copilot). Auto-detects all three formats, analyzes content tiers, creates sub-documents using each format's native mechanism, and rewrites the main file — with zero information loss.
The Problem
Agent instruction files grow organically as projects mature. They accumulate troubleshooting guides, deployment commands, API references, and configuration examples alongside the essential rules needed every session. Since these files are loaded into every AI session as context, oversized files waste the context window on content that's only needed occasionally — and for CLAUDE.md, Anthropic explicitly warns that adherence degrades above 200 lines.
Projects with 6+ months of development commonly reach 800–1,500+ lines.
Supported Formats
| Format | Primary Location | Target Size | Native Sub-Doc Mechanism |
|---|---|---|---|
| CLAUDE.md | ./CLAUDE.md or ./.claude/CLAUDE.md |
<200 lines | @import syntax; .claude/rules/*.md |
| AGENTS.md | ./AGENTS.md (hierarchical) |
<32 KiB chain (Codex default) | Nested AGENTS.md in subdirectories |
| copilot-instructions.md | .github/copilot-instructions.md |
~100 lines | .github/instructions/NAME.instructions.md |
How It Works
The skill uses a 6-phase guided workflow:
- Detect & Analyze — Auto-scan the repo for all three file types; report sizes vs. format targets; parse and categorize sections as Essential, Reference, or Redundant
- Detect Constraints — Check for git-crypt/SOPS/age encryption; identify format-native sub-doc mechanisms; scan for CI scripts that regex-scan the file
- Plan — Present a categorization table showing what stays inline vs. what gets extracted (and where)
- *Review
Related Skills
Awesome Go
A curated list of awesome Go frameworks, libraries and software
Development next.js
| The React Framework | 138360 | 1503 | 1 |
Development sharing-skills
skill for guidance.
Development root-cause-tracing
Use when errors occur deep in execution and you need to trace back to find the original trigger.
Development Template Skill
Minimal skeleton for a new skill project structure.
Development Third-party Notices
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THI
Development