Smart Compact for Openclaw

A 4-phase progressive context management strategy that preserves critical technical information before executing agent compression.

wavmson
v1.0.0
Apr 2, 2026
0
754
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install compact-test-b

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-b 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 specialized enhancement for Openclaw Skills designed to prevent the loss of granular details during the context compression process. Traditional compression often reduces entire conversations into a single summary, causing the AI to forget specific configurations, error logs, or architectural decisions.

By implementing a progressive strategy, Smart Compact rescues information before the /compact command is executed. It acts as a safety buffer, ensuring that every discovery, user preference, and technical fact is documented in persistent storage, allowing the agent to maintain high performance without sacrificing its long-term project knowledge.

Smart Compact Use Cases

  • When the conversation context length approaches 80% capacity and needs reduction.
  • Before manually executing the /compact command to safeguard current progress.
  • When working with high-volume tool outputs like large logs or directory listings that need filtering.
  • To automatically extract and archive daily progress into persistent memory files.

How Smart Compact Works

  1. Scan: The skill analyzes all tool outputs and dialogue segments, identifying blocks exceeding 50 lines or containing high-value keywords.
  2. Extract: Validated facts, configuration values, decision logic, and error resolutions are extracted and appended to a daily memory file.
  3. Check: A structured pre-compaction checklist is generated, detailing what was saved and identifying any potential risks or unreferenced data.
  4. Compact: After the user confirms the safety of the extracted data, the final compression command is executed to refresh the context window.

Smart Compact Setup

To enable Smart Compact within your Openclaw Skills workflow, ensure your agent has permissions to write to the memory directory. No complex installation is required.

# Ensure the memory directory exists in your workspace root
mkdir -p memory

Once the directory is ready, the agent can trigger the skill via the smart-compact command or automatically when context limits are reached.

Smart Compact Data Schema & Taxonomy

Smart Compact organizes data using a chronological file-based taxonomy to ensure long-term accessibility.

Data Component Format Storage Location
Persistent Memory Append-only Markdown memory/YYYY-MM-DD.md
Discovery Facts Bulleted List Inside daily memory file
Decision Logs Source-attributed text Inside daily memory file
Safety Checklist Structured UI Report Current session output

Smart Compact Advanced Features

  • Progressive 4-phase strategy: Scan, Extract, Check, and Compact for maximum data integrity.
  • Seamless integration with the Dream Skill for transitioning daily logs into long-term MEMORY.md files.
  • Intelligent detection of redundant tool outputs (e.g., repeated git status or ls commands) to optimize space.
  • Non-destructive append mode that protects existing project logs while adding new insights.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*