Feature: /insights should detect overlap with existing CLAUDE.md rules before recommending additions
Summary
/insights (memory/insights feature) should detect overlap with existing CLAUDE.md rules before recommending additions.
Background
Analysis of 223 sessions found that 5 out of 6 rules proposed by /insights were already present in CLAUDE.md:
| /insights proposal | Existing CLAUDE.md section |
|:---|:---|
| "Should work in worktrees" | Worktree Required Rule (highest priority) section |
| "Should follow TDD" | Test-Driven Development (TDD) (mandatory) section |
| "Should run pnpm check" | Pre-push Checks section |
| "Should run reviews" | Phase 3: Self-evaluation + Independent Review section |
| "Should not make out-of-scope changes" | AI Instructions section |
The Real Problem
/insights diagnoses "rule is missing → should be added," but the reality is "rule exists → is not being followed."
This misdiagnosis leads to:
- Redundant additions of already-existing rules
- The true problem (why rules aren't followed) being overlooked
- CLAUDE.md becoming bloated, actually reducing rule visibility
Proposal
Before generating recommendations, /insights should:
- Scan the full CLAUDE.md for similar existing rules
- If a rule already exists, suggest "enforcement" (hooks, CI, etc.) instead of "addition"
- Display a diagnostic message like: "This rule already exists in CLAUDE.md. If compliance is low, consider technical enforcement via hooks."
Expected Impact
- Prevents CLAUDE.md bloat
- Correct diagnosis ("rule absent" vs "rule not followed")
- Appropriate solution proposals (document addition vs enforcement mechanism)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗