memory-hygiene
Skill0 starsChanged 4 months agoMITView on GitHub
Audit, prune, and update persistent memory or instruction files (CLAUDE.md, AGENTS.md, memory/) via a destructive-first three-phase protocol with an approval gate. Use at end of session, on a weekly cadence, or when memory files have grown bloated, stale, or self-contradictory.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- ritmillio/skillstheir own version, first seen Nov 29, 2026
- HEADING-OS-Official/heading-ostheir own version, first seen Nov 29, 2026
- HsuanYuLee/polaristheir own version, first seen Nov 12, 2026
- BSSE23047/nauraiz-devtheir own version, first seen Nov 8, 2026
- mahsumaktas/agent-evolution-kittheir own version, first seen Nov 8, 2026
- Kein-chronicle/claude-code-memory-linttheir own version, first seen Nov 1, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- huytieu/COG-second-brain★ 1.3ksame name
- NUX-Design/claude-skills-fable-opus★ 24same name
- HsuanYuLee/polaris★ 5same name
- megandmartin/agent-skills-repo★ 4same name
- BSSE23047/nauraiz-dev★ 2same name
- HEADING-OS-Official/heading-os★ 2same name
- mahsumaktas/agent-evolution-kit★ 2same name
- NecturaLabs/AgentSkills★ 1same name
- NITISH-R-G/agent-memory-protocol★ 1same name
- chanjalme/claude-skills★ 0same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- adversarial-reviewSkill
- claude-md-bootstrapSkill
- memory-bootstrapSkill
- rtk-disciplineSkill
- skill-authoringSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Never skip Phase 1. Never auto-write without Phase 3 approval.
- Distinctive: line 78
Wait for explicit approval before writing anything to disk.
“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Memory Hygiene Protocol
Maintains LLM memory and instruction files. Prevents the primary failure mode: accumulation of dead weight that dilutes signal-to-noise until the model ignores the file entirely.
Phase 1: AUDIT (destructive) → Phase 2: CAPTURE (filter) → Phase 3: DIFF (approval gate)Never skip Phase 1. Never auto-write without Phase 3 approval.
Phase 1 — Destructive Audit
Audit all memory files against four criteria. Do not modify files — report only.
- STALENESS — entries referencing dates, versions, or states that may no longer be true.
- REDUNDANCY — entries duplicating rules already in CLAUDE.md / AGENTS.md / system instructions.
- CONTRADICTION — entries conflicting with each other or with the instruction file.
- BLOAT — entries containing full content instead of pointers, or exceeding 5 lines for a single fact.
Format: [FILE] | [CRITERION] | [SPECIFIC TEXT] | [RECOMMENDATION]
Why destructive first: models default to additive behavior — they append whatever came up without pruning. Forcing a destructive pass combats accumulation. Remove before you add.
Phase 2 — Capture Candidates
Review the current session and extract memory-worthy signal. Filter before adding anything:
- Would this change how you respond to future prompts in this project?
- Is it non-obvious enough that it would be missed without being stated?
- Is it durable (weeks, not hours)?
- Is it specific (actionable by a model, not a vague preference)?
Discard: one-off debugging steps, exploratory dead-ends, context already inferrable from the codebase, anything better placed in a commit message or PR description.
Categorize as:
[NEW CONVENTION]— coding patterns, naming rules, architecture decisions[NEW CONSTRAINT]— things to always/never do in this project[NEW CONTEXT]— background knowledge that shapes how to interpret requests[NEW WORKFLOW]— build, test, deploy, or review process changes
Format: [CATEGORY] | [PROPOSED ENTRY] | [RATIONALE] | [SUGGESTED SECTION]
"Non-obvious, durable, specific" are heuristics, not hard rules. Models over-classify — they label exploratory decisions as conventions. Apply judgment at the gate, don't rubber-stamp.
Phase 3 — Unified Diff with Approval Gate
Combine Phase 1 and Phase 2 into a single proposal. Never auto-write.
--- REMOVE ---
[verbatim text to remove, with section reference]
REASON: [one line]
--- ADD ---
SECTION: [target section name]
CONTENT:
[exact text to add, formatted to match existing style]
REASON: [one line]
--- REPLACE ---
ORIGINAL: [verbatim]
NEW: [replacement text]
REASON: [one line]Then a one-paragraph summary:
Net change: X removals, Y additions, Z replacements. Memory file impact: [leaner / more specific / broader coverage / no net change]. Highest-risk edit: [which change most alters model behavior, and why].
Wait for explicit approval before writing anything to disk. Any prompt that auto-writes to a memory file without review is a liability — one misattributed session decision becomes a persistent behavioral constraint across all future work.
Cadence
| Context | Cadence |
| Single active project | End of session or daily |
| Multiple active codebases | Weekly per project file |
| Pre-ship / high-velocity | After each major milestone |
| Stable / maintenance | Monthly |
Single-Shot Version
For quick sessions where the full three phases are overkill:
Review this session. Any memory-worthy signal? Filter: non-obvious, durable (weeks+), specific, not inferrable from code. If zero candidates, say "nothing to save" and stop. If candidates exist, show diff format and wait for approval.
Known Gaps
- Filter heuristics are soft — the model will still hallucinate capture candidates. Judgment required at the gate.
- Assumes structured files — a flat wall of text with no sections breaks Phase 3's SUGGESTED SECTION. Run a structure pass first.
- No cross-project dedup — doesn't check whether a convention already exists in another project's memory.
See Also
memory-bootstrap— creates what this maintainsclaude-md-bootstrap— instruction file template
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

