compact-docs
Skill1 starsChanged 3 months agoMITView on GitHub
Shrink the project's markdown documents so every future session costs less. Use when CLAUDE.md drifts past ~200 lines, when agents start ignoring rules, or after a sprint of accumulated edits.
In this repository10 other files it gives its agents.
- template/AGENTS.mdAGENTS.md
- template/CLAUDE.mdCLAUDE.md
- adrSkill
- featureSkill
- project-initSkill
- releaseSkill
- scoutSkill
- test-planSkill
- threat-modelSkill
- token-reportSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 42
Do not delete a security, compliance, or authorship rule to save tokens.
- Very specific: line 43
Do not compress Changelog.md, ADRs, or the evidence log — they are records, not instructions, and they are never auto-loaded.
- Distinctive: line 44
Do not "compress" by moving text into a file that gets imported anyway.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Compact: $ARGUMENTS (default: CLAUDE.md, AGENTS.md, and the four root documents)
Why. CLAUDE.md is loaded on every single turn. A line that earns nothing costs tokens forever. And a bloated instruction file causes the important rules to be ignored, so bloat is a correctness problem, not just a cost one.
Procedure
Measure first.
wc -l CLAUDE.md AGENTS.md Project-Context.md Project-Plan.md Project-Management.md Design.md- Apply the deletion test to every line. Would removing this cause an agent to make a mistake? If not, delete it. Specifically cut:
- Anything the model already does correctly without being told ("write clean code", "handle errors").
- Standard language conventions — PEP 8 and Airbnb style do not need restating.
- Anything a hook already enforces deterministically. A rule duplicated by
secret-guardis dead weight; the hook cannot be ignored and the sentence can. - Long rationale. Keep the rule, move the reasoning to an ADR.
- File-by-file descriptions of the codebase — that is what
.devcrew/project-facts.jsonand reading the code are for. - Anything that has changed twice this month. Volatile facts belong in the trackers, not in instructions.
- Convert, don't just delete. A rule that keeps being violated should become a hook. A rule that is only relevant sometimes should become a skill. Both remove it from every-turn context.
- Compress what survives. Tables over prose. Fragments over sentences. One line per rule.
- Verify behavior did not change. Re-read the diff and name, for each deleted line, why its absence is safe. If you cannot, put it back.
- Record the before/after line counts in
Changelog.md.
Targets
| File | Ceiling | Why |
CLAUDE.md / AGENTS.md | ~200 lines | loaded every turn |
| Agent definitions | ~60 lines | loaded on every invocation of that agent |
Project-Context.md | ~250 lines | read on demand, but read often |
| Skills | ~80 lines | loaded when invoked |
Do not
- Do not delete a security, compliance, or authorship rule to save tokens. Those are the ones worth paying for.
- Do not compress
Changelog.md, ADRs, or the evidence log — they are records, not instructions, and they are never auto-loaded. - Do not "compress" by moving text into a file that gets imported anyway. That is the same tokens with extra steps.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

