Repository navigation
Description
Problem
charter doctor includes a check that confirms agent config files (CLAUDE.md) are "thin pointers to .ai/":
[ok] adf agent config: 1 agent config file(s) are thin pointers to .ai/.
However, this check only verifies that the file references the ADF system — it doesn't measure or enforce that the file is actually thin. In our case, CLAUDE.md had grown to 213 lines duplicating content already covered by ADF modules (architecture diagrams, file maps, executor tables, cost models, channel permissions, MCP connection details, API endpoints). Doctor reported [ok] the whole time.
After manual cleanup, CLAUDE.md went from 213 → 63 lines (70% reduction) with zero information loss — everything removed was already in core.adf, state.adf, agent.adf, etc.
Proposed Enhancement
Add a bloat/duplication detection step to charter doctor (or a new charter adf lint subcommand) that:
-
Line count threshold — warn if CLAUDE.md exceeds a configurable threshold (e.g., 80–100 lines) when ADF modules exist. The whole point of ADF is to carry the architectural weight; CLAUDE.md should be environment/runtime only.
-
Section overlap detection — scan for markdown headers or content patterns in CLAUDE.md that match ADF module sections (e.g., if CLAUDE.md has
## Architectureandcore.adfhas📁 STRUCTURE, flag the overlap). -
Keyword density — if CLAUDE.md contains high concentrations of terms that match ADF trigger keywords from
manifest.adf ON_DEMANDentries, suggest those sections belong in the corresponding ADF module. -
Actionable output — don't just warn, suggest which ADF module each duplicated section should live in:
[warn] CLAUDE.md bloat: 213 lines (threshold: 100) - "Architecture" section (28 lines) → overlaps core.adf STRUCTURE - "Executors" section (12 lines) → overlaps kernel.adf or state.adf - "Cost Model" section (12 lines) → overlaps core.adf CONTEXT - "BizOps MCP" section (18 lines) → overlaps agent.adf MCP_SERVERS
Context
The ADF guide in core.adf already defines the boundary:
Pure runtime/environment? → CLAUDE.md, not ADF
Universal architecture constraint? → core.adf CONSTRAINTS [load-bearing]
Doctor should enforce this boundary, not just check for the presence of an ADF pointer.
Environment
- Charter CLI: v0.6.0
- ADF: 6 modules (2 default-load, 4 on-demand)
- Agent config: CLAUDE.md
🤖 Generated with Claude Code
Activity
feat(doctor): detect vendor file bloat with line count, section overl…
SmartBrandStrategies commentedon Mar 4, 2026
Shipped in 3fb8b36.
charter doctornow detects vendor file bloat via line count threshold (80 lines), section overlap detection against ADF module sections, and keyword density analysis against manifest trigger keywords. Suggestscharter adf tidy --dry-runfor remediation.