memory-hygiene
Skill2 starsChanged 14 days agoMITView on GitHub
Clean up project memory: 'clean up my memory', 'prune the knowledge files', MEMORY.md too long. Finds stale or relative-dated entries, dead file references. Not for adding a lesson (capture-lesson).
11 other projects use a version of this.
Adopted by
Most recently taken up by
- mahsumaktas/agent-evolution-kittheir own version, first seen Nov 8, 2026
- HsuanYuLee/polaristheir own version, first seen Nov 5, 2026
- Kein-chronicle/claude-code-memory-linttheir own version, first seen Nov 1, 2026
- GH-Mason/agent-memory-disciplinetheir own version, first seen Sep 24, 2026
- NecturaLabs/AgentSkillstheir own version, first seen Sep 24, 2026
- ritmillio/skillstheir own version, first seen Aug 23, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- huytieu/COG-second-brain★ 1.3ksame name
- NUX-Design/claude-skills-fable-opus★ 24same name
- HsuanYuLee/polaris★ 5same name
- megandmartin/agent-skills-repo★ 3same name
- mahsumaktas/agent-evolution-kit★ 2same name
- NecturaLabs/AgentSkills★ 1same name
- NITISH-R-G/agent-memory-protocol★ 1same name
- chanjalme/claude-skills★ 0same name
- GH-Mason/agent-memory-discipline★ 0same name
- Kein-chronicle/claude-code-memory-lint★ 0same name
1 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 repository13 other files it gives its agents.
- templates/CLAUDE.mdCLAUDE.md
- capture-lessonSkill
- find-skillsSkill
- gateSkill
- grillSkill
- handoffSkill
- initSkill
- kickoff-promptSkill
- measureSkill
- reviewSkill
- setupSkill
- shipSkill
- start-taskSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Scan: Run node "${CLAUDE_PLUGIN_ROOT}/scripts/memory/scan.mjs" <dir>...
- Distinctive: line 30
Check what the script cannot: Read the files it flagged, plus the index.
- Very specific: line 51
If the /doctor command is available in this Claude Code version, mention it: it audits the prompt files this skill does not cover.
“Common” is measured: kept by at least 6 in 10 of the 10 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
Memory rots: "yesterday" means nothing a week later, files get renamed, facts stop being true. This finds the rot and proposes fixes; the owner approves each one.
"Stop" and "ask" mean: end your turn with the question and wait.
Find the folders. The project's
.claude/knowledgeand.claude/rules(those that exist), and the auto-memory folder: Glob*/memory/MEMORY.mdin<home>/.claude/projectsand take the folder named like the current directory with every non-alphanumeric character replaced by-, compared case-insensitively. No match: scan without it and say so.localmode (the session header showsmode=local, or.claude/nauraiz-dev.local.jsonexists and.claude/nauraiz-dev.jsondoes not): edits go only inside the auto-memory folder. For.claude/knowledgeand.claude/ruleslist the proposals but never apply them: those files are tracked.- Scan. Run
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory/scan.mjs" <dir>...with those folders (quote paths; add--today <date>only if asked). It prints JSON: per filelines,bytes,relativeDates,staleSince,missingRefs,brokenLinks, andindexforMEMORY.md(overLimitabove 200 lines or 25,000 bytes). - Check what the script cannot. Read the files it flagged, plus the index. Look for two entries that contradict each other, a fact the code now disproves (Grep to check), and entries that duplicate each other. Do not Read files nothing flagged.
- Propose, do not edit. Show one diff-style list, grouped by file:
relativeDates: rewrite to the absolute date the entry was written (from the file's own dates orgit log); if unknown, ask.staleSince: confirm, update or delete. Say the date and the age.missingRefsandbrokenLinks: fix the path, drop the reference, or delete the entry if it was only about the missing file. A flag on an ordinary word such asNext.jsis a false alarm: skip it.- Contradictions and duplicates: say which entry wins and why.
index.overLimit: name the entries to merge or drop to get under the limits. Then stop and ask which to apply.
- Apply only the approved ones with Edit, and in
localmode only inside the auto-memory folder. Edits stay within files: you cannot rename or delete one. When a file must go or be renamed, tell the owner which, to do by hand, and keepMEMORY.mdandknowledge/README.mdin step. Run the scan again and report the counts before and after. - If the
/doctorcommand is available in this Claude Code version, mention it: it audits the prompt files this skill does not cover. Do not run it for the owner.
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.

