Skip to content

docs: trim CLAUDE.md to what the codebase cannot tell a session itself - #10

Merged
btravers merged 1 commit into
mainfrom
docs/claude-md-trim
Aug 12, 2026
Merged

docs: trim CLAUDE.md to what the codebase cannot tell a session itself#10
btravers merged 1 commit into
mainfrom
docs/claude-md-trim

Conversation

@btravers

Copy link
Copy Markdown
Contributor

The root CLAUDE.md had grown to 53.7k chars — past the point where Claude Code warns about a memory file — and every session paid for all of it. None of the rules changed; this is three maintenance passes over the file.

Cut what the repo already says

Four blocks a session can reconstruct with ls or by reading a manifest:

  • the Node/pnpm version floors (engines, packageManager, .node-version)
  • the pnpm vitest run … scoping block — a standard invocation, and test:types is already a script
  • the packages/start/src/ file enumeration
  • the published-package/tsconfig field restatements

The declarationMap: false rationale stays. That one the config cannot explain.

Fix three references that had drifted

The file enumeration was not merely derivable, it was wrong: it named ambient.ts, drain-report.ts, signals.ts and uncaught.ts, none of which have existed since those concepts were folded into units.ts, drain.ts and process-handlers.ts. Two live citations went with them, plus the docs-examples.test-d.ts note:

WasNow
`UnitRecord` in `ambient.ts`units.ts:5
`ambient.spec.ts` → _"does not leak between concurrent units"_units.spec.ts:31
cannot drift from `runtime.ts` or `drain-report.ts`drain.ts:7

Move the kernel internals behind a directory

"Load-bearing runtime invariants" and "Internal design" now live in packages/start/CLAUDE.md, which loads only when a session works under that directory. Nothing in examples/, the READMEs or CI needs either section. Both are byte-identical to what left the root file, and a ## Kernel internals pointer replaces them.

"Public surface" deliberately stays in the root: examples/ consumes that API.

Root file: 53,748 → 38,624 chars, back under the warning threshold.

Gate

pnpm format --check and pnpm knip green; the rest of the gate is untouched by a docs-only change. No changeset — CLAUDE.md is not in the published files.

🤖 Generated with Claude Code

The root file had grown to 53.7k chars — past the point where Claude Code
warns about a memory file — and every session paid for all of it. Three
changes, none of them to the rules themselves:
Cut four blocks a session can reconstruct from the repo: the Node/pnpm
version floors (`engines`, `packageManager`, `.node-version`), the
`pnpm vitest run …` scoping block (a standard invocation, and `test:types`
is already a script), the `packages/start/src/` file enumeration, and the
published-package/tsconfig field restatements. The `declarationMap: false`
rationale stays — that one the config cannot explain.
The file enumeration was also wrong: it named `ambient.ts`,
`drain-report.ts`, `signals.ts` and `uncaught.ts`, none of which have
existed since those concepts were folded into `units.ts`, `drain.ts` and
`process-handlers.ts`. Two live citations drifted with them — `UnitRecord`
is in `units.ts`, and "does not leak between concurrent units" is
`units.spec.ts:31` — as did the `docs-examples.test-d.ts` note, which
guards `drain.ts`. All three corrected.
Moved "Load-bearing runtime invariants" and "Internal design" into
packages/start/CLAUDE.md, which loads only when a session works under that
directory. Nothing in examples/, the READMEs or CI needs either section,
and both are byte-identical to what left the root file. "Public surface"
deliberately stays put: examples/ consumes that API.
Root file: 53,748 -> 38,624 chars.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CopilotAI lite review requested due to automatic review settings August 12, 2026 11:06

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors repository guidance by trimming the root CLAUDE.md to remove information that can be trivially reconstructed from the repo/config, and by relocating packages/start-specific internal/kernel-invariant documentation into packages/start/CLAUDE.md so it’s only loaded when working in that package.

Changes:

  • Added packages/start/CLAUDE.md containing the “Load-bearing runtime invariants” and “Internal design” sections for kernel maintenance work.
  • Removed those internal sections (and other derivable/duplicated blocks) from the root CLAUDE.md, replacing them with a pointer to the package-local file.
  • Updated stale references in the root doc to point at current source/test locations (e.g., UnitRecordunits.ts).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

FileDescription
packages/start/CLAUDE.mdNew package-local kernel internals doc (invariants + internal design) for packages/start work.
CLAUDE.mdTrimmed root guidance and replaced detailed kernel internals with a pointer to the package-local doc; fixed drifted references.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@btravers
btravers merged commit 83b681b into mainAug 12, 2026
14 checks passed
@btravers
btravers deleted the docs/claude-md-trim branch August 12, 2026 11:12
Sign up for freeto 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.

2 participants

@btravers