memory-defrag

Split bloated memory files, merge duplicates, and remove stale information.

25|3|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/basicmachines-co/basic-memory-skills --skill memory-defrag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-defrag
Source: https://github.com/basicmachines-co/basic-memory-skills/tree/main/memory-defrag
Command: npx skills add https://github.com/basicmachines-co/basic-memory-skills --skill memory-defrag

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the issue of memory files becoming unwieldy, containing duplicate or stale information, and being poorly organized, which hinders efficient knowledge retrieval and management.

Core Features & Use Cases

  • File Consolidation: Merges related small files into coherent documents.
  • Information Pruning: Removes outdated or irrelevant information.
  • Restructuring: Moves files to appropriate directories and renames them for clarity.
  • Use Case: Regularly scheduled weekly defragmentation to keep your long-term memory (MEMORY.md) and daily notes organized, ensuring quick access to relevant information and preventing data rot.

Quick Start

Run the memory defrag skill to split bloated files and remove completed tasks older than 30 days.

Frequently Asked Questions about memory-defrag

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

FAQPage Schema
How do I clean up duplicate and stale information in my agent memory files?

To clean up agent memory files, you can defragment and reorganize them by merging duplicates, removing stale information, and splitting bloated files. This resolves redundancies and ensures efficient knowledge retrieval.

What is the best way to reorganize a knowledge base that has grown unwieldy?

The best way to reorganize an unwieldy knowledge base is to restructure the memory hierarchy by moving files to appropriate directories, renaming them for clarity, and pruning outdated or irrelevant information.

How do I split bloated memory files and remove old completed tasks?

You can split bloated memory files and remove completed tasks older than 30 days by running a memory defragmentation process. This consolidates related small files and prunes outdated entries.

When should I perform memory defragmentation on my long-term memory notes?

You should perform memory defragmentation when memory files become unwieldy, contain redundancies, or require reorganization. Regularly scheduled weekly defragmentation prevents data rot and keeps daily notes accessible.

Can I consolidate small related memory files into coherent documents automatically?

Yes, you can consolidate related small memory files into coherent documents through file consolidation. This merges fragmented data, restructures the memory hierarchy, and removes stale information automatically.

Why does poor file organization hinder efficient knowledge retrieval?

Poor file organization hinders knowledge retrieval because memory files become bloated, contain duplicate or stale information, and lack clear hierarchy. Defragmentation restructures directories and prunes irrelevant data to restore access.