From 83de4518c57468f43202b16b2a58187524563e74 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 25 Aug 2026 03:33:22 +0000 Subject: [PATCH] docs: pin exact guard semantics for the context-budget ratchet in CLAUDE.md Doc-review finding: "a third enforced ceiling" undercounted the guard family (skill-size-budget floors and parity ratios also watch these ledgers, relatively). Rephrased to match the ratchet test's own header: absolute ceilings vs relative floors/ratios. Co-Authored-By: Claude Fable 5 --- CLAUDE.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index fefd383cd..131ec45e9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -226,12 +226,13 @@ conversation. The failure message carries the re-measure + ratchet protocol. tree (always-on vs per-invocation, `--diff`, `--budget`; `--exact` opts into the real tokenizer and POSTs file text to api.anthropic.com with an egress receipt). -A third enforced ceiling is the context-budget ratchet: -`test/context-budget-ratchet.test.ts` (free, runs in `bun run test`) grades the -two ledgers the other guards don't cover — the always-on FULL-frontmatter -aggregate and each skill's per-invocation eager tokens (SKILL.md + forced-read -references) — against `test/fixtures/context-budget.json`. A skill that grows -past its ceiling fails; a new skill fails until it's consciously budgeted. For +The context-budget ratchet (`test/context-budget-ratchet.test.ts`, free, runs +in `bun run test`) pins ABSOLUTE ceilings on two more ledgers: the always-on +FULL-frontmatter aggregate (catalog-budget counts only name+description) and +each skill's per-invocation eager tokens (SKILL.md + forced-read references — +size floors and parity ratios guard these relatively, not absolutely), graded +against `test/fixtures/context-budget.json`. A skill that grows past its +ceiling fails; a new skill fails until it's consciously budgeted. For legitimate growth or a landed reduction, re-run `bun test/helpers/capture-context-budget.ts` and commit the refreshed fixture in the same commit, so ceilings ratchet down and every win is locked.