Repository navigation
CLAUDE.md: keep core rules, move feature notes to docs/claude/ area files (#1903) - #1907
Merged
Merged
Conversation
CLAUDE.md was 178k characters, over Claude Code's 150k memory-file limit, so part of the project's instructions never reached the agents. It now holds only what every session needs: how work is done, an index of area files, build and test commands from ci.yml, the cross-crate invariants restated from the moved notes, and the cross-cutting DOCX Bidi, Text input, Build info and Dialogs sections (verbatim). The other 74 sections moved verbatim, by script, in their original order, into 21 area files under docs/claude/. The one body edit is in #1374: "(#1378, below)" was already wrong (that section came before it), now "above".
Fails when CLAUDE.md is over 40,000 characters, when an area file under docs/claude/ is not in its index or the index names a missing one, when a ## heading lives in two places, or when CLAUDE.md has a section outside KEPT, so a feature's new notes cannot go back into CLAUDE.md unnoticed. --moved-from [REV] compares with CLAUDE.md at REV (default: the merge base with origin/main): every old section found exactly once, body diffs shown. The unit tests run in the sweeps' existing "Sweep runner unit tests" step.
Linux leg only, right after checkout, so a docs failure shows before the Rust toolchain is installed.
The sheet-file bullet and intro read "load and save" of notes and x14 validation, but #1335 is notes following row/column insert and delete and #1817 is the Data Validation dialog, so a session changing those would not see the bullet applies. Reread every bullet against its file's sections and named the other topics missed: Undo of a table step, the theme command, the suite as a library, the formatting model, Marked/Highlight/changed cells, zoom and its dialogs, Editor sort and filters, MSPDI/.mpp dates, backstagecore's Save As name, settings.xml and the H&F topics.
Check 2 took any mention of docs/claude/<name>.md anywhere in CLAUDE.md, so a file named under Cross-crate invariants or as a cross-pointer inside another bullet passed with its own index entry deleted. It now counts only bullets of the Area notes section that start with the path, and says so when that section is missing. Check 3 still scans the whole file.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Owner
Author
|
Merged automatically (auto-merge is on for this checkout): review stopped: round 1 had no Major; all findings fixed; merge rounds: none; whole suite green on 5d9560e (check-claude-md.py + 69 script unit tests; no Rust touched, CI 14/14 green); merge-check ok. Follow-ups: none (no finding deferred). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLAUDE.md was 178,494 characters, over Claude Code's 150,000-character limit for a memory file, so part of the project's instructions could miss the agents. It now keeps only what every session needs (14,838 characters), and the per-feature notes live in area files under
docs/claude/.Closes #1903
What changed
CLAUDE.md: the rule at the top (a feature's notes go into its area file, never a new section here; 40,000-character budget; CI check), then How work is done, an Area notes index (one bullet per area file: when to read it, the topics and issue numbers, so a grep for an issue number lands on the right file), a short Build and test (only commands fromci.yml), Cross-crate invariants (restated from the area notes, each naming its file), and the kept sections verbatim: DOCX Bidi Rendering, Text input (dead keys, IME), Build info, Dialogs and typed input (Tests: type into every editable input (all dialog fields, formula bar, Name Box, Find, ribbon combos, Backstage fields) with real keys; a catalogue so none is missed #1029).docs/claude/: 21 area files holding the other 74 sections, moved verbatim by script in their original order: docx-editing, suite-document, pdf-export, html-import, clipboard, macos, suite-shell, suite-extensions, ribbon, help, ui-plugins, project-formats, project-text-styles, project-gantt, project-table, project-task-info, project-scheduling, sheet-ui, sheet-file, terminal-editors, mail. Each opens with a header saying what it covers, that it is not loaded automatically, and that paths are from the repository root.scripts/check-claude-md.py(stdlib only) fails when CLAUDE.md exceeds 40,000 characters, an area file has no bullet of its own in the Area notes index, CLAUDE.md names an area file that does not exist, a##heading appears twice across the files, or CLAUDE.md has a##section not in itsKEPTlist. That last check stops a branch written against the old CLAUDE.md from adding a feature section back.--moved-from [REV](default: the merge base with origin/main) proves the move.testjob runs the check right after checkout (Linux leg). The new unit tests run in the sweeps' existingunittest discover -s scriptsstep.The one edit inside moved text: #1374's "(#1378, below)" is now "(#1378, above)" (it already was above in the old file). Other "below"/"under" references stay in the same file, in order.
Tests
python3 -m unittest discover -s scripts -p 'test_check_claude_md.py' -v: 22 tests OK (budget in characters, not bytes; padded file fails; unindexed, cross-pointer-only and missing area files; duplicate headings; fenced code; KEPT;--moved-fromcases). The whole scripts set: 69 tests OK.python3 scripts/check-claude-md.py→CLAUDE.md: 14838 / 40000 characters, 21 area files in docs/claude/; on the old CLAUDE.md it fails (budget, 74 unlisted sections, missing kept sections).python3 scripts/check-claude-md.py --moved-from(merge base):No Rust is touched.
Review
--moved-fromagainst the merge base).🤖 Generated with Claude Code