feat(cml): context-window-scaled CLAUDE.md char budget (mirrors CC 40.0k warning)
Add a char-based CML finding that mirrors Claude Code's own startup warning
("Large CLAUDE.md will impact performance (X chars > 40.0k)"). CC 2.1.169 scales
that threshold with the model's context window, so the finding anchors on the
conservative 200k window (we cannot observe the user's window; the anchor fires
earliest) and discloses the relaxed ~200,000-char figure at 1M context. MEDIUM
severity (token cost, not an adherence cliff — consistent with the v5.2.0 reframe).
Keyed on chars, not lines, so it is complementary to the existing 200/500-line
checks (which stay untouched): a file can be long by lines yet under budget (short
lines, e.g. large-cascade at 37k chars / 1024 lines), or short by lines yet over it.
Extract the shared 200k/1M context-window constants to scanners/lib/context-window.mjs
(single source of truth; skill-listing-budget.mjs now imports + re-exports them).
40.0k figure and context-window scaling verified against the CC changelog (2.1.169,
2026-06-08) and the live startup-warning text. +6 tests, new fixture large-claude-chars
(48,531 chars / 100 lines). Suite 918/918, self-audit PASS configGrade A 97.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ter3E2JSi1Khgmuf2kady8
This commit is contained in:
parent
03949c6c98
commit
b0bf8c5817
7 changed files with 253 additions and 8 deletions
100
tests/fixtures/large-claude-chars/CLAUDE.md
vendored
Normal file
100
tests/fixtures/large-claude-chars/CLAUDE.md
vendored
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
# Large CLAUDE.md fixture — chars over 40k, lines under 200
|
||||
|
||||
## Project overview
|
||||
|
||||
This fixture exercises the CML char-budget check (CA-CML char-budget): it
|
||||
crosses Claude Code's ~40.0k-char startup-warning threshold while staying well
|
||||
under 200 lines, so it isolates the char check from the line-count check.
|
||||
|
||||
## Commands and workflow
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 00.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 01.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 02.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 03.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 04.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 05.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 06.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 07.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 08.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 09.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 10.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 11.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 12.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 13.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 14.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 15.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 16.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 17.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 18.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 19.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 20.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 21.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 22.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 23.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 24.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 25.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 26.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 27.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 28.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 29.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 30.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 31.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 32.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 33.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 34.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 35.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 36.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 37.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 38.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 39.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 40.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 41.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 42.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 43.
|
||||
|
||||
The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. The conventions for this project are written out at length in flowing prose rather than being split into @imports or .claude/rules files, which is the exact shape that drives a CLAUDE.md past its character budget while the line count stays small and unremarkable. Paragraph 44.
|
||||
|
||||
|
|
@ -129,6 +129,64 @@ describe('CML scanner — large cascade (>500 lines): reframed, not absolute-adh
|
|||
});
|
||||
});
|
||||
|
||||
describe('CML scanner — char budget mirrors CC startup warning (CC 2.1.169)', () => {
|
||||
// large-claude-chars/CLAUDE.md is 48,531 chars across 100 lines: it crosses
|
||||
// Claude Code's ~40.0k-char startup-warning threshold while staying under the
|
||||
// 200-line count, so it isolates the char-budget check from the line check.
|
||||
let result;
|
||||
beforeEach(async () => {
|
||||
resetCounter();
|
||||
const discovery = await discoverConfigFiles(resolve(FIXTURES, 'large-claude-chars'));
|
||||
result = await scan(resolve(FIXTURES, 'large-claude-chars'), discovery);
|
||||
});
|
||||
|
||||
const charFinding = (r) =>
|
||||
r.findings.find((f) => /performance-warning threshold/i.test(f.title || ''));
|
||||
|
||||
it('flags a CLAUDE.md over ~40k chars', () => {
|
||||
assert.ok(charFinding(result), 'expected a char-budget finding for a >40k-char CLAUDE.md');
|
||||
});
|
||||
|
||||
it('the char-budget finding is MEDIUM (token cost, not an adherence cliff)', () => {
|
||||
assert.strictEqual(charFinding(result)?.severity, 'medium');
|
||||
});
|
||||
|
||||
it('anchors on CC\'s 40.0k figure and discloses context-window scaling', () => {
|
||||
const f = charFinding(result);
|
||||
const text = `${f?.description || ''} ${f?.evidence || ''}`;
|
||||
assert.match(text, /40\.0k/, 'should mirror CC\'s 40.0k startup-warning figure');
|
||||
assert.match(text, /context window|scales|1,000,000/i, 'should disclose context-window scaling');
|
||||
// Lock the scaling arithmetic: 40.0k anchor x (1M / 200k) = 200,000 chars @ 1M.
|
||||
assert.match(text, /200,000/, 'should disclose the ~200,000-char relaxed threshold at 1M context');
|
||||
});
|
||||
|
||||
it('does NOT fire the line-count findings (chars high, lines under 200)', () => {
|
||||
const lineFinding = result.findings.find((f) => /exceeds (recommended 200|500)/.test(f.title || ''));
|
||||
assert.ok(!lineFinding, `char fixture should not trip a line finding: ${lineFinding?.title || ''}`);
|
||||
});
|
||||
|
||||
it('the char-budget finding ID matches CA-CML-NNN', () => {
|
||||
assert.match(charFinding(result)?.id || '', /^CA-CML-\d{3}$/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('CML scanner — large-by-lines but under the char budget (no false char finding)', () => {
|
||||
// large-cascade/CLAUDE.md is 1024 lines but only 37,393 chars (short lines):
|
||||
// under CC's 40.0k char threshold, so the char-budget finding must NOT fire —
|
||||
// proving the check keys on chars, not raw size or line count.
|
||||
let result;
|
||||
beforeEach(async () => {
|
||||
resetCounter();
|
||||
const discovery = await discoverConfigFiles(resolve(FIXTURES, 'large-cascade'));
|
||||
result = await scan(resolve(FIXTURES, 'large-cascade'), discovery);
|
||||
});
|
||||
|
||||
it('does not emit a char-budget finding under 40k chars', () => {
|
||||
const f = result.findings.find((x) => /performance-warning threshold/i.test(x.title || ''));
|
||||
assert.ok(!f, 'a 37k-char file (under 40.0k) must not trip the char-budget finding');
|
||||
});
|
||||
});
|
||||
|
||||
describe('CML scanner — empty project', () => {
|
||||
let result;
|
||||
beforeEach(async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue