Skip to content

docs(claude): refactor CLAUDE.md for higher signal-to-noise - #17

Merged
songkuan-zheng merged 1 commit into
ship/v1.83.10from
fix/claude-md-refactor
May 22, 2026
Merged

docs(claude): refactor CLAUDE.md for higher signal-to-noise#17
songkuan-zheng merged 1 commit into
ship/v1.83.10from
fix/claude-md-refactor

Conversation

@songkuan-zheng

Copy link
Copy Markdown
Collaborator

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`.

  • Hoist five safety-critical rules into a "Hot path" section at the
    top
    so Claude grep-anchors there first when reading the file.
  • Add "Agent constraints (this fork)" — names actions Claude
    must not take autonomously (push to `ship`/`internal`, run
    `scripts/release-tag.sh`, edit upstream UI build artifacts).
  • Add "Test discipline" — covers spec-first assertions,
    `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:

  • Collapse five command-list sections (Installation / Testing / Code
    Quality / Single Test Files / Running Scripts) into one
    "Development workflow" block.
  • Compress the "Architecture Overview" enumeration of folders — what
    `litellm/main.py`, `litellm/llms/`, `litellm/proxy/auth/` etc.
    contain is inferable from the directory tree. Keep only non-obvious
    design decisions.
  • 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

before after change
Words 2538 2000 -21%
Estimated tokens ~3300 ~2600 -21%
Emphasis markers 38 9 -76%

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

  • Visual review of new section order
  • Confirm no safety rule was lost vs the pre-refactor version
  • Confirm emphasis is now reserved for incident-grade rules only

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.
@songkuan-zheng
songkuan-zheng merged commit c7e63a4 into ship/v1.83.10 May 22, 2026
1 check passed
@songkuan-zheng
songkuan-zheng deleted the fix/claude-md-refactor branch May 22, 2026 09:33
Sign up for free to 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