docs(claude): refactor CLAUDE.md for higher signal-to-noise - #17
Merged
Conversation
Restructure the project guidance file along three axes without dropping any rule: - Hoist the five most safety-critical rules into a "Hot path" section at the top so Claude grep-anchors there first when reading the file. - Add an "Agent constraints (this fork)" section that names the actions Claude must not take autonomously (push to ship/internal, run scripts/release-tag.sh, edit upstream UI build artifacts). - Add a "Test discipline" section covering spec-first assertions, pytest.mark.xfail(strict=True) for known doc-vs-impl gaps (not skip / TODO), and the "test exposed a bug != bug is fixed" PR-summary norm. Mechanical cleanups: - Collapse five command-list sections (Installation / Testing / Code Quality / Single Test Files / Running Scripts) into one "Development workflow" block with a single shell example. - Compress the "Architecture Overview" enumeration of folders — what litellm/main.py, litellm/llms/, litellm/proxy/auth/ etc. contain is inferable from `ls`. Keep only non-obvious design decisions (Router sync vs proxy async; litellm_extras/ isolation; UI build-artifact format churn). - Drop emphasis (**bold** / NEVER / MUST) on style preferences that don't cause production incidents (dict spread, comprehension extraction, FastAPI Query declarations). Emphasis remaining is reserved for rules whose violation has caused or could cause data loss, security holes, or production outages. Numbers: - words 2538 → 2000 (-21%) - estimated tokens 3300 → 2600 (-21%) - emphasis markers 38 → 9 (-76%) All 13 spot-checked critical rules verified preserved: Never-raw-SQL, Prisma-model-methods, LLMClientCache._remove_key, release-tag.sh, ship/v1.83.10 PR target, antd migration, sessionStorage, schema.prisma, TRANSPORT.OPENAPI, MCP credential table, no-pipe-curl-to-shell, check_valid_key, litellm-proxy-extras migration lag.
This was referenced Jun 4, 2026
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
Restructure CLAUDE.md to surface the rules that matter and trim the
rules that don't. No safety rule was dropped — only consolidated,
demoted from emphasis, or removed if it described filesystem layout
that's inferable from `ls`.
top so Claude grep-anchors there first when reading the file.
must not take autonomously (push to `ship`/`internal`, run
`scripts/release-tag.sh`, edit upstream UI build artifacts).
`pytest.mark.xfail(strict=True)` for known doc-vs-impl gaps
(instead of `skip` / TODO), and the "test exposed a bug ≠ bug is
fixed" PR-summary norm.
Mechanical cleanups:
Quality / Single Test Files / Running Scripts) into one
"Development workflow" block.
`litellm/main.py`, `litellm/llms/`, `litellm/proxy/auth/` etc.
contain is inferable from the directory tree. Keep only non-obvious
design decisions.
don't cause production incidents (dict spread, comprehension
extraction, FastAPI Query declarations). Emphasis remaining is
reserved for rules whose violation has caused or could cause data
loss, security holes, or production outages.
Numbers
Rule-preservation spot checks
All 13 verified preserved in the new file:
Never-raw-SQL · Prisma-model-methods · `LLMClientCache._remove_key` ·
`release-tag.sh` · `ship/v1.83.10` PR target · antd migration ·
`sessionStorage` · `schema.prisma` · `TRANSPORT.OPENAPI` · MCP
credential table · no-pipe-curl-to-shell · `check_valid_key` ·
`litellm-proxy-extras` migration lag.
Test plan