memory-cleaner

Audits and reorganizes persistent memory files by verifying facts against the repository.

2|Updated Sep 25, 2011
One-click install
npx skills add https://github.com/pokutuna/dotfiles --skill memory-cleaner-pokutuna
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-cleaner
Source: https://github.com/pokutuna/dotfiles/tree/main/claude/skills/memory-cleaner
Command: npx skills add https://github.com/pokutuna/dotfiles --skill memory-cleaner-pokutuna

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Persistent memory files (MEMORY.md and individual memory files) accumulate stale, duplicated, or already-applied knowledge over time, degrading response quality and bloating the index loaded into every session. This Skill inventories the memory directory, verifies each entry against current reality, and proposes deletions, merges, promotions, relocations, and rewrites with user approval. ## Core Features & Use Cases - Ledger-based triage: Reads every memory file, verifies referenced paths, commands, and facts against the repository, and classifies each entry as delete, merge, promote, rewrite, relocate, or keep. - Safe application workflow: Requires explicit user approval via grouped questions, creates a zip backup before any change, and regenerates the MEMORY.md index only after all changes are applied. - Subagent delegation: Offloads read-only verification and mechanical rewrites to parallel subagents when memory counts exceed 15 entries, while keeping all user confirmation in the main session. - Use Case: When MEMORY.md exceeds 5KB or individual memories exceed 20 entries, run the cleaner to remove outdated facts, consolidate overlapping notes, and shrink the index. ## Quick Start Ask the assistant to run /memory-cleaner to audit and tidy up this project's persistent memory files.

Frequently Asked Questions about memory-cleaner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up Claude Code persistent memory files?

Run the /memory-cleaner command in the project session. It inventories the memory directory, verifies each entry against the repository, proposes deletions, merges, and rewrites, and applies changes only after your approval with a zip backup.

When should I run memory cleanup on a project?

Run it when MEMORY.md exceeds 5KB, individual memory files exceed 20 entries, or response quality in the project feels degraded. These thresholds indicate the index loaded into every session has grown too large.

Does memory cleanup delete files without confirmation?

No. Every deletion, merge, promotion, relocation, and rewrite requires explicit user approval through grouped questions. A zip backup of the memory directory is created before any change, and unapproved items remain untouched.

How does the cleaner decide which memories are outdated?

It verifies each memory's referenced paths, commands, versions, and facts against the actual repository and ~/.claude configuration. Entries contradicted by reality or already reflected in docs, CLAUDE.md, or code become deletion candidates.

Can memory cleanup handle large numbers of memory files?

Yes. With 16 or more individual memories, it splits them into groups and delegates read-only verification to parallel subagents. Deletion claims from subagents are re-verified in the main session before being proposed.