harness-diet

harness-diet is a skill for Claude Code from sangrokjung/claude-forge. It costs 140 tokens per session (1,868 once invoked), scanned A, original, MIT.

A tool for measuring and reducing the instructions loaded into a Claude Code project at the start of every session. It moves less relevant guidance into files that load only when needed and checks that important rules remain intact.

In plain words
What is it for?
Auditing CLAUDE.md and rule files, reorganizing guidance, and verifying that no required instructions were lost.
Why use it?
Large always-loaded instruction files use up context and can make an agent follow rules less reliably. This keeps the core instructions within a defined budget.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the claude-forge plugin — 33 skills, 39 commands, 17 agents shipped together

Good fit Auditing CLAUDE.md and rule files, reorganizing guidance, and verifying that no required instructions were lost.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add sangrokjung/claude-forge
Claude Code
/plugin install claude-forge

Made for: Claude Code.

Or install claude-forge, the plugin that ships this one along with the rest of its 33 skills, 39 commands, 17 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for harness-diet

README.md
[![agentmods](https://agentmods.dev/badge/skills/sangrokjung/claude-forge/harness-diet/github.svg)](https://agentmods.dev/skills/sangrokjung/claude-forge/harness-diet)
Your own site
<a href="https://agentmods.dev/skills/sangrokjung/claude-forge/harness-diet"><img src="https://agentmods.dev/badge/skills/sangrokjung/claude-forge/harness-diet/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for harness-diet

Your own site · 80×15
<a href="https://agentmods.dev/skills/sangrokjung/claude-forge/harness-diet"><img src="https://agentmods.dev/badge/skills/sangrokjung/claude-forge/harness-diet.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 140 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,868 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00140 $0.01868
Opus 5 $0.00070 $0.00934
Sonnet 5 $0.00028 $0.00374
Haiku 4.5 $0.00014 $0.00187

Measured 8d ago against content hash 78cb11bfe568, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

harness-diet scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (hooks/rules-budget-guard.sh, scripts/harness_diet_audit.py, scripts/preservation_check.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/harness-diet/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

harness-diet — put your always-loaded context back under budget

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 paths frontmatter 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.

Budgets (defaults — override via flags)

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/… (the install.sh layout). 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.

Phase 0 — Measure

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)

Read the full file on GitHub · 125 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 125 lines · 140 tokens per session scan A 78cb11bfe568

Subscribe to this mod's changes

harness-diet is a skill published in the GitHub repository sangrokjung/claude-forge (835 stars, last pushed 8d ago), licensed MIT. It adds 140 tokens to every session and 1,868 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

caveman-help

Quick-reference card for all caveman modes, skills, and commands. One-shot display, not a persistent mode. Trigger: /caveman-help, "caveman help", "what caveman commands", "how do I use caveman".

stevesolun/ctx · 56 tokens

toolbox

Pre/post dev toolbox — named bundles of skills/agents loaded before development work and councils of experts invoked after. Run /toolbox or the toolbox.py CLI to list, activate, initialize, export, import, and validate toolboxes. Invoke at the start or end of a dev session, when setting up a new repo, or when sharing…

stevesolun/ctx · 77 tokens

stock-analysis-lead

Orchestrate a US-stock investment analysis — classify sector archetype, fetch SEC filings, dispatch a tiered fan-out of six vertical equity-research agents (business model, earnings quality, balance sheet, management, industry, peer comparison) over a validated JSON findings contract, then synthesize a buy/hold/sell…

johnqtcg/awesome-skills · 229 tokens

kafka-event-driven-design

Kafka event-driven architecture designer and reviewer, at the application/client layer. ALWAYS use when designing, reviewing, or troubleshooting how a service produces or consumes Kafka events — topic and partition-key design, producer and consumer client configuration, consumer group topology, event schema definition…

johnqtcg/awesome-skills · 191 tokens

unit-test

A Go testing workflow for writing unit tests: small tests that check individual functions or components. It supports table-driven cases, where many inputs and expected results are organised in one test, and subtests.

johnqtcg/awesome-skills · 100 tokens

api-design

REST API contract designer and reviewer. ALWAYS use when designing new endpoints, reviewing existing API contracts, planning API versioning, or standardizing error models. Covers resource modeling (URL/naming), HTTP method semantics, status code selection, error model consistency, pagination/filtering/sorting…

johnqtcg/awesome-skills · 123 tokens