[FEATURE] Memory file optimization suggestions
Resolved 💬 2 comments Opened Feb 6, 2026 by kojiromike Closed Mar 6, 2026
Problem
Memory files (CLAUDE.md, MEMORY.md, project rules) accumulate over time and can become bloated with:
- Verbose explanations that could be tighter
- Redundant rules that say the same thing different ways
- Obsolete entries that no longer apply
- Overly detailed examples where a brief one would suffice
Users pay for this bloat on every conversation turn, but have no tooling to identify optimization opportunities.
Proposed Solution
A command (e.g., /optimize-memory or /audit-memory) that:
- Analyzes loaded memory files
- Identifies optimization opportunities:
- Rules that could be stated more concisely
- Redundant/overlapping instructions
- Examples that could be shortened
- Entries that may be obsolete (e.g., reference old patterns)
- Suggests rewrites that preserve semantics while reducing tokens
- Shows estimated token savings
Example output:
Analyzing ~/.claude/CLAUDE.md (847 tokens)...
Suggestions:
1. Lines 12-18: This 6-line explanation of empty() behavior could be 2 lines (-40 tokens)
Current: [verbose version]
Suggested: [concise version]
2. Lines 45-47 and 82-84: These rules overlap. Consider consolidating. (-25 tokens)
3. Line 103: References "the old API" - may be obsolete. Review for removal.
Estimated savings: ~65 tokens (8%)
Apply suggestions? [y/n/select]
Alternatives Considered
- Manual review: Works but tedious and easy to skip
- Asking Claude directly: Possible but no structured workflow, easy to forget
Priority
Medium - Quality of life improvement for power users
Use Case
Power users with extensive memory files who want to minimize context overhead without losing instruction fidelity.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗