clean-memory
Skill2 starsChanged 9 days agoApache-2.0View on GitHub
Use when the user wants agent memory cleaned up right now, on either surface - the file memory repository (contradictions, outdated facts, drifted descriptions, episodes instead of facts) or the MemPalace vault index (stray or duplicate drawers). Use on "clean the memory", "tidy memory", "remove this from memory", "forget X", "clean the palace", "/clean-memory". Nothing is deleted without an explicit yes.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- Tjm-1116/claude-code-memorytheir own version, first seen Oct 9, 2026
- nklisch/skillstheir own version, first seen Sep 5, 2026
- psw7205/skillstheir own version, first seen May 26, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- nklisch/skills★ 8same name
- psw7205/skills★ 1same name
- Tjm-1116/claude-code-memory★ 1same name
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 repository20 other files it gives its agents.
- browserSkill
- codebase-designSkill
- commitSkill
- desktopSkill
- graphicsSkill
- grillingSkill
- implementSkill
- latexSkill
- memory-reviewSkill
- mistakeSkill
- notesSkill
- pdfSkill
- routerSkill
- setupSkill
- skill-quality-suiteSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- vault-indexSkill
- videoSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Read MEMORY.md and the folder.
- Distinctive: line 23
Look for four things:
- Very specific: line 31
Keep the index under 150 lines and 20 KB: one line per entry.
- Very specific: line 41
Delete one at a time with mempalace_delete_drawer(drawer_id=...) (the parameter is drawer_id, not id).
- Very specific: line 43
After deleting: mempalace_status and a summary.
- Distinctive: line 45
Mass deletion breaks the index: Remove a sizeable share of drawers and the vector index (HNSW) drifts from sqlite.
- Distinctive: line 56
Do not judge an entry by its file name: read it, and read both before calling two duplicates.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clean up memory
Memory lives on two surfaces, cleaned differently. First work out which one is meant.
| Surface | What is there | Cleaned by |
File memory ${user_config.memory_dir} | facts about the user, decisions, pitfalls; mistakes/ | editing files, under git |
| MemPalace | the index of the vault ${user_config.vault_dir}: what lives where | mempalace_delete_drawer |
The user said "clean the memory" without saying which: ask in one line.
File memory
It is under git, so cleaning is safe: everything is recoverable through git log -p.
- Read
MEMORY.mdand the folder. - Look for four things:
- contradictions: two entries say different things about the same subject;
- outdated: the date passed, the work is done, the fact no longer holds;
- description drifted from content: the entry will stop being recalled;
- episodes instead of facts: "did X on such a day" is derivable from git and the vault.
- Retire what is outdated, do not overwrite it: mark from which date it no longer holds and what replaced it.
- Deleting a whole file: only with the user's confirmation.
- Keep the index under 150 lines and 20 KB: one line per entry. Measure:
python "${CLAUDE_PLUGIN_ROOT}/scripts/memory_eval.py" --memory "${user_config.memory_dir}" --dry
MemPalace
mempalace_status: how many drawers, how they are spread across wings.- Narrow the scope before listing. There can be thousands of drawers. Ask for a wing and
room or a keyword, then
mempalace_list_drawerswithwing,room,limit,offset, ormempalace_search(query=...)when the user gave a word. - Show compactly: number, ID, first 80 characters.
- Delete one at a time with
mempalace_delete_drawer(drawer_id=...)(the parameter isdrawer_id, notid). - After deleting:
mempalace_statusand a summary.
Mass deletion breaks the index. Remove a sizeable share of drawers and the vector index
(HNSW) drifts from sqlite; vector search switches itself off ("vector search disabled"). The
fix is mempalace repair --mode from-sqlite --archive-existing --yes, a long rebuild that
leaves a copy of the palace on disk (palace.* next to the palace folder: ~/.mempalace/ for installs older than MemPalace 3.10, ~/.config/mempalace/ for newer ones); remove old copies, keeping the
newest as a rollback point. Diagnose first with
python "${CLAUDE_PLUGIN_ROOT}/skills/notes/scripts/mempalace_doctor.py".
Rules
- Never delete without an explicit yes. Neither a file nor a drawer.
- In doubt, show the whole content, not the first 80 characters.
- Do not judge an entry by its file name: read it, and read both before calling two duplicates.
Arguments
/agent-memory:clean-memory docker searches both surfaces for the word and proposes what it finds.
$ARGUMENTS
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.

