Smart Compact for Openclaw

A sophisticated 4-phase progressive compaction strategy for Openclaw Skills that safeguards critical information before context compression.

wavmson
v1.0.0
Apr 2, 2026
0
632
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install compact-test-a

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 compact-test-a 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 Smart Compact?

Smart Compact is a high-performance utility designed to solve the common problem of information loss during standard context compression in AI agents. While traditional methods often condense entire conversations into a single summary—losing granular details in the process—Smart Compact introduces a proactive pre-processing layer.

By implementing a Save-then-Compress philosophy, this skill ensures that every important configuration, decision, and discovery is persisted into memory files before the /compact command is ever executed. It is an essential tool for developers using Openclaw Skills who require long-running, reliable agent sessions without the risk of memory decay.

Smart Compact Use Cases

  • Managing large-scale dialogues where context usage approaches 80% capacity.
  • Preserving critical technical details like API endpoints, file paths, and error resolutions before memory clearing.
  • Auditing tool outputs to ensure high-volume data (like ls or git status) is summarized rather than simply deleted.
  • Synchronizing short-term session data with long-term knowledge bases for continuous agent learning.

How Smart Compact Works

  1. Scan Phase: The skill reviews all tool outputs and dialogue segments to identify blocks exceeding 2000 characters or 50 lines.
  2. Extract Phase: Key facts, decision rationales, and user preferences are extracted and appended to a daily memory file (memory/YYYY-MM-DD.md).
  3. Check Phase: A structured pre-compaction checklist is generated, showing statistics and flagging any potential risks where important data might not yet be saved.
  4. Compact Phase: Only after user verification or safety confirmation does the skill trigger the final /compact command to refresh the context window.

Smart Compact Setup

Smart Compact is designed for seamless integration with your existing agent environment. To initiate the workflow, use the trigger command within your dialogue interface.

# Trigger the smart-compact workflow manually
smart-compact

# Or use the shortcut for a pre-compression check
compact check

Smart Compact Data Schema & Taxonomy

The skill maintains a structured approach to data persistence to ensure no information is lost during the lifecycle of Openclaw Skills.

Data Type Storage Location Retention Logic
Session Facts memory/YYYY-MM-DD.md Appended via non-destructive edit
Configuration memory/YYYY-MM-DD.md Permanent persistence
Workflow Progress memory/YYYY-MM-DD.md Incremental updates
Redundant Data Context Buffer Discarded after extraction

Smart Compact Advanced Features

  • Heartbeat Integration: Automatically prompts for compaction when context usage reaches the 80% threshold.
  • Dream Skill Synergy: Works in tandem with the Dream Skill to move daily logs into long-term MEMORY.md archives.
  • Transparency Mode: Provides a detailed breakdown of exactly what was saved and why, ensuring the user remains in control of the agent's memory.
  • Multi-modal Triggers: Supports various trigger keywords including smart-compact, pre-compact, and localized commands for international workflows.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*