.claude/skills/memory-audit/SKILL.md
Comprehensive health check across CC auto-memory and agent-studio memory systems — detects orphans, duplicates, staleness, and threshold violations
npx skillsauth add oimiragieo/agent-studio memory-auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Skill({ skill: 'memory-audit' });
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).
Command:
echo "=== Agent-Studio Memory ==="
du -sh .claude/context/memory/
find .claude/context/memory/ -type f | wc -l
wc -l .claude/context/memory/learnings.md .claude/context/memory/decisions.md .claude/context/memory/issues.md 2>/dev/null
find .claude/context/memory/ -name "delegations.pid-*.json" | wc -l
find .claude/context/memory/ -name "*.bak" | wc -l
Thresholds:
| Metric | OK | WARN | CRITICAL | | -------------------- | ---- | ------- | ----------------------- | | Directory size | <5MB | 5-10MB | >10MB | | Total files | <120 | 120-200 | >200 | | learnings.md lines | <300 | 300-500 | >500 (blocks spawning!) | | decisions.md lines | <200 | 200-400 | >400 | | issues.md lines | <300 | 300-500 | >500 | | Delegation PID files | 0 | 1-10 | >10 | | .bak files | 0 | 1-3 | >3 |
Verify: STM/MTM/LTM directories exist with content.
Command:
for f in access-stats.json codebase_map.json gotchas.json patterns.json open-findings.json; do
echo -n "$f: "
wc -c < ".claude/context/memory/$f" 2>/dev/null || echo "MISSING"
done
Checks:
access-stats.json: verify entries have distinct accessCount values (not all identical = bulk counter, useless)codebase_map.json: count entries vs 500-entry capgotchas.json: count entries, check for hash-based duplicatespatterns.json: count entries, check for hash-based duplicatesopen-findings.json: flag findings with status: "resolved" older than 30 days (stale)Compare content between CC auto-memory reference files and agent-studio JSON stores:
reference_technical_fixes.md and reference_context_management.mdgotchas.json and patterns.json entriesPolicy (Gemini consensus): CC auto-memory = thin index/pointers. Agent-studio = deep store. When duplicates found, recommend keeping detail in agent-studio, adding pointer in CC.
Command:
find .claude/context/memory/named/ -type f ! -name ".gitkeep" | wc -l
node -e "require('.claude/lib/memory/memory-manager.cjs').listMemories()"Command:
find .claude/context/memory/ -name "*.json" -mtime +30 -not -path "*/archive/*" -not -path "*/ltm/*"
find .claude/context/memory/metrics/ -name "*.json" -mtime +30
Flag entries older than 30 days for review. Do NOT auto-delete — report only.
Write structured report to .claude/context/reports/memory-audit-{YYYY-MM-DD}.md:
# Memory System Health Report — {date}
## Health Score: {0-100}/100
## Summary Table
| System | Metric | Current | Threshold | Status |
| ------ | ------ | ------- | --------- | ------ |
## Findings
### P0 (Critical)
### P1 (High)
### P2 (Low)
## Recommendations
1. ...
Health Score Calculation:
When invoked with --auto-fix, the skill will safely clean:
Will NOT auto-fix:
Before starting: Read .claude/context/memory/learnings.md for prior audit results.
After completing: Write audit summary to learnings.md. Record any new gotchas to gotchas.json via MemoryRecord.
Input validated against schemas/input.schema.json before execution.
Output contract defined in schemas/output.schema.json.
context-compressor — compress context when audit finds bloatmemory-search — semantic search across memory storesproactive-audit — broader framework health check that includes memorytools
Comprehensive biosignal processing toolkit for analyzing physiological data including ECG, EEG, EDA, RSP, PPG, EMG, and EOG signals. Use this skill when processing cardiovascular signals, brain activity, electrodermal responses, respiratory patterns, muscle activity, or eye movements. Applicable for heart rate variability analysis, event-related potentials, complexity measures, autonomic nervous system assessment, psychophysiology research, and multi-modal physiological signal integration.
tools
Comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centrality, clustering), detecting communities, generating synthetic networks, or visualizing network topologies. Applicable to social networks, biological networks, transportation systems, citation networks, and any domain involving pairwise relationships.
data-ai
Molecular featurization for ML (100+ featurizers). ECFP, MACCS, descriptors, pretrained models (ChemBERTa), convert SMILES to features, for QSAR and molecular ML.
development
Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.