memorybox

A memory-maintenance tool for OpenClaw agents that organizes large MEMORY.md files into smaller domain files and archives old logs.

In plain words
What is it for?
Diagnosing oversized memory, splitting sections, archiving stale daily logs, and removing duplicates.
Why use it?
It reduces memory-file clutter, duplicate information, and context pressure caused by loading too much history.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ramsbaby/openclaw-memorybox/skill
Any agent
npx skills add Ramsbaby/openclaw-memorybox --skill skill
Clone the repo
git clone --depth 1 https://github.com/Ramsbaby/openclaw-memorybox

Made for: Claude Code, Codex.

Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 612 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00090 $0.00612
Opus 5 $0.00045 $0.00306
Sonnet 5 $0.00018 $0.00122
Haiku 4.5 $0.00009 $0.00061

Measured 2d ago against content hash 70592b7ae389, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

memorybox scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo ln -sf "$(pwd)/bin/memorybox" /usr/local/bin/memorybox
skill/SKILL.md · 66 lines

What it actually says

MemoryBox

Zero-dependency memory maintenance tool for OpenClaw agents.

What It Does

Prevents MEMORY.md bloat by organizing memory into 3 tiers:

  • Tier 1: MEMORY.md (≤10KB, loaded every session)
  • Tier 2: memory/domains/*.md (searched on-demand)
  • Tier 3: memory/archive/ (old daily logs)

Works alongside Mem0, Supermemory, QMD, or standalone. Only touches file structure — never configs or plugins.

Install

git clone https://github.com/Ramsbaby/openclaw-memorybox.git
cd openclaw-memorybox && chmod +x bin/memorybox
sudo ln -sf "$(pwd)/bin/memorybox" /usr/local/bin/memorybox
  1. Run memorybox doctor ~/openclaw — full diagnostic (start here)
  2. Run memorybox split ~/openclaw — move flagged sections to domain files
  3. Verify with memorybox health ~/openclaw — target score above 80
  4. Run memorybox archive ~/openclaw — archive daily logs older than 14 days
  5. Run memorybox dedupe ~/openclaw — remove duplicate content

Additional commands:

memorybox stale ~/openclaw     # Detect outdated content
memorybox analyze ~/openclaw   # Section-by-section size breakdown
memorybox suggest ~/openclaw   # Improvement recommendations
memorybox report ~/openclaw    # Before/after token savings
memorybox init ~/openclaw      # Set up 3-tier directory structure

Teach Your Agent

Add to AGENTS.md:

## Memory Protocol
- **MEMORY.md** (≤10KB): Core facts only. Loaded everywhere — keep it lean.
- **memory/domains/*.md**: Detailed reference. Use `memory_search` to find.
- **memory/archive/**: Old logs. Rarely needed.

Results

Tested on production (7 Discord channels, 48 crons):

  • MEMORY.md: 20KB → 3.5KB (-83%)
  • Context pressure: 98% → 7%
  • Setup time: 5 minutes
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 66 lines · 90 tokens per session scan B 70592b7ae389

Subscribe to this mod's changes

memorybox is a skill published in the GitHub repository Ramsbaby/openclaw-memorybox (10 stars, last pushed 1mo ago), licensed MIT. It adds 90 tokens to every session and 612 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.