Agent Memory Cleanup
/install agent-memory-cleanup
Agent Memory Cleanup
This skill should be lightweight and mostly invisible. Do not announce that a skill is being used unless the user asks. The user only needs to see a plain memory-quality prompt when action is useful.
Default Flow
- Detect memory pressure or pollution.
- If Python/file access is available, run a cheap summary check first:
python scripts/audit_memory.py memory.md --summary-json
- If
quality.interventionisno_intervention_needed, do not interrupt the user. - If intervention is needed, say briefly that memory appears too long, duplicated, conflicted, stale, or unsafe, and ask whether to review cleanup recommendations.
- After the user agrees, run:
python scripts/audit_memory.py memory.md --mode propose-patch --include-diff
- Apply only after a second explicit approval, unless unattended cleanup was already authorized:
python scripts/audit_memory.py memory.md --mode apply-approved
The apply mode must create timestamped backups before writing.
Trigger Points
Use this flow for:
- Memory write/update rejected, full, over budget, truncated, or too long.
- Short memory with secrets, task-state residue, duplicated facts, or conflicting preferences.
- User says a remembered fact is wrong, outdated, project-only, or should not be remembered.
- Before saving a new global memory candidate:
python scripts/audit_memory.py --candidate "candidate memory text" --summary-json
If candidate lint returns do_not_write_candidate_to_global_memory, do not store it globally. Offer to skip it or keep it as project/task notes.
Intervention Values
prompt_cleanup_now_secret_detected: recommend cleanup immediately; never echo raw secrets.prompt_user_review_conflicting_memory: ask the user to resolve conflicting durable preferences.do_not_write_candidate_to_global_memory: block global memory write.prompt_cleanup_recommended: offer cleanup recommendations.prompt_audit_recommended: mention memory quality may be degrading and ask whether to review.no_intervention_needed: stay silent.
Load Extra Context Only When Needed
Do not read references by default. Load them only for the matching need:
references/default-rules.json: deterministic thresholds and regex rules.references/classification-rubric.md: manual fallback if Python cannot run.references/agent-paths.md: path discovery when memory files are unclear.references/mcp-version.md: MCP wrapper design.
Safety
- Keep only stable global preferences and durable cross-task context.
- Remove or redact secrets, stale task state, branch/PR/debug notes, and one-off plans.
- Do not rewrite clean memory just for style.
- Do not broadly scan the user home directory without explicit request.
- Back up every edited memory file.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install agent-memory-cleanup - After installation, invoke the skill by name or use
/agent-memory-cleanup - Provide required inputs per the skill's parameter spec and get structured output
What is Agent Memory Cleanup?
Audit, clean, consolidate, and maintain long-term user memory files for OpenClaw, Hermes Agent, Codex, Claude, and other agents. Use when the user asks to cl... It is an AI Agent Skill for Claude Code / OpenClaw, with 63 downloads so far.
How do I install Agent Memory Cleanup?
Run "/install agent-memory-cleanup" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Agent Memory Cleanup free?
Yes, Agent Memory Cleanup is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Agent Memory Cleanup support?
Agent Memory Cleanup is cross-platform and runs anywhere OpenClaw / Claude Code is available (windows, macos, linux).
Who created Agent Memory Cleanup?
It is built and maintained by hollis9087 (@hollis9087); the current version is v0.3.3.