Memory Tiering Skill 🧠⚖️
2026.4.10 Update: OpenClaw now has two native memory systems — Active Memory (runs before every reply) and Dreaming (nightly consolidation at 3 AM IL). This skill covers what they DON'T handle — see section below.
What Native Systems Now Cover (don't duplicate)
| Task |
Who does it |
| Pull relevant context before each reply |
Active Memory plugin (automatic) |
| Promote strong signals to MEMORY.md nightly |
Dreaming / memory-core (automatic) |
| HOT.md pattern promotion after 2x mistakes |
self-learning skill |
What This Skill Still Handles
- Manual pruning when MEMORY.md grows >200 lines
- Archiving old
memory/daily/YYYY-MM-DD.md files (30-day retention)
- Force-promoting critical owner corrections immediately (don't wait for Dreaming)
- Graduation gate — reviewing and filtering dream promotions before they land in MEMORY.md
- Post-compaction reorganization
- Enforcing store boundaries: daily notes = raw-first log,
MEMORY.md = durable rules only, project docs = project-scoped
The Three Tiers (for manual ops)
- 🔥 HOT (
memory/hot/HOT_MEMORY.md) — current session, active tasks
- 🌡️ WARM (
memory/warm/WARM_MEMORY.md) — stable preferences, configs
- ❄️ COLD (
MEMORY.md) — long-term, distilled, curated
Workflow: Organize-Memory (Manual / Post-Compaction)
Step 1: Check native systems first
openclaw memory status --deep # see what Dreaming already promoted
/dreaming status # check last run
Step 2: Ingest & Audit
- Read MEMORY.md + last 7
memory/daily/YYYY-MM-DD.md files
- Identify Dead Context: completed tasks, resolved issues, stale facts
Step 3: Prune & Redistribute
- Remove stale COLD entries (if Dreaming already promoted better versions)
- Force-add critical owner corrections → MEMORY.md immediately (don't wait for Dreaming)
- Archive daily notes older than 30 days →
memory/archive/YYYY-MM/
Step 4: Verify
- MEMORY.md should be <200 lines after cleanup
- Check
DREAMS.md — are Dreaming's promotions accurate? Prune bad ones.
Progressive Context Compaction (inspired by Claude Code harness patterns)
Long sessions degrade quality as context fills. Apply progressive compression by conversation age:
Compression Layers (oldest → newest)
| Layer |
Age |
Strategy |
Detail Level |
| HISTORY_SNIP |
>50 turns |
Drop entirely or keep 1-line summary |
~5% |
| Microcompact |
30-50 turns |
Aggressive: decisions + outcomes only |
~15% |
| CONTEXT_COLLAPSE |
15-30 turns |
Medium: key exchanges, skip tool noise |
~40% |
| Full Detail |
<15 turns |
No compression |
100% |
When to Apply
- Session exceeds 30 turns
- Context window pressure detected (tool responses getting truncated)
- After any
/compact command
How to Apply (Manual)
- Identify turn count in current session
- For turns older than 30: summarize into a single "Session context so far" block
- For turns 15-30: keep decisions and outcomes, drop tool output and exploration
- Keep last 15 turns at full detail
- Always preserve: owner corrections, final decisions, error causes
What Never Gets Compressed
- Owner corrections and preferences
- Permission decisions (approved/denied actions)
- Error root causes and fixes applied
- Active task state and pending items
Gap vs. Claude Code
Claude Code does this in the harness layer (code, not prompt). We currently rely on manual /compact and prompt-level instructions. Future improvement: move compaction logic into OpenClaw's session management layer so it runs automatically without consuming agent tokens.
Usage Trigger
- Trigger manually: "Run memory tiering" or when MEMORY.md >200 lines
- Trigger automatically after any
/compact command
Dreaming Integration (OpenClaw 2026.4.9+)
Dreaming is already enabled (memory-core plugin, 0 3 * * * IL timezone).
What Dreaming does automatically:
- Light phase: ingests daily notes + session transcripts
- Deep phase: scores & promotes strong signals → MEMORY.md (weighted: relevance 0.30, frequency 0.24, recency 0.15)
- REM phase: extracts themes and patterns
Manual CLI for inspection/intervention:
openclaw memory status --deep # what's queued for promotion
openclaw memory promote # preview what would promote
openclaw memory promote --apply # force apply now
openclaw memory promote-explain "term" # why something would/wouldn't promote
/dreaming status # last run summary
What still requires manual action:
- Owner corrections → MEMORY.md immediately (don't wait for Dreaming)
- Critical session-startup rules → MEMORY.md manually
- Pruning bad/stale Dreaming promotions → manual cleanup
- MEMORY.md growing >200 lines → prune manually
Graduation Gate (inspired by agentic-stack)
Dreaming stages candidates. Nothing graduates to MEMORY.md without passing this gate:
Minimum Requirements
- Score >= 0.70 (weighted relevance + frequency + recency)
- Recalls >= 2 (the signal was retrieved and used at least twice)
- Status = staged (raw candidates with status=staged only)
- Content is a rule, preference, or durable fact — not a raw conversation fragment, not a debug log, not a confidence=0.00 dream corpus entry
Rejection Criteria (auto-reject)
- Confidence = 0.00 or status != staged
- Content is a raw session transcript or chat log (contains
Candidate: User: or Candidate: Assistant: or evidence: memory/.dreams/)
- Duplicate of an existing MEMORY.md entry (same semantic content)
- Content is ephemeral (specific timestamps, one-off events, resolved issues)
Review Process
- Run
openclaw memory promote to list candidates
- For each candidate, check against minimum requirements and rejection criteria
- Accept only with a one-line rationale: why this is durable and useful
- Reject with a one-line reason: why this doesn't belong
- Rewrite accepted content into clean, concise rule format before adding to MEMORY.md
- Never paste raw dream output directly into MEMORY.md
Post-Review Cleanup
- After review, clear processed candidates from DREAMS.md staging area
- Log review outcome in
memory/daily/YYYY-MM-DD.md: [HH:MM] Dream review: accepted N, rejected M
Safety Rules
- Content changes (MEMORY.md): require explicit review — never auto-apply
- Archiving old files: safe to run automatically
trash > rm always
Retention Policy
- Daily notes: keep 30 days → archive to
memory/archive/YYYY-MM/
- Archive: keep 90 days → delete
- MEMORY.md: prune if >200 lines
Health Indicators
- ✅ Healthy: MEMORY.md <200 lines, DREAMS.md updated nightly, daily notes exist
- ⚠️ Warning: MEMORY.md 200–300 lines, Dreaming didn't run in 48h
- ❌ Critical: MEMORY.md >300 lines, no Dreaming output in 7 days
1---2name: memory-tiering3description: Multi-tiered memory management (HOT/WARM/COLD) for context compaction. Invoke ONLY for explicit compaction events: post-`/compact` cleanup, MEMORY.md tier promotion, archive batch, or "trim my context". NOT for general recall (use deep-recall) or routine memory writes (use storage-router). Triggers: "compact memory", "promote to durable", "archive old context", "tier this".4---56# Memory Tiering Skill 🧠⚖️78> **2026.4.10 Update:** OpenClaw now has two native memory systems — **Active Memory** (runs before every reply) and **Dreaming** (nightly consolidation at 3 AM IL). This skill covers what they DON'T handle — see section below.910## What Native Systems Now Cover (don't duplicate)1112| Task | Who does it |13|---|---|14| Pull relevant context before each reply | Active Memory plugin (automatic) |15| Promote strong signals to MEMORY.md nightly | Dreaming / memory-core (automatic) |16| HOT.md pattern promotion after 2x mistakes | self-learning skill |1718## What This Skill Still Handles1920- Manual pruning when MEMORY.md grows >200 lines21- Archiving old `memory/daily/YYYY-MM-DD.md` files (30-day retention)22- Force-promoting critical owner corrections immediately (don't wait for Dreaming)23- **Graduation gate** — reviewing and filtering dream promotions before they land in MEMORY.md24- Post-compaction reorganization25- Enforcing store boundaries: daily notes = raw-first log, `MEMORY.md` = durable rules only, project docs = project-scoped2627## The Three Tiers (for manual ops)28291. **🔥 HOT (`memory/hot/HOT_MEMORY.md`)** — current session, active tasks302. **🌡️ WARM (`memory/warm/WARM_MEMORY.md`)** — stable preferences, configs313. **❄️ COLD (`MEMORY.md`)** — long-term, distilled, curated3233## Workflow: `Organize-Memory` (Manual / Post-Compaction)3435### Step 1: Check native systems first36```bash37openclaw memory status --deep # see what Dreaming already promoted38/dreaming status # check last run39```4041### Step 2: Ingest & Audit42- Read MEMORY.md + last 7 `memory/daily/YYYY-MM-DD.md` files43- Identify Dead Context: completed tasks, resolved issues, stale facts4445### Step 3: Prune & Redistribute46- Remove stale COLD entries (if Dreaming already promoted better versions)47- Force-add critical owner corrections → MEMORY.md immediately (don't wait for Dreaming)48- Archive daily notes older than 30 days → `memory/archive/YYYY-MM/`4950### Step 4: Verify51- MEMORY.md should be <200 lines after cleanup52- Check `DREAMS.md` — are Dreaming's promotions accurate? Prune bad ones.5354## Progressive Context Compaction (inspired by Claude Code harness patterns)5556Long sessions degrade quality as context fills. Apply progressive compression by conversation age:5758### Compression Layers (oldest → newest)5960| Layer | Age | Strategy | Detail Level |61|---|---|---|---|62| **HISTORY_SNIP** | >50 turns | Drop entirely or keep 1-line summary | ~5% |63| **Microcompact** | 30-50 turns | Aggressive: decisions + outcomes only | ~15% |64| **CONTEXT_COLLAPSE** | 15-30 turns | Medium: key exchanges, skip tool noise | ~40% |65| **Full Detail** | <15 turns | No compression | 100% |6667### When to Apply68- Session exceeds 30 turns69- Context window pressure detected (tool responses getting truncated)70- After any `/compact` command7172### How to Apply (Manual)731. Identify turn count in current session742. For turns older than 30: summarize into a single "Session context so far" block753. For turns 15-30: keep decisions and outcomes, drop tool output and exploration764. Keep last 15 turns at full detail775. Always preserve: owner corrections, final decisions, error causes7879### What Never Gets Compressed80- Owner corrections and preferences81- Permission decisions (approved/denied actions)82- Error root causes and fixes applied83- Active task state and pending items8485### Gap vs. Claude Code86Claude Code does this in the harness layer (code, not prompt). We currently rely on manual `/compact` and prompt-level instructions. Future improvement: move compaction logic into OpenClaw's session management layer so it runs automatically without consuming agent tokens.8788## Usage Trigger89- Trigger manually: "Run memory tiering" or when MEMORY.md >200 lines90- Trigger automatically after any `/compact` command9192---9394## Dreaming Integration (OpenClaw 2026.4.9+)9596Dreaming is **already enabled** (`memory-core` plugin, `0 3 * * *` IL timezone).9798**What Dreaming does automatically:**99- Light phase: ingests daily notes + session transcripts100- Deep phase: scores & promotes strong signals → MEMORY.md (weighted: relevance 0.30, frequency 0.24, recency 0.15)101- REM phase: extracts themes and patterns102103**Manual CLI for inspection/intervention:**104```bash105openclaw memory status --deep # what's queued for promotion106openclaw memory promote # preview what would promote107openclaw memory promote --apply # force apply now108openclaw memory promote-explain "term" # why something would/wouldn't promote109/dreaming status # last run summary110```111112**What still requires manual action:**113- Owner corrections → MEMORY.md **immediately** (don't wait for Dreaming)114- Critical session-startup rules → MEMORY.md **manually**115- Pruning bad/stale Dreaming promotions → manual cleanup116- MEMORY.md growing >200 lines → prune manually117118## Graduation Gate (inspired by agentic-stack)119120Dreaming stages candidates. Nothing graduates to MEMORY.md without passing this gate:121122### Minimum Requirements123- **Score >= 0.70** (weighted relevance + frequency + recency)124- **Recalls >= 2** (the signal was retrieved and used at least twice)125- **Status = staged** (raw candidates with status=staged only)126- **Content is a rule, preference, or durable fact** — not a raw conversation fragment, not a debug log, not a confidence=0.00 dream corpus entry127128### Rejection Criteria (auto-reject)129- Confidence = 0.00 or status != staged130- Content is a raw session transcript or chat log (contains `Candidate: User:` or `Candidate: Assistant:` or `evidence: memory/.dreams/`)131- Duplicate of an existing MEMORY.md entry (same semantic content)132- Content is ephemeral (specific timestamps, one-off events, resolved issues)133134### Review Process1351. Run `openclaw memory promote` to list candidates1362. For each candidate, check against minimum requirements and rejection criteria1373. **Accept** only with a one-line rationale: why this is durable and useful1384. **Reject** with a one-line reason: why this doesn't belong1395. Rewrite accepted content into clean, concise rule format before adding to MEMORY.md1406. Never paste raw dream output directly into MEMORY.md141142### Post-Review Cleanup143- After review, clear processed candidates from DREAMS.md staging area144- Log review outcome in `memory/daily/YYYY-MM-DD.md`: `[HH:MM] Dream review: accepted N, rejected M`145146### Safety Rules147- Content changes (MEMORY.md): require explicit review — never auto-apply148- Archiving old files: safe to run automatically149- `trash` > `rm` always150151### Retention Policy152- Daily notes: keep 30 days → archive to `memory/archive/YYYY-MM/`153- Archive: keep 90 days → delete154- MEMORY.md: prune if >200 lines155156### Health Indicators157- ✅ Healthy: MEMORY.md <200 lines, DREAMS.md updated nightly, daily notes exist158- ⚠️ Warning: MEMORY.md 200–300 lines, Dreaming didn't run in 48h159- ❌ Critical: MEMORY.md >300 lines, no Dreaming output in 7 days