Repository navigation
docs: Make CLAUDE.md lean - #2166
Conversation
Claude Code loads the root CLAUDE.md on every request. It was 35.6 KB (about 9k tokens), and most of it was reference material that the code or docs/ already holds. It is now 7.2 KB. Kept: the worktree workflow and the shared-proxy warning, sign-off and attribution, the frozen AuthBridge names, the nested CLAUDE.md table, the rules that break silently, and the checks before a push. Cut: ports, layout, binaries, the session API and accounting details, the hot-reload field list, interning and archive internals, and rename history. Each of these is in docs/ or in a code comment. Moved, because nothing else held them: - "Tests and time" goes to CONTRIBUTING.md. check-test-timing.py now links there. - The session store intent pin goes to docs/framework-architecture.md, next to skip_hosts, which linked to the old section. Removed x-authbridge-unmapped-<name> from the frozen names. No code uses that header. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
- Add scripts/install.sh to the commands that can restart the shared proxy. - Keep the v0.4 kagenti checksum file name as an allowed kagenti string. - Say that new plans and specs still go in docs/superpowers/. - Point deploy/proxy-init/CLAUDE.md at cmd/README.md#ports. - Point docs/session-dump.md at the session: options table. - Point two core/session comments at the rule in Interner.InternEvent. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
"Only vet is a CI gate" came just before the line that says CI gates on go mod tidy -diff. A reader can think that tidy and test jobs do not block a merge. The sentence now compares vet with gofmt only. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
clawgenti
left a comment
There was a problem hiding this comment.
Summary
This PR cuts the root CLAUDE.md from about 470 lines to 126 and moves the two blocks that had no other home ("Tests and time" to CONTRIBUTING.md, the intent pin to docs/framework-architecture.md). I checked the cut material against the PR head. The interning rule is in Interner.InternEvent. The RawJSON named-type trap is in core/model/extensions.go, guarded by core/plugins/opa/tool_parameters_rego_test.go. The egress_allow_hosts scope and its "checked before skip_hosts" rule are in core/config/config.go. The DELETE retention, keeper and stash details are in docs/session-api.md, the savings fields in docs/pricing.md, and the reload fields in validateReloadable and validateAccounting. The mTLS "re-verify by hand" note is in framework-architecture §8a, the plugin ordering, streaming and MetricsProvider rules are in docs/plugin-reference.md, and the vet/gofmt/tidy/agentop-shard commands are in CONTRIBUTING.md. All the new anchors resolve: CONTRIBUTING.md#tests-and-time, cmd/README.md#ports, framework-architecture.md#operator-configuration-session, and the unchanged #naming-cortex-is-the-product-authbridge-is-the-sidecar that core/README.md links to. A code search across the org finds x-authbridge-unmapped only in this CLAUDE.md, so removing it from the frozen list looks safe. No blocking issues.
One stale pointer to fix (suggestion, not blocking). core/plugins/CLAUDE.md:33 still says "the config format is in the root CLAUDE.md, AuthBridge Binaries section". This PR removes that section, and the second commit's pointer fixes missed this line because it is prose, not a link, so the pre-commit link and anchor check cannot catch it. The same facts (YAML, ${ENV_VAR} expansion, mode presets, startup validation) are in core/README.md (the config/ row) and in docs/configuration.md. Pointing there would fix it.
Agent config gate: the diff changes nothing under .claude/ or .vscode/. I read the new root CLAUDE.md and the deploy/proxy-init/CLAUDE.md edit in full. Neither adds a command, URL, hook or permission that the old file lacked (the only URL is the same git fetch https://github.com/rossoctl/cortex.git), and neither contains hidden or bidi Unicode.
Author: @huang195 (MEMBER — maintainer)
Areas reviewed: Docs, agent instructions (CLAUDE.md), Go (comment-only changes in core/session), Python (string-only change in scripts/dev/check-test-timing.py)
Agent/IDE config (.claude/.vscode): none
Commits: 3 commits, all signed-off: yes
CI status: Python Tests (sparc-service) fails, but the failure is not from this PR. It fails the same way on the base commit 2cb6e04 on main and on other open PRs, and this PR changes no sparc-service code. Three Go jobs (agentop, README demo, core peerproc, macOS) were still pending when I reviewed. The only Go changes are comments, so they should not affect those jobs. Everything else passes, including Pre-commit Checks and DCO.
#2166 moved the test-timing rules from CLAUDE.md to CONTRIBUTING.md. Take main's CLAUDE.md, and put the -timeout sentence in CONTRIBUTING.md. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
Problem
Claude Code loads the root
CLAUDE.mdon every request. The file was 35.6 KB, about 9k tokens. Most of it was reference material that the code ordocs/already holds. Current models find these facts when a task needs them, so the file paid the cost on every request for no gain.Change
The root
CLAUDE.mdgoes from 35.6 KB to 7.2 KB.Kept (only in
CLAUDE.md, or a silent trap)::47600.CLAUDE.mdtable.core/has external consumers, the session API has no authentication, DELETE does not clear accountant state,egress_allow_hostscovers the forward proxy only, and memory measurement.Cut (each fact is in
docs/or a code comment):CLAUDE.mddocs/session-api.md,docs/pricing.md,docs/laptop-service.mdvalidateReloadable,docs/framework-architecture.mdcore/session/intern.goRawJSONnamed-type trapcore/model/extensions.go, plus a testegress_allow_hostsscopecore/config/config.go,docs/session-api.mdCONTRIBUTING.mdcmd/README.md,core/README.mdMoved, because no other file held them:
CONTRIBUTING.md.check-test-timing.pynow links there.docs/framework-architecture.md, next toskip_hosts, which linked to the removed section.Removed
x-authbridge-unmapped-<name>from the frozen names. No code uses that header.Verification
docs/, the READMEs,CONTRIBUTING.mdand the code.pre-commitpasses, including the relative link and anchor check.Assisted-By: Claude (Anthropic AI) noreply@anthropic.com