# Send Compaction Survival System to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "compaction-survival",
    "name": "Compaction Survival System",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/rustyorb/compaction-survival",
    "canonicalUrl": "https://clawhub.ai/rustyorb/compaction-survival",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/compaction-survival",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=compaction-survival",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "compaction-survival",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T17:31:55.275Z",
      "expiresAt": "2026-05-07T17:31:55.275Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=compaction-survival",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=compaction-survival",
        "contentDisposition": "attachment; filename=\"compaction-survival-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "compaction-survival"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/compaction-survival"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/compaction-survival",
    "downloadUrl": "https://openagent3.xyz/downloads/compaction-survival",
    "agentUrl": "https://openagent3.xyz/skills/compaction-survival/agent",
    "manifestUrl": "https://openagent3.xyz/skills/compaction-survival/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/compaction-survival/agent.md"
  }
}
```
## Documentation

### Compaction Survival System

Compaction 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.

### 1. WAL Protocol (Write-Ahead Logging)

On EVERY incoming message, scan for:

✏️ Corrections — "It's X, not Y" / "Actually..."
📍 Proper nouns — names, places, companies, products
🎨 Preferences — styles, approaches, "I like/don't like"
📋 Decisions — "Let's do X" / "Go with Y"
📝 Draft changes — edits to active work
🔢 Specific values — numbers, dates, IDs, URLs, paths

If ANY appear:

STOP — do not compose response yet
WRITE — update SESSION-STATE.md with the detail
THEN — respond to the human

The trigger fires on the human's INPUT, not your memory. Write what they said, not what you think.

### 2. Working Buffer (Danger Zone)

At 60% context utilization (check via session_status):

Create/clear memory/working-buffer.md, write header:
# Working Buffer (Danger Zone)
**Status:** ACTIVE
**Started:** [timestamp]


Every exchange after 60%: append human's message + your response summary
Buffer is a file — it survives compaction
Leave buffer as-is until next 60% threshold in a new session

Location: memory/working-buffer.md

### 3. Compaction Recovery

Auto-trigger when:

Session starts with <summary> tag in context
You should know something but don't
Human says "where were we?" / "continue" / "what were we doing?"

Recovery steps (in order):

Read memory/working-buffer.md — raw danger-zone exchanges
Read SESSION-STATE.md — active task state
Read today's + yesterday's memory/YYYY-MM-DD.md
Run memory_search if still missing context
Extract important context from buffer → update SESSION-STATE.md
Report: "Recovered context. Last task was X. Continuing."

NEVER ask "what were we discussing?" — the buffer has the answer.

### SESSION-STATE.md Format

# 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.

### How It Works Together

┌──────────────────────────┐
                    │    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   │
                    └──────────────────────────┘

### Integration

Works alongside MEMORY.md (long-term) and memory/YYYY-MM-DD.md (daily logs)
SESSION-STATE.md = working memory for current task
Working buffer = emergency capture for the danger zone
All three layers stack: WAL → Buffer → Recovery
No dependencies. No API keys. Pure behavioral patterns.

### Why This Works

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.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: rustyorb
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-30T17:31:55.275Z
- Expires at: 2026-05-07T17:31:55.275Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/compaction-survival)
- [Send to Agent page](https://openagent3.xyz/skills/compaction-survival/agent)
- [JSON manifest](https://openagent3.xyz/skills/compaction-survival/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/compaction-survival/agent.md)
- [Download page](https://openagent3.xyz/downloads/compaction-survival)