Skip to content

Cut CLAUDE.md under the agent-context cap - #127

Merged
thedavidmeister merged 2 commits into
mainfrom
2026-08-19-agent-context-cap
Aug 19, 2026
Merged

Cut CLAUDE.md under the agent-context cap#127
thedavidmeister merged 2 commits into
mainfrom
2026-08-19-agent-context-cap

Conversation

@thedavidmeister

@thedavidmeisterthedavidmeister commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

rainix-sol / static fails on every PR to this repo:

ERROR: this repo loads 4099 bytes of agent context at the start of every session — 3 over the 4096-byte cap.
Cut 3 bytes; do NOT raise the cap (it is a floor-only ratchet).

CLAUDE.md is the only agent-context file here and it is 4099 bytes on main, so the failure is pre-existing rather than introduced by any one PR — #126 was simply the first run to observe it. This cuts it to 3906, 190 under the cap.

QA

  • Discriminating tests: n/a - docs-only diff, no Solidity source or test file is touched. The check this satisfies is rainix-sol / static (agent-context-cap), which fails on base at 4099 bytes and passes here at 3906.
  • Mutations applied: n/a - no executable code in the diff to mutate.
  • Oracle: the gate itself. wc -c CLAUDE.md -> 3906 against the 4096-byte cap the error message names, independent of any claim in this body. CLAUDE.md is the only agent-context file in the repo.
  • Category check: the error asks for 3 bytes cut and no cap raise; cut 193, raised nothing. Every factual claim in the replacement text verified against the repo - no .gitmodules; no remappings.txt and no remappings key in foundry.toml; libs = ["dependencies"]; import prefixes under src/ are forge-std-1.16.1, rain-lib-hash-0.1.0, rain-math-binary-0.1.4, rain-sol-codegen-0.1.0, rain-solmem-0.1.3.

What was cut, and why these bytes

Both cuts remove content that was empty or wrong, rather than trimming words off correct prose.

The pragma line.Interfaces use pragma solidity ^0.8.25; libraries and errors use ^0.8.25. — the same version sits on both sides of the semicolon, so the sentence draws a distinction it does not then make. The compiler line above it already states 0.8.25.

The Dependencies section. It described git submodules in lib/ with a remapping configured in foundry.toml. This repo has neither: no .gitmodules, no remappings, and libs = ["dependencies"]. The package list was stale in both directions — it named rain.math.float and rain.intorastring, neither declared, and predates the version-suffixed import paths soldeer generates. Replaced with what an agent editing imports here actually needs: the paths carry the version, so a bump rewrites every import of that package.

Summary by CodeRabbit

  • Documentation
    • Updated build documentation to reflect the current dependency management approach.
    • Removed outdated guidance related to Solidity compiler pragmas.
    • Clarified versioned dependency import paths for more consistent builds.

CLAUDE.md was 4099 bytes against the 4096-byte cap, so rainix-sol / static
failed on every PR to this repo. Now 3906.
Two cuts, both content that was wrong or empty rather than arbitrary bytes:
- The pragma line stated the same version on both sides of its semicolon, so
it distinguished nothing that the compiler line above it did not already say.
- The Dependencies section described git submodules in lib/ with a remapping in
foundry.toml. This repo has no .gitmodules and no remappings; it is soldeer
with libs = ["dependencies"]. The list was also stale, naming rain.math.float
and rain.intorastring, neither of which is declared.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fa52f0c6-63b2-49f9-a8f9-cb28106cf2f3

📥 Commits

Reviewing files that changed from the base of the PR and between e38806a and 369b3b5.

📒 Files selected for processing (1)
  • CLAUDE.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

CLAUDE.md removes Solidity pragma guidance and documents Soldeer-managed dependencies with versioned import paths.

Changes

Build documentation

Layer / File(s)Summary
Update build conventions
CLAUDE.md
Removes guidance for distinguishing pragma versions. Replaces Git submodule instructions with Soldeer dependency management and versioned package import paths.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk:⚪ Minimal · up to 369b3

This docs-only change reduces agent context from 4099 to 3906 bytes, below the 4096-byte limit, without changing product or runtime behavior; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly states that CLAUDE.md was reduced to meet the agent-context cap.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-08-19-agent-context-cap

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

Comment @coderabbitai help to get the list of available commands.

Both sides replaced the dead submodule paragraph; the cap-cut side is kept
because main is 4276 bytes against the 4096 agent-context cap this PR
exists to satisfy, and the terse line carries the versioned-import fact
without reintroducing anything false.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@thedavidmeister
thedavidmeister merged commit 3b2adae into mainAug 19, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
base_ref="$(git merge-base HEAD origin/main 2>/dev/null || true)"if [ -z"$base_ref" ];then
base_ref="$(git merge-base HEAD main)"fiprintf'%s\n''=== Changed files ==='
git diff --name-status "$base_ref"...HEAD
printf'%s\n''=== Diff stat ==='
git diff --stat "$base_ref"...HEAD
printf'%s\n''=== Complete diff ==='
git diff --no-ext-diff --unified=80 "$base_ref"...HEAD

Length of output: 612


SIZE=S

You are interacting with an AI system.

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.

1 participant

@thedavidmeister