/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
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install arc-memory-pruner - 安装完成后,直接呼叫该 Skill 的名称或使用
/arc-memory-pruner触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Memory Pruner 是什么?
Automatically prune and compact agent memory files to prevent unbounded growth. Circular buffer for logs, importance-based retention for state, and configura... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1417 次。
如何安装 Memory Pruner?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install arc-memory-pruner」即可一键安装,无需额外配置。
Memory Pruner 是免费的吗?
是的,Memory Pruner 完全免费(开源免费),可自由下载、安装和使用。
Memory Pruner 支持哪些平台?
Memory Pruner 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(darwin, linux)。
谁开发了 Memory Pruner?
由 ArcSelf(@trypto1019)开发并维护,当前版本 v1.1.0。