/install arc-memory-pruner
Memory Pruner
Keep your agent's memory lean. Automatically prune logs, compact state files, and enforce size limits so your agent never runs out of disk or context window.
Why This Exists
Agents accumulate memory files over time. Logs grow unbounded. State files collect stale entries. Eventually your boot-up reads 50K tokens of memory and half of it is outdated. Memory Pruner enforces limits and keeps only what matters.
Commands
Prune a memory file (keep last N lines)
python3 {baseDir}/scripts/memory_pruner.py prune --file ~/wake-state.md --max-lines 200
Prune a log directory (circular buffer, keep last N files)
python3 {baseDir}/scripts/memory_pruner.py prune-logs --dir ~/agents/logs/ --keep 7
Compact a state file (remove sections matching a pattern)
python3 {baseDir}/scripts/memory_pruner.py compact --file ~/wake-state.md --remove-before "2026-02-14"
Check memory sizes
python3 {baseDir}/scripts/memory_pruner.py stats --dir ~/
Dry run (show what would be pruned)
python3 {baseDir}/scripts/memory_pruner.py prune --file ~/wake-state.md --max-lines 200 --dry-run
Features
- Line-based pruning: Keep last N lines of any file
- Log rotation: Circular buffer for log directories (keep last N files, delete oldest)
- Date-based compaction: Remove entries older than a cutoff date
- Size limits: Enforce max file sizes in bytes
- Dry run mode: Preview changes before applying
- Stats: Overview of memory file sizes and growth rates
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install arc-memory-pruner - After installation, invoke the skill by name or use
/arc-memory-pruner - Provide required inputs per the skill's parameter spec and get structured output
What is Memory Pruner?
Automatically prune and compact agent memory files to prevent unbounded growth. Circular buffer for logs, importance-based retention for state, and configura... It is an AI Agent Skill for Claude Code / OpenClaw, with 1417 downloads so far.
How do I install Memory Pruner?
Run "/install arc-memory-pruner" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Memory Pruner free?
Yes, Memory Pruner is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Memory Pruner support?
Memory Pruner is cross-platform and runs anywhere OpenClaw / Claude Code is available (darwin, linux).
Who created Memory Pruner?
It is built and maintained by ArcSelf (@trypto1019); the current version is v1.1.0.