# Openclaw Memorybox

> Memory health CLI that diagnoses bloated MEMORY.md files, splits oversized sections into domain files, archives stale daily logs, and runs continuous health monitoring. Use when MEMORY.md exceeds 10KB, context windows overflow from memory bloat, or agent sessions slow down from loading large memory files. Pure bash, zero dependencies.

- Skill: `ramsbaby-openclaw-memorybox/openclaw-memorybox` (Agent Skill, multi-file: 9 files)
- Install (CLI): `npx skillmds@latest add ramsbaby-openclaw-memorybox/openclaw-memorybox`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ramsbaby-openclaw-memorybox/openclaw-memorybox/raw
- Safety review: pending (external: skill-scanner WARNING, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- License: MIT
- Author: Ramsbaby (https://skillmd.com/u/ramsbaby-openclaw-memorybox)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/ramsbaby-openclaw-memorybox/openclaw-memorybox

---


# OpenClaw MemoryBox

> Install with: `clawhub install openclaw-memorybox`

Memory health CLI for AI agents — diagnoses, splits, archives, and monitors MEMORY.md to prevent context overflow.

## Commands

- **`memorybox doctor`** — Full diagnostic: health score, size analysis, duplicates, stale content
- **`memorybox split`** — Interactive: move large sections to `memory/domains/`
- **`memorybox health`** — Quick health score (0–100)
- **`memorybox archive`** — Move daily logs older than 14 days to `memory/archive/`
- **`memorybox watch`** — Background daemon: alerts when health drops below threshold

## Install

```bash
clawhub install openclaw-memorybox
```

Or manually:

```bash
curl -sSL https://raw.githubusercontent.com/Ramsbaby/openclaw-memorybox/main/install.sh | bash
```

## Recommended Workflow

1. Run `memorybox init ~/openclaw` to set up the 3-tier directory structure
2. Run `memorybox doctor ~/openclaw` to get a full diagnostic
3. Run `memorybox split ~/openclaw` for any flagged sections
4. Verify with `memorybox health ~/openclaw` — target score above 80
5. Run `memorybox archive ~/openclaw` to clean up old daily logs

## Optional: Weekly Health Cron

Add to your OpenClaw tasks.json:

```json
{
  "id": "memory-health-weekly",
  "name": "Weekly Memory Health Check",
  "schedule": { "kind": "cron", "expr": "0 23 * * 0", "tz": "Asia/Seoul" },
  "payload": {
    "kind": "agentTurn",
    "message": "Run: memorybox doctor ~/openclaw. If score < 80, run memorybox split and report."
  }
}
```

## Compatibility

- macOS 12+ / Linux (bash 3.2+)
- OpenClaw agents, Claude Code, any markdown-based memory system
- Zero external dependencies — pure bash

