docs: rewrite CLAUDE.md as a contributor guide - #28
Open
menor wants to merge 2 commits into
Open
Conversation
|
Coverage after merging docs/lean-claude-md into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CLAUDE.md duplicated the README: hosted-vs-local setup, env var tables, command lists, a full directory tree. That content rots and pushes the useful parts out of an agent's context. The old tree predated both core/transport/ and core/lean.ts. Keep only what code and README cannot tell you: - Five non-obvious invariants — session binding to the token hash, 401 forwarding needing enableJsonResponse, the lean.ts denylist sparing the list envelope so pagination survives, list() vs info() shape divergence, and the two API-key env vars split by transport. - The command-registration convention, including the two extra steps a read tool needs to avoid shipping the HAL envelope. - Two package.json scripts that are broken: watch targets a missing index.ts, coverage:verify calls a missing check-coverage.sh. 412 lines to 127.
menor-pro
force-pushed
the
docs/lean-claude-md
branch
from
July 29, 2026 01:36
96c5f42 to
d70bc79
Compare
|
Coverage after merging docs/lean-claude-md into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
Author
|
Merge order: #29 first. It fixes the broken |
|
Coverage after merging docs/lean-claude-md into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
menor-pro
force-pushed
the
docs/lean-claude-md
branch
from
July 29, 2026 05:01
257997a to
d70bc79
Compare
|
Coverage after merging docs/lean-claude-md into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage after merging docs/lean-claude-md into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
What
Rewrites
CLAUDE.md. 412 lines down to 127.The file had drifted into a second copy of the README — hosted-vs-local setup, an env var table, a command list, a full directory tree. All of that lives in
README.mdor inupsun-mcp/package.json, and duplicated content rots: the old tree predated bothcore/transport/andcore/lean.ts.What's left is the material a contributor — or a coding agent — cannot get from skimming the code.
The five invariants it now documents
Each one lets the server compile, pass a smoke test, and fail in production:
404 Session not found, deliberately indistinguishable. (fix(auth): bind MCP sessions to the credential token hash #24)enableJsonResponse: true. SSE commits200headers immediately, so it cannot forward. (fix: use stateless streamable HTTP for OAuth #25)lean.tsstrips HAL from resource objects, never from the list envelope — the pagination cursors live there. (feat(read-tools): strip HAL envelope from read output, full opt-out #27, feat: add pagination params to list-project and list-organization #23)list()returns snake_case HAL;info()/get()return camelCase. The generated.d.tsclaims otherwise.Also
The "adding a command" recipe now covers read tools. It previously ended at
Response.json(result)— a read tool written to that recipe ships the full HAL envelope, undoing #27. The missing steps arefull: Schema.full()andlean(result, { itemsKey }).Two broken
package.jsonscripts are recorded as traps, since neither is covered by CI:watchrunstsx watch index.ts; that file does not exist (the entry issrc/index.ts), so it exits withERR_MODULE_NOT_FOUND.coverage:verifycalls./scripts/check-coverage.sh, which is not in the repo.Happy to fix both in a follow-up and drop that paragraph — kept out of here so this stays docs-only.
Verification
Every claim was checked against the code on
mainrather than carried over from the old file. Thecore/tree matchesgit ls-tree. No source files touched.🤖 Generated with Claude Code