calibrate-claude-md
Skill1 starsChanged 6 months agoMITView on GitHub
Audits `CLAUDE.md`, `CLAUDE.local.md`, and every nested `**/CLAUDE.md` across user / project scopes. Flags committed secrets, files over 200 / 400 effective lines, aspirational ("must" / "always" / "never") wording that should be a hook, vague rules without specifics, `@`-import chains > 5 hops, contradictions between nested files, and `AGENTS.md` siblings that are present but un-imported. Also scaffolds trimmed CLAUDE.md replacements when a file is over budget — the removed content moves into `.claude/rules/<topic>.md` with `paths:` scoping (companion work in `calibrate-rules`). Invoked by the calibration orchestrator (`/calibrate`) and standalone via `/claude-calibration:calibrate-claude-md`.
- Reads credentials
In this repository25 other files it gives its agents.
- agents/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .claude/skills/CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- rules/CLAUDE.mdCLAUDE.md
- skills/CLAUDE.mdCLAUDE.md
- docs-statusSkill
- docs-updateSkill
- plugin-updateSkill
- calibrate-generalSkill
- calibrate-hooksSkill
- calibrate-mcpSkill
- calibrate-pluginsSkill
- calibrate-rulesSkill
- calibrate-settingsSkill
- calibrateSkill
- calibrate-skillsSkill
- calibrate-subagentsSkill
- calibration-auditSkill
- calibration-diffSkill
- calibration-doctorSkill
- calibration-flowSkill
- calibration-onboardingSkill
- calibrationSkill
- calibration-trackSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 77
When the planner detects a recurrence that this bundle scaffolds, the create row is usually routed to a sibling bundle (per …
- Very specific: line 91
After every edit or create, re-run bash <BUNDLE>/scripts/lint.sh <changed path> and record verify: ✓ if the signature no longer fires (or …
- Very specific: line 96
Never trim load-bearing content silently — when removing a block, either move it to .claude/rules/<topic>.md with appropriate paths: …
- Distinctive: line 100
Don't reformat unrelated content when applying a fix.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
calibrate-claude-md — per-feature bundle
You audit and tune CLAUDE.md / CLAUDE.local.md / nested **/CLAUDE.md. You receive one of two
kinds of work:
- Direct invocation (
/claude-calibration:calibrate-claude-md) — audit everything, report findings, propose fixes inline. The user drives the conversation. - Dispatch from the calibrator — one approved plan row at a time, applied surgically.
In both cases the workflow is the same; only the framing differs.
1. Enumerate
bash <BUNDLE>/scripts/enumerate.sh "$PROJECT_DIR"Yields TSV scope\tpath. Scope is user (~/CLAUDE.md, ~/.claude/CLAUDE.md), project
(<PROJECT_DIR>/CLAUDE.md, <PROJECT_DIR>/CLAUDE.local.md), or nested (any other
<PROJECT_DIR>/**/CLAUDE.md).
2. Lint
bash <BUNDLE>/scripts/lint.sh <path …>Yields TSV path\tsignature\tseverity\tdetail. The signatures this bundle owns
(see reference.md):
claude-md:secret-leak(CRITICAL)claude-md:over-200(MEDIUM)claude-md:over-400(HIGH)claude-md:vague-rules(MEDIUM)claude-md:no-agents-md-import(LOW)claude-md:imports-too-deep(HIGH)claude-md:contradicts-nested(MEDIUM)claude-md:must-rule-with-no-hook(MEDIUM)claude-md:restated-readme(LOW)
3. Fix — kind: edit rows
For each finding, the remediation pattern is in examples/<case>/:
claude-md:over-200/claude-md:over-400→examples/over-200/{before,after}.md(trim the CLAUDE.md; move topic blocks into.claude/rules/<topic>.mdwithpaths:— companion work incalibrate-rules).claude-md:secret-leak→ remove the secret, rotate it, move sensitive values toCLAUDE.local.md(git-ignored) or.env.claude-md:vague-rules→ replace aspirational verbs with concrete, verifiable rules; recurrence promotes to a.claude/rules/conventions.md(companion work incalibrate-rules).claude-md:must-rule-with-no-hook→ either soften the wording or add the matching enforcement hook (companion work incalibrate-hooks).claude-md:no-agents-md-import→ add@AGENTS.mdnear the top of CLAUDE.md.claude-md:imports-too-deep→ flatten the import chain; collapse intermediate hops.claude-md:contradicts-nested→ reconcile: pick a canonical statement and link the others.claude-md:restated-readme→ replace duplicated content with@README.mdor a link.
4. Create — kind: create rows
When the planner detects a recurrence that this bundle scaffolds, the create row is usually
routed to a sibling bundle (per rules/dispatch.md):
claude-md:over-200×N → companioncalibrate-rulescreaterow scaffolds the new path-scoped rule file containing the moved-out block.claude-md:vague-rules×N →calibrate-rulesscaffolds.claude/rules/conventions.md.claude-md:must-rule-with-no-hook×N →calibrate-hooksscaffolds the matching enforcement hook.
This bundle owns templates/claude-md.tmpl (used when a CLAUDE.md is being recreated from
scratch — a fresh project, or a full rewrite after a secret-leak).
5. Verify
After every edit or create, re-run bash <BUNDLE>/scripts/lint.sh <changed path> and record
verify: ✓ if the signature no longer fires (or verify: ✗ <signature> if it still does).
Hard rules
- Never trim load-bearing content silently — when removing a block, either move it to
.claude/rules/<topic>.mdwith appropriatepaths:scoping, or surface the removal in the plan. CLAUDE.mdis committed;CLAUDE.local.mdis git-ignored. Never put secrets inCLAUDE.md.- Effective-line counts come from
lint.sh; don't pre-compute them yourself. - Don't reformat unrelated content when applying a fix.
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.

