Standing-Context Audit — CLAUDE.md forensics, trim & going-forward rules

Global trim: APPLIED 2026-07-27 Repo trim: Gera's call Secrets ruling: Fede

Requested by Fede ("is our claude.md bloated? I think Gera trimmed it"). Three evidence streams: a duplication audit, a line-by-line forensic provenance/staleness investigation, and a four-lens deep-research workflow on best practices. Source docs on the Mac mini: ~/agents/006/claude-md-forensics.md and ~/agents/006/claude-md-best-practices.md.

~65K → ~58K
standing tokens (after global trim)
346 → 76
global CLAUDE.md lines
2,185
repo CLAUDE.md lines (untrimmed)
188
median lines, 29 serious OSS agent files

1. The premise was inverted

Fede's hypothesis was that Gera trimmed the repo CLAUDE.md and our copies drifted. The audit found the opposite: the repo file has grown monotonically (2,019 lines in June → 2,185 today) and the local checkout is byte-identical to GitHub. What Gera did on 2026-07-26 was a consolidation: four sections each restated the push→PR→merge flow with different stopping points until two contradicted each other; his fix was one canonical Shipping Vocabulary section (verb sets the ceiling, grant sets the gate, plus a hard floor no grant waives) and a Hot rules — read first digest, with everything else pointing at them.

The neglected file was Fede's personal global ~/.claude/CLAUDE.md: 346 lines, no git history, grown by accretion — and it carried Gera's exact pre-fix pathology across three layers (global ↔ repo ↔ memory files), including a fifth restatement of the deploy flow he had just deduplicated.

2. Forensics: age predicts staleness only for facts, not for norms

Every block was dated against its cited artifact (PRs, ADRs, memory files, repo commits) and every falsifiable claim was live-verified. The organizing result: behavioral rules don't decay; filesystem facts do. The 66–76-day-old conduct rules (no PII, no invented numbers, lock user corrections) were all still valid and enforced; nearly every factual claim from the same era was dead.

FindingStatus
Global hold-list had 4 dangerous-diff categories vs the repo hard floor's 8 (missing: secrets, IAM/auth, billing, irreversible third-party mutations) — adjacent to an "auto-merge on green, do not ask" grant. The repo doc itself warns "a partial copy of that floor is worse than none."safety hazard — fixed by pointer
npm run deploy:lambda does not exist (six differently-named deploy scripts do)hard-stale — deleted
All seven src/lib/* paths in the Code Patterns section moved to src/lib/platform/*; clara-voice.ts exists at no pathhard-stale — deleted
"Never run Playwright against production — only stage/localhost": stage was retired 2026-04-17, and another line in the same file mandates Playwright-against-prod via /browseself-contradictory — deleted
PR #4102 cited as the UX-screenshot exemplar actually contains zero screenshots (rule good, proof drifted)rewritten
Worktree reap discipline not holding: 132 live worktrees at audit time vs 0 after the June cleanupoperational, flagged
Three-way secrets conflict: global says Keychain-only · repo says .env.local · smoke TOTP is a plain file in ~/.claude/.secrets/held for Fede's ruling
23 ADR numbers are duplicated — "lowest genuinely-free number" is a recurring hazard, not a one-offnoted in docs rule

3. Research: why size costs compliance

Honesty note carried from the research doc: no source prescribes a hard token cap — the targets below are synthesis of Anthropic guidance + the observed OSS distribution + the shape of the decay curves, not a measured threshold. And @path imports do not defer loading; only skills, path-scoped rules, and unlinked pointers actually save context.

4. What was changed (done)

5. Going-forward rule (recommended standard)

Admission gate for any new standing rule — first match wins:

hook → linter → skill → path-scoped rule → docs pointer → repo CLAUDE.md → global CLAUDE.md

A rule earns a place only if the failure has been observed twice, fits one sentence, is positively phrased, and is quantified where possible. Every addition names an eviction. (A hand-sort of 252 real-world rules found ~84% were mechanizable as hooks/lint — prose should be the last resort, not the first.)

6. Open items

ItemOwnerShape
Repo CLAUDE.md trim: 2,185 → 200–300 lines. Keep hot rules, commands, repo map, Shipping Vocabulary, hard boundaries, routing table; move ~800 lines of runbooks (renewal debugging, env vars, project structure, API endpoints, Workspace rename, offboarding) to docs/runbooks/*.md behind one-line pointers; path-scope area rules under .claude/rules/. The consolidation Gera already did is the right pattern — this extends it.Geraproposal — claude-md-best-practices.md is written as the handoff
Secrets ruling: Keychain vs .env.local vs ~/.claude/.secrets/ — three live conventions. The trimmed global file keeps a neutral line pending the call.Fededecision
Worktree reap drift: 132 live worktrees despite the enforced-reap rule — either the fleet pattern needs a scheduled reap or the rule needs a hook.Fede/engops follow-up

Prepared by Fable, 2026-07-27. Evidence files: claude-md-forensics.md (20-block provenance/staleness table), claude-md-best-practices.md (four-lens research synthesis, all cited). Global-file history: git -C ~/.claude log -- CLAUDE.md.

PropFlow Docs