agentleFS
letsloose501letsloose501/sqs-agent-memory/skills/clean-memory/SKILL.md

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

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
  1. Very specific:

    Read MEMORY.md and the folder.

    line 22
  2. Distinctive:

    Look for four things:

    line 23
  3. Very specific:

    Keep the index under 150 lines and 20 KB: one line per entry.

    line 31
  4. Very specific:

    Delete one at a time with mempalace_delete_drawer(drawer_id=...) (the parameter is drawer_id, not id).

    line 41
  5. Very specific:

    After deleting: mempalace_status and a summary.

    line 43
  6. Distinctive:

    Mass deletion breaks the index: Remove a sizeable share of drawers and the vector index (HNSW) drifts from sqlite.

    line 45
  7. Distinctive:

    Do not judge an entry by its file name: read it, and read both before calling two duplicates.

    line 56

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Clean up memory

Memory lives on two surfaces, cleaned differently. First work out which one is meant.

SurfaceWhat is thereCleaned by
File memory ${user_config.memory_dir}facts about the user, decisions, pitfalls; mistakes/editing files, under git
MemPalacethe index of the vault ${user_config.vault_dir}: what lives wheremempalace_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.

  1. Read MEMORY.md and the folder.
  2. 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.
  3. Retire what is outdated, do not overwrite it: mark from which date it no longer holds and what replaced it.
  4. Deleting a whole file: only with the user's confirmation.
  5. 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

  1. mempalace_status: how many drawers, how they are spread across wings.
  2. Narrow the scope before listing. There can be thousands of drawers. Ask for a wing and room or a keyword, then mempalace_list_drawers with wing, room, limit, offset, or mempalace_search(query=...) when the user gave a word.
  3. Show compactly: number, ID, first 80 characters.
  4. Delete one at a time with mempalace_delete_drawer(drawer_id=...) (the parameter is drawer_id, not id).
  5. After deleting: mempalace_status and 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.