Skip to content

docs: Make CLAUDE.md lean - #2166

Merged
huang195 merged 3 commits into
rossoctl:mainfrom
huang195:docs/claudemd-lean
Nov 28, 2026
Merged

huang195 merged 3 commits into
rossoctl:mainfrom
huang195:docs/claudemd-lean

Conversation

@huang195

Copy link
Copy Markdown
Member

Problem

Claude Code loads the root CLAUDE.md on every request. The file was 35.6 KB, about 9k tokens. Most of it was reference material that the code or docs/ 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.md goes from 35.6 KB to 7.2 KB.

Kept (only in CLAUDE.md, or a silent trap):

  • The worktree workflow, and the warning that all sessions share one proxy on :47600.
  • Sign-off, attribution and the PR title format.
  • The frozen AuthBridge names table.
  • The nested CLAUDE.md table.
  • Rules that break silently: plugins are opt-in build tags, plugin contracts, core/ has external consumers, the session API has no authentication, DELETE does not clear accountant state, egress_allow_hosts covers the forward proxy only, and memory measurement.
  • The checks to run before a push.

Cut (each fact is in docs/ or a code comment):

Cut from CLAUDE.md Where it is now
DELETE retention details, savings fields, accounting config docs/session-api.md, docs/pricing.md, docs/laptop-service.md
Fields that need a restart validateReloadable, docs/framework-architecture.md
The interning reset rule core/session/intern.go
The RawJSON named-type trap core/model/extensions.go, plus a test
egress_allow_hosts scope core/config/config.go, docs/session-api.md
Go lint, vet, tidy and agentop shard commands CONTRIBUTING.md
Ports, layout, binaries cmd/README.md, core/README.md

Moved, because no other file 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 removed section.

Removed x-authbridge-unmapped-<name> from the frozen names. No code uses that header.

Verification

  • I grepped about 70 facts from the old file against docs/, the READMEs, CONTRIBUTING.md and the code.
  • pre-commit passes, including the relative link and anchor check.

Assisted-By: Claude (Anthropic AI) noreply@anthropic.com

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>
@huang195
huang195 requested a review from a team as a code owner November 28, 2026 15:58
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96e12c7d-e327-4fc8-9cba-5f7b748270b5
Commits

Reviewing files that changed from the base of the PR and between 2cb6e04 and 52064d5.

Files selected for processing: 8

  • CLAUDE.md
  • CONTRIBUTING.md
  • core/session/fold.go
  • core/session/intern_interleaved_test.go
  • deploy/proxy-init/CLAUDE.md
  • docs/framework-architecture.md
  • docs/session-dump.md
  • scripts/dev/check-test-timing.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions github-actions Bot added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 28, 2026
- 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 clawgenti left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@huang195
huang195 merged commit 1f3a070 into rossoctl:main Nov 28, 2026
40 of 41 checks passed
@huang195
huang195 deleted the docs/claudemd-lean branch November 28, 2026 19:00
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 28, 2026
huang195 added a commit that referenced this pull request Nov 28, 2026
#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants