Install
openclaw skills install compaction-survivalPrevent context loss during LLM compaction via Write-Ahead Logging (WAL), Working Buffer, and automatic recovery. Three mechanisms that ensure critical state — decisions, preferences, values, paths — survives when the context window compresses. Always-active behavioral skill, not a one-time tool.
openclaw skills install compaction-survivalCompaction destroys specifics: file paths, exact values, config details, reasoning chains. This skill ensures critical state survives.
The problem: When your context window fills up, OpenClaw compacts older messages into a summary. Summaries lose precision — exact numbers become "approximately," file paths vanish, decisions lose their rationale. Your agent wakes up dumber after every compaction.
The fix: Three mechanisms that capture critical state before compaction hits, and recover it after.
On EVERY incoming message, scan for:
If ANY appear:
SESSION-STATE.md with the detailThe trigger fires on the human's INPUT, not your memory. Write what they said, not what you think.
At 60% context utilization (check via session_status):
memory/working-buffer.md, write header:
# Working Buffer (Danger Zone)
**Status:** ACTIVE
**Started:** [timestamp]
Location: memory/working-buffer.md
Auto-trigger when:
<summary> tag in contextRecovery steps (in order):
memory/working-buffer.md — raw danger-zone exchangesSESSION-STATE.md — active task statememory/YYYY-MM-DD.mdmemory_search if still missing contextNEVER ask "what were we discussing?" — the buffer has the answer.
# Session State — Active Working Memory
## Current Task
[What we're actively working on]
## Key Details
- [Specific values, paths, configs captured via WAL]
## Decisions Made
- [Decisions with rationale]
## Pending
- [What's waiting/blocked]
## Last Updated
[timestamp]
Update this file frequently. It's your RAM — the only place specifics survive between compaction events.
┌──────────────────────────┐
│ Human sends message │
└────────────┬─────────────┘
│
┌────────────▼─────────────┐
│ WAL: Scan for specifics │
│ Found? Write first. │
└────────────┬─────────────┘
│
┌─────────────────▼─────────────────┐
│ Context > 60%? Buffer everything │
└─────────────────┬─────────────────┘
│
┌────────────▼─────────────┐
│ Respond to human │
└────────────┬─────────────┘
│
┌────────▼────────┐
│ COMPACTION HIT │
└────────┬────────┘
│
┌────────────▼─────────────┐
│ Recovery: Read buffer, │
│ SESSION-STATE, daily log │
│ → Full context restored │
└──────────────────────────┘
Most "memory" solutions try to store everything forever. That's the wrong problem. The real problem is precision loss during compaction. You don't need to remember everything — you need to remember the RIGHT things at the RIGHT time.
WAL catches specifics the moment they appear. The buffer captures the danger zone. Recovery restores context after the reset. Three layers, zero dependencies, zero data leakage.
Built by @rustyorb + S1nthetta ⚡ — Battle-tested across 30+ compaction events.