memory-cleanup

memory-cleanup is a skill for Claude Code, Codex from Perseus-Computing-LLC/perseus. It costs 69 tokens per session (2,008 once invoked), scanned A, original, MIT.

A maintenance tool for Perseus, a local system that stores and retrieves project context. It checks memory stores and keeps Perseus Vault as the main copy.

In plain words
What is it for?
Use it after upgrading Perseus, changing memory backends, or when recalled context becomes noisy. It audits known memory locations and deletes stale systems.
Why use it?
Old or damaged memory stores can add noise, slow retrieval, and create conflicting context. This helps identify and remove those outdated copies.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/perseus-computing-llc/perseus/memory-cleanup
Any agent
npx skills add Perseus-Computing-LLC/perseus --skill memory-cleanup
Clone the repo
git clone --depth 1 https://github.com/Perseus-Computing-LLC/perseus

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/perseus-computing-llc/perseus/memory-cleanup.svg)](https://agentmods.dev/skills/perseus-computing-llc/perseus/memory-cleanup)
Your own site
<a href="https://agentmods.dev/skills/perseus-computing-llc/perseus/memory-cleanup"><img src="https://agentmods.dev/badge/skills/perseus-computing-llc/perseus/memory-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,008 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00069 $0.02008
Opus 5 $0.00034 $0.01004
Sonnet 5 $0.00014 $0.00402
Haiku 4.5 $0.00007 $0.00201

Measured 4d ago against content hash 843313b15ef8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/memory-cleanup/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Cleanup Skill

Audits and purges stale memory systems from a Perseus environment, keeping Perseus Vault as the single source of truth. Run after upgrading Perseus, after switching memory backends, or whenever memory feels noisy.


Philosophy

Retaining old context is not as important as staying on the latest tooling and pushing the envelope. Old memory systems accumulate noise, cause federation artifacts, and slow down recall. When in doubt, delete.

The live Perseus Vault index (~/.perseus/memory/) is always the source of truth. Everything else is a candidate for removal.


Trigger Phrases

  • "clean up memory"
  • "purge stale memory systems"
  • "memory cleanup"
  • "reflect and clean"
  • "audit memory"

Workflow

Step 1 — Audit All Memory Locations

Check for the following known memory system locations:

# Perseus (live — keep)
ls -lht ~/.perseus/memory/        # Perseus Vault BM25 index files
ls -lht ~/.perseus/checkpoints/   # Session waypoints

# Rovo Dev sessions (live — keep)
ls ~/.rovodev/sessions/
ls ~/.codex/memories/

# Stale systems (candidates for deletion)
ls ~/.mem0/                       # Mem0 library (superseded by Perseus Vault)
ls ~/.mempalace/                  # Mempalace (superseded by Perseus Vault)
ls ~/.cache/chroma/               # Orphaned Chroma vector stores
ls ~/.cache/code-nemo/            # Nemo memory (if present)
ls ~/.local/share/perseus/        # Old single-file perseus installs

Report findings in a table:

Location Last Modified Size Status
~/.perseus/memory/ {date} {N} files ✅ Live — keep
~/.perseus/checkpoints/ {date} {N} files ✅ Live — keep
~/.mem0/ {date} {size} 🗑️ Stale — delete
~/.mempalace/ {date} {size} 🗑️ Stale — delete
~/.cache/chroma/ {date} {size} ⚠️ Check — may be active

Step 2 — Check for Garbled Federation Artifacts

Perseus @memory with federation enabled can write low-quality blended content from other workspaces. Check the newest memory files:

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 228 lines · 69 tokens per session scan A 843313b15ef8

Subscribe to this mod's changes

memory-cleanup is a skill published in the GitHub repository Perseus-Computing-LLC/perseus (43 stars, last pushed 2d ago), licensed MIT. It adds 69 tokens to every session and 2,008 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

ai-chat

Guidance for improving the Windmill AI chat (copilot), especially global mode — tools, prompts, and context-window discipline. Use when editing chat tools, system prompts, or tool-result shapes under frontend/src/lib/components/copilot/chat, or when changing how the chat manages its context window.

windmill-labs/windmill · 62 tokens

memory-consolidation

Weekly synthesis of accumulated notes and memory optimization.

modimihir07/agentic-os · 13 tokens

memory-triage

Persistent long-term memory protocol powered by mem0. Evaluate conversations for durable facts worth storing via memoryadd. Handles identity, preferences, decisions, configurations, rules, projects, and relationships. Loaded by the openclaw-mem0 plugin when skills mode is active.

mem0ai/mem0 · 58 tokens

mem0-dream

Consolidates stored memories by merging duplicates, resolving contradictions, and pruning stale entries. Use when memory count is high, search results feel noisy or repetitive, or periodic cleanup is needed to maintain memory quality.

mem0ai/mem0 · 46 tokens

mem0-vercel-ai-sdk

Mem0 provider for Vercel AI SDK (@mem0/vercel-ai-provider). TRIGGER when: user mentions "vercel ai sdk", "@mem0/vercel-ai-provider", "createMem0", "retrieveMemories", "addMemories", "getMemories", "searchMemories", "mem0 vercel", "AI SDK provider", "AI SDK memory", or is using generateText/streamText with mem0. Also…

mem0ai/mem0 · 146 tokens

remember

Review the current conversation and capture valuable knowledge — best practices, coding conventions, architecture decisions, workflows, and user feedback — into persistent memory (AGENTS.md) or reusable skills. Use when the user says: (1) remember this, (2) save what we learned, (3) update memory, (4) capture…

langchain-ai/deepagents · 71 tokens