hailneed MIT · local-first

00 hailneed suite · module 04 · context hygiene

The text you pay for
on every request —
measured, then pruned.

CLAUDE.md, AGENTS.md, GEMINI.md and everything they import load on every single request. gardener resolves that import chain into one inventory, prices it in lines and estimated tokens, and flags broken imports, stale paths and duplicated rules — without editing a single file.

01 Evidence

This is a real audit.
Show, do not tell.

Abridged from an actual run of --audit --md --lang en against the always-loaded instruction files on the machine this site was built on. Directory names generalized and one finding label translated; every number is what the script printed. Nothing in it ever left that machine.

hot context audit — markdown out
# gardener — hot context audit

Source note: 6 files · 182 lines · ~2638 estimated tokens, per request · 76 directives · score: 12 (good)

Budgets: 300/600 lines per file, 4000/8000 estimated tokens in total.
Token counts are a bytes/4 estimate, not a real tokenizer.

## What loads

| File                          | scope   | depth | lines | ~tokens |
|-------------------------------|---------|-------|-------|---------|
| `~/.claude/CLAUDE.md`         | global  | 0     |     7 |      60 |
| `~/agent-defs/instructions.md`| global  | 1     |    53 |     749 |
| `~/agent-defs/identity.md`    | global  | 2     |    46 |     553 |
| `~/agent-defs/memory/MEMORY.md`| global | 2     |    30 |     676 |
| `~/.gemini/GEMINI.md`         | global  | 0     |     1 |       0 |
| `<repo>/.claude/CLAUDE.md`   | project | 0     |    45 |     600 |
| **total**                     |         |       | **182** | **2638** |

## Findings

| Sev  | Check               | where              | what        |
|------|---------------------|--------------------|-------------|
| warn | duplicate-directive | instructions.md:52 | 86% overlap |
| warn | duplicate-directive | instructions.md:32 | 69% overlap |
| warn | duplicate-directive | instructions.md:28 | 67% overlap |

Every finding names the check that fired, the file and line, and — for duplicates — both overlapping texts, so you can disagree with the specific thing, not with the tool. The checks are documented in one file you can open, and any check you disagree with switches off with --ignore.

02 Install

One marketplace.
Then one command.

claude code
# once
> /plugin marketplace add hailneed/plugins

# the gardener
> /plugin install gardener@hailneed

# and try it
> /gardener:audit
  • Claude Code and Node.js 18 or newer.
  • No dependencies, no build step, no API key, no account.
  • Standalone works toonode scripts/gardener.mjs --audit --repo . --md
  • CI-ready--audit --out audit.json has a stable output format; bind totals.tokens or score.raw to a threshold. --selftest needs no network.
Marketplace manifest

03 Commands

What loads. What holds.
What goes.

01

/gardener:audit

What loads on every request: the import chain resolved transitively into one inventory, priced in lines and estimated tokens — plus broken imports, stale paths and duplicated instructions. An unresolvable import is never skipped silently; believing rules load when they do not is the most expensive mistake.

02

/gardener:compliance

Are the prohibitions actually followed: forbidden commands cross-referenced against the commands really run in local sessions. It produces violation candidates — verified line by line before anything is reported — and lists rules whose subject never came up, insisting on the difference between dead weight and a rule that is quietly working.

03

/gardener:prune

A line-by-line plan marking each flagged directive cut, move, fix, rewrite or enforce, with the reason — plus the split between what belongs in the always-loaded file and what belongs on demand. It shows the lines and asks; it never edits on its own.

04 Trust

Claims you can
check in the source.

  • No network calls, nothing edited. gardener.mjs reads instruction files and session logs already on your disk and produces a plan. Your CLAUDE.md is never touched.
  • Honest counting. Token numbers come from a bytes/4 estimate, not a tokenizer — enough to compare files and track change over time, and every report says so.
  • Candidates, not verdicts. A compliance match may miss context the rule cares about; the skill opens each candidate, verifies it against the transcript and reports how many it discarded.
  • A zero is not dead weight. A prohibition with zero occurrences is reported as a possible success — deleting a safety rule because it worked is the fastest way to bring the bug back.
  • 10 checks, no model judgementchecks.md documents every one with its severity and triage note, and --selftest proves them against 19 fixtures without touching your data.
  • Failure stays visible. Unreadable sessions are counted in the source note, never silently dropped.
  • MIT. LICENSE — no account, no signup, no telemetry.

05 Cloud

gardener Cloud
is in design.

The plugin stays free and local — that is a promise, not a phase. Cloud is the optional layer for teams whose instruction files change under many hands:

  • Continuous budget tracking — the hot-context cost of your team's instruction files, watched over time instead of audited once.
  • Before/after for rule changes — what a changed rule actually did to agent behaviour, compared across the boundary.
  • Onboarding summary — "the rules that actually apply in this repo", generated for the person who joined yesterday.

06 Family

One suite.
Five more modules.