memory-hygiene
Skill1 starsChanged 50 days agoMITView on GitHub
Keep an agent's saved memories and session handoff notes true — verify each against the repository, merge duplicates, retire finished handoffs, fix the memory index, and route drifted docs to an audit. Use when a startup check or a user flags stale memories, at a checkpoint after a batch of work, when a handoff's work is finished, or when a memory turns out to be wrong. Not for saving a new memory, not for writing or auditing project documentation (project-docs), and not for instruction files such as AGENTS.md (agent-instructions).
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
- 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
- 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
- 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 repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-instructionsSkill
- agent-orchestrationSkill
- backlog-maintenanceSkill
- estimate-timeSkill
- fabSkill
- independent-reviewSkill
- open-project-terminalSkill
- project-docsSkill
- testingSkill
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 10 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 36
A finished handoff is retired whole: When every step of a handoff note is done, or has moved into the project's tracker, delete the note, …
- Distinctive: line 53
Secrets stay where they are: Never copy a credential or personal detail from a memory into a report, a commit or another file.
“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
A saved memory is read at the start of every session as if it were still true. One that has gone stale is worse than none: it names a file that moved, a branch that merged, a handoff already finished, or a rule the owner has since changed, and the next session acts on it with full confidence. Handoff notes — a file left for the next session, usually with a memory pointing at it — rot the same way once their work is done. This skill keeps both true. It is maintenance, not authorship: it verifies, corrects, merges and retires what exists, and saves nothing new beyond the correction itself.
What it covers
- Memories: the harness's persistent memory store for the project and its index, wherever the harness keeps them (its own memory instructions name the location and file format). Follow that format exactly; do not restructure a memory beyond what the fix needs.
- Handoff notes: files a session left for a later one (often
*handoff*.mdin the docs tree), and the memories that point at them. - Everything else is routed, not tended here. Project documentation that may have drifted goes
to the
project-docsskill's audit mode; instruction files (AGENTS.md,CLAUDE.md, rule files) go toagent-instructions. Note what you find for them in the report.
Invariants
- The owner's word outlives its age. A preference, rule or decision the owner stated stays until the owner changes it or its subject no longer exists. Age alone never retires one. When a newer statement from the owner contradicts it, keep the newer and record the change.
- Verify against the repository, never against memory. A path is checked by looking for it, a branch or commit with git, a command by reading the script or manifest that defines it, a backlog item by reading the backlog. A claim that cannot be checked is left as it is and listed as unverified, not deleted on suspicion.
- A finished handoff is retired whole. When every step of a handoff note is done, or has moved into the project's tracker, delete the note, the memory that points at it, and the memory's index line together. A half-finished one is updated to say what is left.
- One fact, one place. Two memories that say the same thing are merged into the better one and every link to the other is repointed. A memory that repeats what the repository already records (code structure, git history, a doc) is cut to the non-obvious part, or deleted when none is left.
- Other sessions' work is not yours. Memories and handoffs another running session is using, and repository files with uncommitted changes you did not make, are reported, never edited. If the request includes committing, commit only the paths this pass changed, by name.
- Delete only what is proven, and keep a copy. Memories live outside version control, so a deletion cannot be undone from history. Delete or merge away a memory or handoff note only when the evidence is conclusive — its file, branch or handoff is gone, it duplicates another word for word in substance, or the owner has recorded that it is superseded — and copy each file to a dated backup outside the memory directory first. Where the harness's rules ask for confirmation before deleting files you did not create, a request to tend memories covers these proven cases; anything resting on judgment goes under Needs you instead.
- Secrets stay where they are. Never copy a credential or personal detail from a memory into a report, a commit or another file.
Procedure
- Inventory. List every memory file and every index line. Flag index lines whose file is
missing, files the index does not list, and links (
[[name]]or the harness's form) that name no memory. Find handoff notes in the repository and the memories that point at them. - Check each memory against invariant 2: paths, branches, commits, commands, backlog items, versions, dates written as "today" or "next session", and statuses ("paused", "in progress", "on hold"). Note its type — owner preference, project fact, reference — because invariant 1 applies only to the first.
- Decide per memory: current (leave it), stale but fixable (correct the fact, keep the rest), superseded (the owner or the repository replaced it: delete, repoint links), duplicate (merge), finished handoff (retire whole), or unverifiable (leave, list).
- Apply the edits in the harness's memory format and keep the index to one line per memory.
Edit only what the decision named. A relative date ("today", "next week") in a memory you are
already correcting means the day it was written: resolve it from the memory's own recorded date
(a
modifiedfield, or the file's history) or leave it and list it under Left; never resolve it against today. - Route what belongs elsewhere: drifted docs to
project-docs(audit), stale instruction files toagent-instructions. Run those only if the request covers them.
Output
- Changed — each memory or handoff edited, merged or deleted, with the one-line reason and the evidence (the command or file that showed it stale).
- Left — memories kept as they are only because they could not be verified, with where you looked.
- Routed — docs or instruction files that look stale, for their own pass.
- Needs you — any memory whose truth depends on the owner's intent rather than the repository.
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.

