docs(claude-md): trim derivable content from always-loaded memory - #30
Merged
Conversation
CLAUDE.md loads in full on every session; roughly 75% of it restated facts a session can recover from the repo in a few tool calls. Removed as derivable: directory tree, architecture diagram, API endpoint list, six env-var tables (defaults live in src/config.rs), the observability stack section (ports are in docker-compose.yaml), quick-start and test commands (standard cargo invocations, and the hardcoded test counts had drifted), message format and event types (src/models/event.rs), the error-type/status list (src/error.rs), the dependency list (Cargo.toml), CI/CD (.github/workflows/), and License. The no-unwrap/no-expect rule went too: Cargo.toml [lints.clippy] already denies it mechanically. Compressed rather than dropped, so the contracts survive: RateLimitError startup-failure behavior, the enum-variant (not string-match) rule for connection errors, shutdown ordering and the Notify-not-polling rationale, and the middleware invariants (auth meters failures only, fallible RateLimitLayer::new, exact-path bypass). RATE_LIMIT_BURST's replace-not-add semantics moved from the cut table into prose. Kept verbatim: Iggy SDK integration rationale, TRUSTED_PROXIES contract, request-timeout contracts, 0-indexed partitions, fuzz commands, log levels, middleware order, deployment security. 824 -> 233 lines (~7.7k -> ~2.3k est. tokens per session).
mlevkov
added a commit
that referenced
this pull request
Aug 1, 2026
…orward TD-2026-07-09 flips to resolved with a Resolution section covering all six commits: the state enum and what it deleted, the three leaks and the distinct mechanism that closes each, the sync lock as a prerequisite rather than a preference, the observability split, and the surface narrowing. It also corrects its own deferral note. "The enum refactor is shape-only with no behavioral delta" held for the enum and for the sync conversion it turned out to require, but not for the permit -- releasing on drop is a real behavior change and the only one this TD carried. Left uncorrected, that sentence would sit directly above a resolution disproving it. TD-2026-07-08 gains two silences the plan review found that its Problem section did not name: a rejected header is indistinguishable from an absent one, so the echo alone cannot close its item 2; and a non-UTF-8 header value is dropped with no log at all, because the malformed-value warn sits inside the to_str success branch. Recorded on the TD rather than only in the review artifacts, since the registry index is what a future session actually reaches. Its deferral to session 04 is noted with the reason -- the two records were mis-sequenced, not oversized. Registry row synced by hand; this repo has no index generator. README's test count moves 183 -> 191, verified by running the suite rather than by arithmetic. CLAUDE.md needs no equivalent edit: PR #30 removed the section that carried counts.
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLAUDE.mdis loaded in full into every session's context, and roughly 75% of itrestated facts that a session can recover from the repo itself — the directory tree,
the dependency list, env-var tables, CI workflow descriptions. This trims it from
824 to 233 lines (~7.7k → ~2.3k estimated tokens per session) while keeping every
non-derivable contract, gotcha, and design rationale.
Documentation-only: no source files are touched.
Type of Change
Changes Made
Removed as derivable from the repo:
ls/findoutputsrc/routes.rssrc/config.rsdocker-compose.yamlcargoinvocations, and the hardcodedtest counts (183/30/18) had already drifted
src/models/event.rssrc/error.rsCargo.toml.github/workflows/LICENSEunwrap()/expect()" rule —Cargo.toml[lints.clippy]setsunwrap_used = "deny"andexpect_used = "deny", and CI runsclippy -D warnings,so the build enforces it whether or not the doc says so
Compressed to prose, so the contract survives without the copied code:
RateLimitError/build_router()startup-failure behaviorNotify-not-polling rationale, with a pointer todocs/structured-concurrency.mdRateLimitLayer::new(),exact-path bypass
RATE_LIMIT_BURSTreplace-not-add semantics, moved out of the deleted tableKept verbatim (not recoverable from code — these encode why, not what): Iggy SDK
integration rationale, the
TRUSTED_PROXIESsecurity contract, request-timeout contracts,0-indexed partitions, fuzz-test commands, the log-level convention, middleware order,
and deployment security.
Testing
Documentation-only change; no source files touched, so no tests were added and none were
run locally. Verified instead:
level where their parent heading was removed (
### Iggy SDK Integration→##,#### Log Levels→###)src/config.rs,.env.example,docs/structured-concurrency.md,docs/README.mdCLAUDE.mdis modifiedCI runs the full fmt/clippy/test matrix on this branch regardless.
Checklist
Code Quality
Code follows project style guidelines (— n/a, no source changescargo fmt)No new Clippy warnings— n/a, no source changesPublic APIs have documentation comments— n/a, no API changesError handling is appropriate— n/a, no source changesTesting
Tests cover the happy path / error cases— n/a, no behavior changesDocumentation
README updated— n/a, no user-facing changesthe trim
Security
Input validation— n/a, no source changesTRUSTED_PROXIEScontract anddeployment-security guidance were deliberately preserved in full
Related Issues
None.
Additional Notes
On the PR size check:
pr.ymlwarns above 500 changed lines; this is 655(32 insertions, 623 deletions). It is a pure documentation deletion, so the raw line
count overstates the review surface — the 32 inserted lines are the only new prose.
Reverting any single block:
git show <this-commit>^:CLAUDE.mdhas the original file.Not included here (proposed but deliberately deferred): moving the Deployment Security
section to a lazily-loaded skill, which would save a further ~370 estimated tokens per
session. It stays inline in this PR.