memory-hygiene

Audits and cleans Claude Code memory files, lessons, ADRs, and docs taxonomy.

1|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/wan-huiyan/claude-ecosystem-hygiene --skill memory-hygiene-wan-huiyan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-hygiene
Source: https://github.com/wan-huiyan/claude-ecosystem-hygiene/tree/main/plugins/memory-hygiene
Command: npx skills add https://github.com/wan-huiyan/claude-ecosystem-hygiene --skill memory-hygiene-wan-huiyan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Claude Code's persistent memory (MEMORY.md, lessons, axioms, ADRs) silently degrades over time: MEMORY.md gets truncated past 200 lines, lessons duplicate, ADR numbers collide, and stale or fabricated rules mislead future sessions. This skill audits all persistent knowledge stores, reports structural problems by severity, and executes approved fixes. ## Core Features & Use Cases - Tiered memory audit: Checks axioms, MEMORY.md (auto-memory and in-repo), phase templates, topic files, and archives against a tiered loading architecture with capacity caps and staleness detection. - Integrity checks: Detects fabricated code-to-label tables, unverifiable incident-cause claims, broken references, duplicate lesson numbers, and ADR numbering conflicts. - Docs taxonomy enforcement: Audits project docs/ against a canonical 7-bucket structure and proposes git-mv migration plans. - Use Case: After 10+ sessions on a project, your MEMORY.md triggers a truncation warning and lessons.md has grown to 80+ entries. Run this skill to get a severity-grouped audit report, then approve fixes that deduplicate lessons, demote dormant axioms, and archive stale feedback files. ## Quick Start Ask the AI to audit and clean up my Claude Code memory files, lessons, and ADRs, then show me a report before making any changes.

Frequently Asked Questions about memory-hygiene

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up Claude Code MEMORY.md files?

Run a memory hygiene audit that reads MEMORY.md, checks line count against the 200-line truncation limit, verifies index links resolve, and flags inline content that belongs in topic files. Fixes are proposed in a report and applied only after your approval.

What is the tiered memory architecture for Claude Code?

It organizes memory into tiers: T0 axioms (10-12 items, always loaded), T1 MEMORY.md indexes, T1.5 path-scoped phase rules, T2 topic files loaded on demand, and T3 archives searched via grep only. This avoids the Lost in the Middle attention degradation from bulk-loading large files.

Can the audit detect stale or contradicted lessons?

Yes. Staleness detection greps the codebase for referenced files, functions, and libraries that no longer exist, flags relative dates like 'last week', and surfaces conflicts between project and global lessons. It also groups incident memories by PR or commit to find conflicting cause claims.

Does memory-hygiene modify files automatically?

No. The skill follows an audit-then-fix workflow: it produces a structured report grouped by severity, then executes fixes only after user approval. Destructive actions like deleting feedback files or merging superseded rules always require explicit confirmation.

Why does the label audit say the script was not found?

The label_audit.py script belongs to the separate session-handoff plugin, and plugin installs place it under the plugin cache rather than ~/.claude/skills/. The audit resolves it across all three install roots and reports a skipped check instead of silently passing when the script is absent.