Compaction Survival System for Openclaw

A robust behavioral system designed to prevent context loss and precision decay during LLM compaction events.

rustyorb
v1.0.0
Feb 27, 2026
0
1.7k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install compaction-survival

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install compaction-survival using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Compaction Survival System?

This skill addresses a fundamental limitation in AI agents: the loss of specific details like file paths, exact values, and reasoning chains when the context window fills up. By implementing Openclaw Skills such as the Compaction Survival System, agents can maintain high-fidelity memory through three integrated layers: Write-Ahead Logging (WAL), a Working Buffer for high-utilization states, and an automated Recovery protocol. This ensures that the agent remains sharp and informed, even after a context reset or summary event.\n\nUnlike traditional memory solutions that attempt to store everything, this approach focuses on precision. It captures critical data points—corrections, preferences, and decisions—the moment they are mentioned, ensuring that your Openclaw Skills workflow never suffers from agent amnesia.

Compaction Survival System Use Cases

  • Protecting specific technical data like file paths, URLs, and IDs from being generalized during context summarization.\n- Maintaining a consistent record of user preferences and style corrections across long-running sessions.\n- Recovering full task context after an LLM reaches its token limit and triggers a compaction event.\n- Ensuring high-precision reasoning chains survive when working on complex, multi-step engineering projects.

How Compaction Survival System Works

  1. Scan every incoming message for critical data types using the WAL protocol before generating a response.\n2. Update the SESSION-STATE.md file immediately if corrections, decisions, or specific values are detected.\n3. Monitor context utilization and activate the Working Buffer at a 60% threshold to log all exchanges in the danger zone.\n4. Trigger the Recovery mechanism automatically upon session restart or when detecting a summary tag in the context.\n5. Reconstruct active working memory by reading the buffer, session state, and daily logs to restore full operational context.

Compaction Survival System Setup

The Compaction Survival System is a behavioral skill and does not require external API keys. To integrate it into your Openclaw Skills environment, follow these steps:\n\n1. Ensure your agent has permission to read/write to a memory/ directory.\n2. Create the initial SESSION-STATE.md file in your workspace root.\n3. Configure your agent's system prompt to prioritize the WAL protocol on every user input.\n\nbash\nmkdir -p memory\ntouch SESSION-STATE.md\n

Compaction Survival System Data Schema & Taxonomy

The system organizes data across three primary layers to ensure survival across compaction events within the Openclaw Skills ecosystem:\n\n| File | Purpose | Retention |\n| :--- | :--- | :--- |\n| SESSION-STATE.md | Active working memory, specific values, and decisions. | Persists until task completion. |\n| memory/working-buffer.md | Raw logs of exchanges occurring after 60% context usage. | Overwritten each high-utilization session. |\n| memory/YYYY-MM-DD.md | Daily logs providing chronological history. | Permanent archival. |

Compaction Survival System Advanced Features

  • Automated WAL triggers that prioritize human corrections and technical specifics over general conversation.\n- Context-aware recovery that eliminates the need for the agent to ask what were we doing after a reset.\n- Multi-layered memory stacking that integrates session state with long-term archival logs.\n- Zero-dependency architecture that works purely through behavioral patterns and local file persistence.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*