agentleFS
ladyicebergladyiceberg/openclaw-memory-quality/skills/memory-cleanup/SKILL.md

memory-cleanup

Skill1 starsChanged 7 months agoMITView on GitHub

Guided two-step cleanup for OpenClaw long-term memory (MEMORY.md) — audit first, confirm with user, then clean. Handles report_id automatically so the user never sees it. Use this skill whenever the user wants to clean, purge, or tidy their OpenClaw memories, mentions stale or old memories, or uses phrases like "clean memory", "cleanup memory", "delete old memories", "remove stale memories", "清理记忆", "删除旧记忆", "记忆清理". Always use this skill for memory cleanup requests — don't attempt cleanup without it.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. Kanevry/session-orchestrator★ 53same name
    2. dmzoneill/skills★ 2same name
    3. haraldalder-vibemogger/project-memory★ 2same 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 repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

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

    Call memory_longterm_audit_oc and store the returned report_id internally (never show it to the user).

    line 12
  2. Distinctive:

    If the audit shows everything is healthy, tell the user — no cleanup needed.

    line 23
  3. Distinctive:

    Ask clearly: "Proceed with cleanup?"

    line 27
  4. Very specific:

    Call memory_longterm_cleanup_oc with the report_id from Step 1.

    line 35

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

Memory Cleanup

Two-step guided cleanup. The user must confirm before anything is deleted. Never skip the confirmation step.

Step 1 — Audit

Call memory_longterm_audit_oc and store the returned report_id internally (never show it to the user).

Translate the results into plain language, e.g.:

Found 23 long-term memories to handle:

  • 8 with deleted source files (suggested for removal)
  • 3 exact duplicates (suggested for removal)
  • 12 flagged for review

Estimated reduction: ~17% of MEMORY.md

If the audit shows everything is healthy, tell the user — no cleanup needed.

Step 2 — Confirm

Ask clearly: "Proceed with cleanup?"

  • Yes → Step 3
  • No / cancel → stop, do nothing
  • "Show details" → display the raw audit report, then ask again

Step 3 — Execute

Call memory_longterm_cleanup_oc with the report_id from Step 1. Report what was deleted, what was kept, and where the backup lives.

Error handling

ErrorPlain-language explanation
MEMORY.md not found"Long-term memory file doesn't exist yet — Dreaming may not have run."
mtime changed"MEMORY.md was modified after the audit (OpenClaw may have just promoted new memories). Please re-run /memory-cleanup."
Lock timeout"OpenClaw is currently writing to memory. Wait a moment and try again."

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.