| name | memory-audit |
| description | Comprehensive health check across CC auto-memory and agent-studio memory systems — detects orphans, duplicates, staleness, and threshold violations |
| version | 1.0.0 |
| model | sonnet |
| invoked_by | both |
| user_invocable | true |
| tools | ["Read","Bash","Grep","Glob","TaskUpdate"] |
| args | [--auto-fix] [--report-only] |
| agents | ["memory-manager","qa","architect","developer"] |
| category | Memory & Context |
| tags | ["memory","audit","health-check","observability","dedup"] |
| source | builtin |
| trust_score | 100 |
| provenance_sha | 4bed29f9a7558a70 |
Memory Audit
Structured diagnostic sensor for both memory systems. Returns a health report with scores, findings, and recommendations. The skill is read-only by default — it measures and reports but does not modify memory. Use --auto-fix for safe cleanup of orphans and stale files only.
When to Invoke
Skill({ skill: 'memory-audit' });
- After every 10 sessions (recommended)
- During proactive-audit pipeline
- When agents report memory-related failures
- Before session handoff (verify memory health)
- When router suspects memory bloat or staleness
Workflow
Step 1: CC Auto-Memory Health Check
Command:
MEMORY_DIR=$(find ~/.claude/projects/ -path "*/memory/MEMORY.md" -printf "%h\n" 2>/dev/null | head -1)
echo "=== CC Auto-Memory ==="
wc -l < "$MEMORY_DIR/MEMORY.md" 2>/dev/null
ls -1 "$MEMORY_DIR/" 2>/dev/null | wc -l
grep -c "^type:" "$MEMORY_DIR/"*.md 2>/dev/null | grep -v MEMORY
Thresholds:
| Metric | OK | WARN | CRITICAL |
|---|
| MEMORY.md lines | <150 | 150-199 | >=200 (truncated!) |
| Total files | <20 | 20-30 | >30 |
| Feedback ratio | <70% | 70-85% | >85% (skewed) |
Check: Flag files present in directory but not referenced in MEMORY.md (orphaned).
Step 2: Agent-Studio Memory Health Check
Command:
-sh .claude/context/memory/
find .claude/context/memory/ - f | -l
-l .claude/context/memory/learnings.md .claude/context/memory/decisions.md .claude/context/memory/issues.md 2>/dev/null
find .claude/context/memory/ -name | -l
find .claude/context/memory/ -name | -l