/memento:optimize-memory-bankfrom memento
Scans Memory Bank markdown files for redundant content, automatically optimizes files with >10% redundancy, and produces a summary report with before/after metrics.
Ships in memento. Installing the plugin adds it to Claude Code.
CRITICAL: Before any changes:
cp -r .memory_bank .memory_bank.backup.$(date +%Y%m%d_%H%M%S)
Backup created at: .memory_bank.backup.YYYYMMDD_HHMMSS
Load redundancy patterns ONCE (reuse for all files):
Scan files: Find all .memory_bank/**/*.md files using Glob
For EACH file (sequential, no subagents):
a. Read and analyze:
🔍 Checking [filename] (X lines)...b. Check redundancy:
c. Optimize if needed:
((before - after) / before) * 100✅ Optimized [filename]: X → Y lines (-Z%)✅ [filename] already optimald. Track metrics: Add to running totals (files_optimized, total_lines_saved)
Final report: Show summary with before/after metrics
Typical outcomes:
Report example:
✓ Scanned 28 files
✓ Optimized 12 files (43%)
✓ Saved 1,850 lines (38% average reduction)
✓ Backup: .memory_bank.backup.20251114_143022
Top improvements:
- tech_stack.md: 648 → 301 lines (-54%)
- ai-agent-handbook.md: 404 → 251 lines (-38%)
- architecture.md: 520 → 310 lines (-40%)
What the command file sets; muted values are Claude Code's defaults
memory-bank, file-optimization, redundancy-detection, markdown
7-day visitors to each command page
2 commands in this plugin
npx claudepluginhub mderk/memento --plugin mementoOther plugins' commands for the same job