# Memory Cleanup

> 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", "清理记…

- **Type:** Skill
- **Install:** `agentstack add skill-ladyiceberg-openclaw-memory-quality-memory-cleanup`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ladyiceberg](https://agentstack.voostack.com/s/ladyiceberg)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ladyiceberg](https://github.com/ladyiceberg)
- **Source:** https://github.com/ladyiceberg/openclaw-memory-quality/tree/main/skills/memory-cleanup

## Install

```sh
agentstack add skill-ladyiceberg-openclaw-memory-quality-memory-cleanup
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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

| Error | Plain-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." |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ladyiceberg](https://github.com/ladyiceberg)
- **Source:** [ladyiceberg/openclaw-memory-quality](https://github.com/ladyiceberg/openclaw-memory-quality)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ladyiceberg-openclaw-memory-quality-memory-cleanup
- Seller: https://agentstack.voostack.com/s/ladyiceberg
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
