Skip to content

CLAUDE.md is at 90.1% of its hard cap and the auto-loaded closure is 47% over budget; the previously-trimmed fragments have regrown #1373

Description

@d-morrison

scripts/check-context-closure.py reports two conditions on main at 491906bf, and its own output says to treat the second as the moment to act rather than the moment to note it. Filing so the observation is durable, per report-mistakes-proactively.

Measured

$ python3 scripts/check-context-closure.py
/home/user/ai-config: 74 file(s), 1,173,585 bytes (~293,396 tokens at 4 B/token)

  largest 10:
    135,408  11.5%  d0  CLAUDE.md
     87,448   7.5%  d1  shared/workflow/ardi.md
     80,901   6.9%  d1  shared/principles/fail-fast.md
     65,527   5.6%  d1  shared/workflow/address-every-comment.md
     55,158   4.7%  d1  shared/workflow/algorithmatize-checks.md
     49,984   4.3%  d1  shared/workflow/fully-clean.md
     48,639   4.1%  d1  shared/workflow/metacognitive-monitoring.md
     41,202   3.5%  d1  shared/writing/fact-check-prose.md
     33,132   2.8%  d1  shared/workflow/sync-with-main.md
     28,693   2.4%  d1  shared/workflow/pr-on-claim.md

  OVER BUDGET by 973,585 bytes (~243,396 tokens); budget is 200,000.

  CLAUDE.md: 135,158 characters against the harness's 150,000-char cap (90.1%), 14,842 to spare.
  WARNING: within 10% of the cap. This file has grown by thousands of characters in a day
  before, so treat this as the moment to trim rather than the moment to note it.

Measured 2026-08-10. Both figures are volatile by construction, so re-run rather than quoting these.

Why this is not already covered

Three neighbouring issues, none of which covers this condition:

The sharper half

The two numbers fail differently and only one of them is graceful.

Being 47% over the token budget degrades quality: the closure still loads, and rules compete for attention. Crossing the 150,000-character cap is a hard harness limit, and CLAUDE.md has 14,842 characters of headroom -- which this repo has consumed in a single day before, per the instrument's own warning text.

So the priority is CLAUDE.md specifically (d0, 135,408 bytes, 11.5% of the closure), not the corpus total.

Suggested direction, not a decision

Deliberately not proposing the trim itself, since which sections earn their place is a judgment call for the maintainer rather than something to settle in a filing:

  1. Apply Trim the CLAUDE.md closure: move case records out of ai-config-only shared fragments #1193's pattern to CLAUDE.md itself -- it already has a CLAUDE.cases.md, so the mechanism exists and only the sweep is missing.
  2. Consider whether the recurrence wants an instrument rather than a periodic issue: a CI step that fails when d0 crosses some threshold below the cap would make this self-reporting, per algorithmatize-checks. check-context-closure.py already computes the number; nothing gates on it.

Not a defect: the unbalanced-fence warning

The same run reports CLAUDE.md (1 unclosed fence marker(s)). Checked before filing rather than folded in: the script's own comments at scripts/check-context-closure.py:161-175 name this repo's CLAUDE.md as the known case, explaining that it "contains same-length nested fences" and that surfacing them as a warning rather than swallowing to EOF is the deliberate trade for a measuring instrument. A naive count agrees the file is balanced (16 line-start fence markers). No action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions