memory-hygiene
Skill0 starsChanged 25 days agoMITView on GitHub
Keep an AI agent's file-based memory (an index file plus one-fact topic files) loadable, truthful and non-duplicated. Use when the memory index grew huge, when the loader warns that the index was truncated, when memories contradict each other or restate code/git facts, or before adding a new memory. Includes a linter and the rules that keep memory small and useful.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- BSSE23047/nauraiz-devtheir own version, first seen Nov 8, 2026
- mahsumaktas/agent-evolution-kittheir own version, first seen Nov 8, 2026
- HsuanYuLee/polaristheir own version, first seen Nov 5, 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
- BSSE23047/nauraiz-dev★ 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
- GH-Mason/agent-memory-discipline★ 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.
The file
Files
memory-hygiene
A memory index is loaded into every session. When it exceeds the loader's limit, the tail is silently cut - the agent doesn't know what it lost. In one real case a ~25 K-character index (limit ~24.4 K) lost its last 3 of 119 lines.
Rules
- One fact per file, frontmatter
name/description(one line, used to decide relevance) /type(user | feedback | project | reference). - The index is pointers only:
- [Title](file.md) - hook, one line, under ~200 characters. Never put content in the index. Long, dated status paragraphs in index lines are the usual cause of truncation - move them into the topic file. - Before writing, search for an existing memory and update it instead of adding a near-duplicate; delete memories that turn out wrong.
- Don't store what the repo already records (code structure, fixes, git history, CLAUDE.md). If asked to remember such a thing, store what was non-obvious about it.
- feedback/project memories carry Why and How to apply lines, so edge cases can be judged later instead of obeyed blindly.
- Convert relative dates to absolute dates. A memory naming a file/function/flag is a claim about the past: verify it still exists before recommending it.
- Link related memories with
[[name]]; unresolved links are fine as "write this later" markers but should be listed. - Prune: completed one-off projects collapse to a single line; superseded rules are deleted, not stacked.
python3 scripts/memory_lint.py ~/.claude/projects/<project>/memory --index-limit 24000 --line-cap 220
python3 tests/run.pySizes are counted in characters (a Korean/Japanese index is ~1.6x larger in bytes; measuring bytes over-reports the cut). Reports: truncated lines (which ones the agent never sees), over-long index lines, missing files, orphan files, missing frontmatter/type, duplicate names, dangling links.
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.

