← Back to Skills Marketplace
klemenska

Memory Defragmenter

by klemenska · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
146
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install memory-defragmenter
Description
Defragment and optimize agent memory files by cleaning duplicates, merging similar entries, archiving stale content, and ensuring proper tiering. Use when: (...
Usage Guidance
This skill appears to do what it says: analyze, plan, and modify local markdown-based memory files. Before running: (1) run the analyzer and then defragment.py --plan and carefully inspect defragment-plan.md; (2) run defragment.py --dry-run to see what would change; (3) prefer supplying --path to target only the specific memory directory instead of using the default '~' to avoid touching unrelated markdown files in your home; (4) keep and verify the backups created by the tool before committing --execute; (5) review the defragment.py execute logic (the script is included) if you need guarantees about whether files are deleted vs archived. If you don't want any chance of modification, don't run --execute and instead only use the analyzer and plan steps.
Capability Analysis
Type: OpenClaw Skill Name: memory-defragmenter Version: 1.0.1 The memory-defragmenter skill is designed to manage and optimize local markdown files used for agent memory. It includes scripts for analyzing file size, identifying duplicate entries, and archiving stale content based on date markers. The workflow emphasizes safety by requiring backups (stored in `~/.defrag_backup/`) and a manual review of a generated plan before execution. No evidence of data exfiltration, malicious execution, or prompt injection was found; the scripts (scripts/analyze_memory.py, scripts/defragment.py, and scripts/verify_memory.py) use standard libraries and operate strictly on the local filesystem within the scope of the agent's memory directories.
Capability Assessment
Purpose & Capability
Name/description match the included scripts: analyze_memory.py, defragment.py, and verify_memory.py implement analysis, plan creation, execution, backup, and verification of local markdown 'memory' files. The requested artifacts and operations (file reads/writes, backups, archiving, tiering) are proportionate to defragmentation.
Instruction Scope
Runtime instructions are explicit (analyze → plan → review → execute → verify) and tell the operator to review the plan before execution. However the default base path is '~' (home) and the scripts glob broadly for many *.md files and named files (e.g., USER.md, IDENTITY.md, memory/*.md). That means the tool can read and modify arbitrary Markdown files under your home directory unless you supply a narrower --path; the skill explicitly creates backups before changes and recommends review, which mitigates risk if the user follows guidance.
Install Mechanism
No installer; this is instruction- + script-based and runs locally with python3. No external downloads or package installs are performed, which minimizes supply-chain risk.
Credentials
The skill declares no required environment variables, credentials, or config paths. The scripts operate on local files only and do not attempt network access or request secrets.
Persistence & Privilege
always is false and the skill does not request persistent platform privileges. It is user-invocable and may be run autonomously by an agent (default), so exercise the usual caution about autonomous runs, but this is expected behavior for skills.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install memory-defragmenter
  3. After installation, invoke the skill by name or use /memory-defragmenter
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Improved logic in defragment.py for more accurate memory file optimization. - verify_memory.py updated with enhanced integrity checks and reporting. - Minor cleanups and reliability enhancements for defragmentation execution.
v1.0.0
Initial release of memory-defragmenter: - Provides tools to analyze, clean, merge, and optimize agent memory files. - Identifies and removes duplicates, archives stale content, and maintains proper tiering. - Offers a step-by-step workflow for defragmentation, including planning, review, execution, and verification. - Ensures data safety with mandatory backups, manual review, and strict archival policies. - Includes scripts for analysis (`analyze_memory.py`), defragmentation (`defragment.py`), and integrity verification (`verify_memory.py`).
Metadata
Slug memory-defragmenter
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Memory Defragmenter?

Defragment and optimize agent memory files by cleaning duplicates, merging similar entries, archiving stale content, and ensuring proper tiering. Use when: (... It is an AI Agent Skill for Claude Code / OpenClaw, with 146 downloads so far.

How do I install Memory Defragmenter?

Run "/install memory-defragmenter" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Memory Defragmenter free?

Yes, Memory Defragmenter is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Memory Defragmenter support?

Memory Defragmenter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Memory Defragmenter?

It is built and maintained by klemenska (@klemenska); the current version is v1.0.1.

💬 Comments