Skip to content

doctor: detect CLAUDE.md bloat and ADF content duplication #26

Closed

Description

@SmartBrandStrategies

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:

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

  2. Section overlap detection — scan for markdown headers or content patterns in CLAUDE.md that match ADF module sections (e.g., if CLAUDE.md has ## Architecture and core.adf has 📁 STRUCTURE, flag the overlap).

  3. Keyword density — if CLAUDE.md contains high concentrations of terms that match ADF trigger keywords from manifest.adf ON_DEMAND entries, suggest those sections belong in the corresponding ADF module.

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

  1. added this to the v0.7.0 milestone on Mar 4, 2026
  2. SmartBrandStrategies commented on Mar 4, 2026

    @SmartBrandStrategies
    ContributorAuthor

    Shipped in 3fb8b36. charter doctor now 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. Suggests charter adf tidy --dry-run for remediation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions