Skip to content

docs: split CLAUDE.md per-HAL — cross-cutting root, per-generation files load on-demand#312

Merged
josephnef merged 1 commit into
masterfrom
claude-md-per-hal-split
Jul 19, 2026
Merged

docs: split CLAUDE.md per-HAL — cross-cutting root, per-generation files load on-demand#312
josephnef merged 1 commit into
masterfrom
claude-md-per-hal-split

Conversation

@josephnef

Copy link
Copy Markdown
Collaborator

Root CLAUDE.md hit the Claude Code 40k-char warning (40,779 chars) and grows with nearly every feature PR. This splits it along the loading semantics the harness actually implements: nested subdirectory CLAUDE.md files load on-demand (when files in that subtree are read), while @imports load eagerly at startup — so a nested split is the only form that reduces per-session context.

Layout

file chars loads
CLAUDE.md 30,346 every session (~10k headroom under the limit)
src/kestrel/CLAUDE.md 6,850 on-demand
src/jaguar1/CLAUDE.md 2,610 on-demand
src/jaguar3/CLAUDE.md 2,252 on-demand
src/jaguar2/CLAUDE.md 2,031 on-demand

The root keeps cross-cutting knowledge (capability map + naming traps, build, hardware testing, logging, env knobs, hopping/chanmig, architecture, gotchas, TX path) and states the convention up top: new per-generation facts go in the subtree file, cross-cutting facts in the root. Per-generation register-level facts (Kestrel _V1 banks/descriptors/cold-boot, the RF18 value-edge trap, 0x8ac/0x9b0 narrowband encodings, the coex runtime thread, per-packet TX-power mechanisms, HAL file maps) move to the subtree files.

Zero information loss

Audited: every hex register and backticked token from the old file is present in the new corpus. The only deliberate drops are one issue-# tag and the SipHash permutation formula (which lives in docs/fhss.md).

Cross-references

CMakeLists.txt, docs/8852c-quirks.md and src/jaguar3/RtlJaguar3Device.h repointed at the subtree files; the stale "(CLAUDE.md defence #1)" tag in tests/bench_onair.py dropped (rail-sag guidance no longer lives there). Build green — the only non-doc changes are comments.

🤖 Generated with Claude Code

…les load on-demand

Root CLAUDE.md (40.8k chars) tripped the Claude Code 40k warning and grows
with nearly every feature PR. Cross-cutting operational knowledge stays in
the root (~30k); per-generation register/descriptor/mechanism facts move to
src/{jaguar1,jaguar2,jaguar3,kestrel}/CLAUDE.md, which Claude Code loads
on-demand when reading files in that subtree (@imports load eagerly, so a
nested split is the only form that reduces startup context).

No fact dropped: hex-register + backticked-token audit of old vs new corpus
is clean (deliberate drops: one issue-# tag, the SipHash formula that lives
in docs/fhss.md). Cross-references repointed (CMakeLists.txt,
docs/8852c-quirks.md, RtlJaguar3Device.h); the stale rail-sag CLAUDE.md tag
in tests/bench_onair.py dropped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@josephnef
josephnef merged commit df08458 into master Jul 19, 2026
18 checks passed
@josephnef
josephnef deleted the claude-md-per-hal-split branch July 19, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant