From mempenny
Load this skill when the user asks how to write, prune, or manage their Claude Code auto-memory files. Covers the strategy hierarchy (delete > archive > distill > compress > keep), recognition heuristics for stale memories, the forward-looking-truth principle, and write-time discipline.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mempenny:memory-hygieneThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
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.
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.
Cheapest action to most expensive. Always pick the cheapest one that applies.
DELETE — zero tokens, zero loss if the content is truly obsolete. Use when:
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.
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.
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.
KEEP — active state, architecture reference, recurring rule, or content where the prose is already tight. The default action when none of the above apply.
When you're looking at a memory file and deciding its fate:
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.Memory captures what future-Claude needs to know, not what past-Claude experienced.
Test: "If I read this file in three weeks with no other context, what's the one thing I need it to tell me?" That one thing is the memory. Everything else is bloat.
The best memories are born lean. Five rules:
MEMORY.md descriptions specific — vague descriptions ("various fixes") cause unnecessary loads. Specific descriptions ("retry policy: exponential backoff, max 5, gives up on 4xx") let future-Claude filter more accurately."Save tokens with common sense, without loss."
Lean memory isn't about being aggressive — it's about being honest about what's load-bearing. A 10 KB file with two load-bearing sentences should become a 2-sentence file. A 10 KB file where every line is load-bearing should stay exactly as it is.
The judgment call is always: does future-Claude need the narrative, or just the conclusion?
The conclusion is what matters 99% of the time. Narrative lives in git.
When in doubt, favor ARCHIVE over DELETE. ARCHIVE is reversible (move back out of archive/), DELETE is not (unless there's a backup). The goal is "without loss", not "maximum savings at any cost".
npx claudepluginhub marcelopaniza/mempenny --plugin mempennyGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.