Feature: /insights should detect overlap with existing CLAUDE.md rules before recommending additions

Resolved 💬 3 comments Opened Feb 7, 2026 by shuhei0866 Closed Feb 11, 2026

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:

  1. Redundant additions of already-existing rules
  2. The true problem (why rules aren't followed) being overlooked
  3. CLAUDE.md becoming bloated, actually reducing rule visibility

Proposal

Before generating recommendations, /insights should:

  1. Scan the full CLAUDE.md for similar existing rules
  2. If a rule already exists, suggest "enforcement" (hooks, CI, etc.) instead of "addition"
  3. 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)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗