memory-hygiene

memory-hygiene is a skill for Claude Code from marcelopaniza/mempenny. It costs 62 tokens per session (1,140 once invoked), scanned A, original, MIT.

A guide for managing Claude Code's automatic memory files, which store information between coding sessions. It explains when to delete, archive, shorten, or keep old notes.

In plain words
What is it for?
Use it to prune stale memories, preserve useful long-term facts, and keep the automatic memory directory focused.
Why use it?
Memory files can become outdated or too large, causing future sessions to load misleading or unnecessary information.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the mempenny plugin — 2 skills, 18 commands, 1 agent, 1 hook shipped together

Good fit Use it to prune stale memories, preserve useful long-term facts, and keep the automatic memory directory focused.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/marcelopaniza/mempenny/memory-hygiene
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.

Any agent
npx skills add marcelopaniza/mempenny --skill memory-hygiene
Clone the repo
git clone --depth 1 https://github.com/marcelopaniza/mempenny

Made for: Claude Code.

Or install mempenny, the plugin that ships this one along with the rest of its 2 skills, 18 commands, 1 agent, 1 hook.

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-hygiene

README.md
[![agentmods](https://agentmods.dev/badge/skills/marcelopaniza/mempenny/memory-hygiene/github.svg)](https://agentmods.dev/skills/marcelopaniza/mempenny/memory-hygiene)
Your own site
<a href="https://agentmods.dev/skills/marcelopaniza/mempenny/memory-hygiene"><img src="https://agentmods.dev/badge/skills/marcelopaniza/mempenny/memory-hygiene/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for memory-hygiene

Your own site · 80×15
<a href="https://agentmods.dev/skills/marcelopaniza/mempenny/memory-hygiene"><img src="https://agentmods.dev/badge/skills/marcelopaniza/mempenny/memory-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,140 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00062 $0.01140
Opus 5 $0.00031 $0.00570
Sonnet 5 $0.00012 $0.00228
Haiku 4.5 $0.00006 $0.00114

Measured 9d ago against content hash 1f43244b8fd9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

memory-hygiene 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 9d 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-hygiene/SKILL.md · 72 lines

How it starts

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

Memory Hygiene

Claude Code's auto-memory system is powerful but can rot. Files accumulate across sessions, and the cost of a bloated memory directory is paid on every new conversation. This skill covers how to write memories that don't rot, and how to prune the ones that already did.

The strategy hierarchy

Cheapest action to most expensive. Always pick the cheapest one that applies.

  1. DELETE — zero tokens, zero loss if the content is truly obsolete. Use when:

    • The fix is now in the code (code is authoritative, memory can lie)
    • One-shot resolved bug or incident with no future implication
    • Explicitly marked "RESOLVED" / "do not re-fix" / "Historical only"
    • Superseded by a newer file on the same topic
  2. ARCHIVE — move to archive/ subdir, remove from MEMORY.md index. The file still exists for forensics if future debugging needs it, but it's out of the auto-load path. Use for completed-but-non-trivial incidents where the story matters, but not for daily lookup.

  3. DISTILL — replace prose narrative with 1-3 sentences of forward-looking truth. The narrative gets dropped; only what future-Claude needs to know remains. This is the most common action on aging memory files.

  4. COMPRESS — out of scope for memory-hygiene. Compression shrinks prose that's already been through the triage above — it doesn't decide what should be there. Triage first, compress survivors separately (with whatever tool you prefer) if you want additional savings.

  5. KEEP — active state, architecture reference, recurring rule, or content where the prose is already tight. The default action when none of the above apply.

Recognition heuristics

When you're looking at a memory file and deciding its fate:

  • Dated YYYYMMDD files documenting a one-day incident → usually DISTILL or ARCHIVE. The date in the filename is a strong signal that it's a snapshot that's aging.
  • Files containing "RESOLVED", "verified clean", "fixed in", "do not re-fix" → likely DELETE or ARCHIVE. The file is telling you its own lifecycle is over.
  • Architecture / service / protocol / reference docs → KEEP. These are the stable substrate.
  • Single test-run results → DISTILL to "what's now true" after that test run.
  • Files >5 KB with narrative prose → DISTILL aggressively. Narrative is almost never load-bearing for future-Claude.
  • Small stable reference files (usually under 2 KB) → KEEP. Low cost, high density.

Read the full file on GitHub · 72 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. 9d ago First seen · 72 lines · 62 tokens per session scan A 1f43244b8fd9

Subscribe to this mod's changes

memory-hygiene is a skill published in the GitHub repository marcelopaniza/mempenny (2 stars, last pushed 20d ago), licensed MIT. It adds 62 tokens to every session and 1,140 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-31.

Related

Other skills, from other repositories

remember

Stores decisions, patterns, and outcomes in the MCP memory knowledge graph as entities with typed observations and relations. Supports recording architectural decisions, anti-patterns, tool preferences, workflow outcomes, and project conventions that persist across sessions. Use when saving patterns, remembering…

yonatangross/orchestkit · 62 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

pause

Pause Mem0 memory capture on this machine. Use when the user wants to stop memories being recorded, for example for private work or experiments.

mem0ai/mem0 · 30 tokens

mine

Mine a project or conversation into your MemPalace — extract and store memories for later retrieval.

MemPalace/mempalace · 21 tokens

agent-carnet

Use this skill when the user asks to save, recall, find, or organize notes. Triggers on: 'remember this', 'save this', 'note this', 'what did we discuss about...', 'check the notebook', 'find in carnet'. Also use proactively when discovering findings worth preserving across sessions.

yamadashy/repomix · 67 tokens

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens