Install any skill in seconds. Free to start, no credit card required.
Get Started Free →sangrokjung/harness-diet
Measure and shrink the always-loaded context of a Claude Code harness (CLAUDE.md + rules without paths frontmatter) back under budget — migrate narrative to reference files, convert rules to path-scoped or skill-triggered loading, and verify zero governance loss with deterministic preservation checks.
Passed 18 of 21 test cases with the skill, and 9 of 21 without it.
and 10 more in the full report
11 fixed11 passed either way3 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 10 test cases the skill fixed. Same model, same prompt, with and without the skill.
We are building a dashboard to track memory overhead in our developer tooling. We need to run the Claude rule auditor script and format its output as structured JSON rather than plain text. Which flag should be passed to the audit script?
| Checked | Without skill | With skill |
|---|---|---|
| Passes the --json flag to harness_diet_audit.py. | Missed | Passed |
The instructions your model reads when the skill loads.
A harness gains weight automatically (every incident note, every boss directive, every fix lands as another paragraph in an always-loaded rule) but only loses weight when someone runs a diet. Field measurement on a mature harness: growth-to-reduction commit ratio of ~60:1, natural growth of ~70KB/month, and adherence degrading as the pile grows. Anthropic's guidance is blunt: "target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence", and rules without
pathsfrontmatter load "with the same priority as CLAUDE.md" — every session, every token (memory docs).
Result you should expect: one field run took a harness from 146KB always-loaded (143% of budget) to 100.6KB (98%) with zero governance loss — every killswitch, decision table, trigger keyword, and canonical command verified present after the diet.
| Metric | Budget | Why |
|---|---|---|
| CLAUDE.md | < 200 lines | Anthropic official guidance |
| Per always-loaded rule file | 8,192 B | Keeps any single rule scannable; forces narrative out |
| Total always-loaded rules | 102,400 B | Attention-budget ceiling; beyond this, adherence drops |
Bundled script paths: commands below use
$HOME/.claude/skills/harness-diet/…(theinstall.shlayout). For marketplace (/plugin install) installs, resolve under${CLAUDE_PLUGIN_ROOT}/skills/harness-diet/…instead. The scripts are stdlib-only Python; if unavailable, perform the step manually from the described contract.
DIET="$HOME/.claude/skills/harness-diet" # or "${CLAUDE_PLUGIN_ROOT}/skills/harness-diet"
python3 "$DIET/scripts/harness_diet_audit.py" # human summary
python3 "$DIET/scripts/harness_diet_audit.py" --json # machine output
python3 "$DIET/scripts/harness_diet_audit.py" --strict # exit 2 if over budget (CI/ratchet)
Auto-discovers ./.claude/rules, ~/.claude/rules, and CLAUDE.md files at project/user level.
A rule is always-loaded iff its YAML frontmatter has no paths: key.
test cases passed, vs 9 / 21 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.