compaction-survival_skill

This skill preserves critical state during context compaction by WAL, a working buffer, and automatic recovery to keep decisions, values, and paths.
  • Python

2.5k

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

3 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill compaction-survival

  • _meta.json299 B
  • SKILL.md6.1 KB

Overview

This skill prevents context loss when an LLM's context window is compacted by using three always-active mechanisms: a Write-Ahead Log (WAL), a Working Buffer for the danger zone, and automatic Compaction Recovery. It captures and preserves critical state — decisions, preferences, exact values, paths — so the agent keeps working without losing precision. The behavior runs continuously, not as a one-off tool.

How this skill works

On every incoming human message the WAL scans for corrections, proper nouns, preferences, decisions, edits, and explicit values. When critical details appear they are written immediately to a SESSION-STATE.md file before any reply is composed. When context utilization crosses a configurable threshold (default 60%) the skill activates a Working Buffer that appends every danger-zone exchange to a durable file. If compaction occurs or the session restarts with a summary tag, an automated recovery procedure reads the Working Buffer, SESSION-STATE, recent daily logs, and runs memory search to reconstruct missing context and resume the task.

When to use it

  • Always-on for long-running interactive sessions that risk compaction
  • When precise values, file paths, URLs, or IDs must survive summarization
  • During multi-step tasks that require decisions and rationales to persist
  • When users ask to continue after apparent context loss
  • In agents that perform edits, configuration changes, or path-sensitive actions

Best practices

  • Write triggers must record the human's exact input, not inferred state
  • Keep SESSION-STATE.md small and focused on actionable specifics and decisions
  • Activate Working Buffer at ~60% context usage to maximize safety before compaction
  • Update SESSION-STATE.md on every change to the active task (frequent small writes)
  • On recovery, prefer data from the Working Buffer and SESSION-STATE over asking the user to repeat information

Example use cases

  • A coding assistant that must remember exact file paths and recent code edits across compactions
  • A configuration walkthrough where numbers, IDs, and decisions must remain precise
  • A long planning session where preferences and decisions accumulate and must survive summarization
  • Support conversations where troubleshooting steps and system values must be preserved between restarts

FAQ

Any incoming human message containing corrections, proper nouns, preferences, decisions, edits, or explicit values triggers an immediate write to SESSION-STATE.md before responding.

When does the Working Buffer start and stop?

It starts automatically when context utilization crosses the configured threshold (default 60%) and records all subsequent exchanges until the session resets or a new 60% threshold is reached in a later session.

How does recovery avoid asking the user to repeat context?

Recovery first reads the Working Buffer, SESSION-STATE, and recent daily logs, then runs memory search; it reconstructs the task state and resumes, only asking the user if all automated sources fail.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
compaction-survival skill by openclaw/skills | VeilStrat