docs: one Claude file — cut agent context from 24227 to 2209 bytes, under the 4096-byte cap - #130
Conversation
`rainix / static` fails on main and every open PR: the repo loaded 24227 bytes of agent context at the start of every session, 20131 over the 4096-byte cap. It now loads 1341. CLAUDE.md keeps only irreversible hazards and rulings whose rationale is not recoverable from the code. The `src/` layout exception and the fork-test RPC requirement move to `.claude/rules/` with `paths:` frontmatter, which loads on demand and is not charged. Everything else is discoverable from README.md, the NatSpec, foundry.toml and the workflows, and is deleted. `RegistryDeploySuites`' NatSpec pointed at the scoped exception "recorded in CLAUDE.md" and now names the rules file that holds it. `.claude` is excluded from the published package alongside CLAUDE.md, and covered by REUSE.toml the way `.github` is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 14 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
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. Comment |
`CLAUDE.md` is the repo's only agent-context file. The three rulings worth keeping from the two rules files move into it and the files are deleted; the five RPC URLs become a committed `.env.example`, which is read on demand and not charged. A rule scoped to `src/**/*.sol` + `script/**/*.sol` + `test/**/*.sol` is every Solidity file in the repo, so it loads on essentially every turn — the same permanent charge as `CLAUDE.md`, moved where the gate does not count it. Relocation is only for content that has already passed the inclusion test and merely happens to be path-scoped. `RegistryDeploySuites` NatSpec points back at `CLAUDE.md`, and `REUSE.toml` no longer annotates `.claude/**/`. agent-context-cap: 2213 bytes loaded at session start (cap 4096). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ullet Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…e the bar #89 added a description of the source-anchor group to CLAUDE.md after this branch was cut — what `RainDeployBroadcast.run()` calls and in what order, and which group is defined on the declaration rather than on a test contract. All of it is discoverable. `run()` calls the anchor on its first line, and `RainDeploySuitesBase` defines it exactly once; a reader who opens either file has the whole answer. The property the prose argues for is also the one #89's mutation matrix pins twice over — deleting the call and moving it after `suiteByName` are both killed — so it is enforced rather than remembered, which is the case the cap's own rule says belongs in a gate and not in context. So the resolution is this branch's file entire. Charged bytes are unchanged at 2209 against the 4096 cap. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Reviewed 7061fba: ready — Closes the repo-wide Read off the CI log on this head rather than a local run: One agent file, seven bullets, no The five RPC URLs went to The merge with main takes this branch's file entire. #89 added a description of the source-anchor group after this branch was cut;
The finding worth carrying forward: the gate does NOT enforce the one-file rule. Restoring both deleted rules files verbatim with their Merging this restores slither to CI across the repo: CodeRabbit reports |
Refs rainlanguage/rainix#298
rainix / static / staticfails onmainand on every open PR:After this PR, from the same
rainix-staticbinary the action runs:The cap is not raised, the check is not skipped, and nothing is imported with
@path(which would be charged the same).This repo gets ONE agent file
There is no
.claude/rules/directory, and adding one is not the way under thecap. A rule scoped to
src/**/*.sol+script/**/*.sol+test/**/*.solisevery Solidity file in the repo: it does not load on demand, it loads on
essentially every turn that touches anything, which is the same permanent charge
as
CLAUDE.mdmoved somewhere the gate does not count it. Relocating to apath-scoped rule is only for content that has ALREADY passed the inclusion test
and merely happens to be path-scoped. Content that fails the test is deleted,
wherever it would otherwise land.
The repo is not big enough to justify a second file, so everything that survives
fits in
CLAUDE.mdalone — 2209 charged of 4096, with 1887 to spare.The test, applied per LINE and not per file
CLAUDE.mdis seven bullets. What each one stops an agent doing:Manual sol artifactsisworkflow_dispatchonlysol-v*tag is the sole release trigger;[package].versionis the LAST publish[package].versionin an ordinary PR, treating it as a next-version slotsrc/generated/<tag>/is append-onlyADDRESS_REGISTRY_ROOT == address(0)is INTENDEDsrc/are a SCOPED exception, not to be copied into a consumer repotest/src/**mirroringsrc/**slither.config.jsonfilters those abstracts by exact filename, never by thesrc/abstract/prefixvm.createSelectForkfailure is not a missing deploymentNotDeployedOnNetworkand chases a deploy that is fineEach is a wrong ACTION, not a slow one. Everything else is discoverable and is
gone.
What the two
.claude/rules/files contributed, and what was cut from themBoth files are deleted. Line by line:
src/holds the deploy machinery, and that is a scoped exception — incl. do-not-copyslither.config.jsonmatches filenames exactly, keep it that way when adding an abstractvm.createSelectForkfailure ≠NotDeployedOnNetwork.soldeerignoreexcludestest/, so an abstract there is unusable downstream.soldeerignorevm.createSelectForkerror names the missing variable when it fires<NETWORK>_RPC_URLvalues.env.example.env.exampleis a file, not context: an agent reads it on demand, it is whereanyone looks for it anyway, and the gate does not charge it. It is not restated
in prose.
What was deleted outright, and where each is recoverable from
Object to any specific one of these rather than to the diff as a whole.
README.mdopening + "Approach"README.md§ Develop, which lists what each of the three reusable workflows runssrc/lib/LibRainDeploy.solfunction-by-function tourIAddressRegistryV1/AddressRegistry(mutable bindings, resolve-once)README.md§ Address registry, at greater lengthIMigrationRegistryV1/MigrationRegistry— timestamp-not-flag, non-zero genesis, head vs per-migration refusal,msg.sendernamespaceREADME.md§ Migration registry, which states every one of themDEPENDENCIESfrozen with the releasescript/Build.sol's own contract NatSpec, which says all of itGeneratedSnapshotShapeTestshape spec, "values deliberately not asserted"ast = true, the pinned solc settings, the[package].versioncommentfoundry.toml, which comments all threeREADME.md§ Deploy verification, including the tableRainDeploySuitesBase/RainDeployBroadcast/Deploy.sol/RainDeployVerify*descriptionsREADME.md§ One declaration + the contracts' NatSpecREADME.md§ Deploying, and then releasingREADME.md§ License,REUSE.toml, andrainix-sol-legalenforcing itEdits outside
CLAUDE.md.env.exampleis new and committed. Five<NETWORK>_RPC_URLpublicendpoints plus a comment on why all five have to resolve —
RainDeployVerifyChainforks every network insupportedNetworks(), not onlythe one under test. Added to
.soldeerignore(local test setup is not part ofthe published package) and to
REUSE.toml(a.envfile carries no SPDXheader).
src/abstract/RegistryDeploySuites.solNatSpec is unchanged frommain.It says "see the scoped exception recorded in
CLAUDE.md", and that is againwhere the exception is. No pointer to a file that does not exist.
REUSE.tomlno longer annotates.claude/**/— an annotation for a paththe repo does not contain is a licence claim about nothing.
.soldeerignorekeeps its
.claudeline: an ignore has a live subject either way, since alocal
.claude/settings.local.jsoncan appear in a working tree at publishtime.
QA
locally.
nix run path:<rainix>#rainix-static -- agent-context-cap ., theexact binary
.github/actions/agent-context-cap/action.ymlinvokes, fromrainix
main. Before: the 24227-byte failure above, exit 1. After:clean — 2209 bytes loaded at session start (cap 4096), exit 0. The diffcontains no Solidity at all, so there is no behaviour to test.
assuming it. P1 — restore both deleted rules files verbatim,
paths:frontmatter intact: charged total stays at 2209, and the gate reports
clean. So nothing in CI would catch a future agent moving text back into.claude/rules/behind an all-Solidity glob; the line inCLAUDE.mdsayingthere is no
.claude/rules/is the only thing that does, which is why it isworth its bytes. P2 — same two files with the frontmatter stripped: 5114,
1018 OVER the cap, exit 1, both files named. P2 is what makes P1 a real null
rather than a harness that measured nothing: the tool does see those files and
does charge them, and
paths:is precisely the thing that makes them free.Tree restored to 2209 and
git statusclean after each.arithmetic.
rainix-static'sagent_context_capchargesCLAUDE.mdplustransitive
@pathimports plus every.claude/rules/**.mdwithoutpaths:,and strips block-level HTML comments — which is why 2344 bytes on disk are
2209 charged (the two SPDX comment lines). Every number here is a line of the
tool's output.
raising it or skipping the check — and the category is every file the gate
charges. Covered:
CLAUDE.mdis the only charged file that exists,.claude/does not exist at all, no@pathimport is introduced. The capconstant is untouched and lives in rainix, not here. Adjacent and deliberately
not done: Unname every return under src/, and stop the generator emitting named ones #129 (named
returns) is a live ruling, but the old
CLAUDE.mddocumented no return-namingconvention, so there was nothing to relocate and nothing was invented.
Local verification
nix develop -c forge fmt --check— exit 0.nix develop -c reuse lint— compliant, 77/77 files with copyright andlicence information, exit 0 (78/78 previously: two rules files out, one
.env.examplein).denofmtandtaplo— passed on commit.forge testis not run against this branch because it cannot differ frommain:git diff main --name-statusis exactly.env.example,.soldeerignore,CLAUDE.md,REUSE.toml. No.sol, nofoundry.toml, noremappings.txt, nosoldeer.lock, noslither.config.json— nothing thecompiler or the test runner reads. CI runs it anyway and is the verdict that
counts.