ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 5/5

claw-compactor

Claw Compactor v6.0 — 50%+ savings through rule-based compression, dictionary encoding, session observation compression, and progressive context loading.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/aeromomo/cut-your-tokens-97percent-savings-on-session-transcripts-via-observation-extraction
Or

What This Skill Does

Claw Compactor v6.0 is a sophisticated, deterministic utility designed to drastically reduce the token consumption of AI agents without compromising the integrity of factual data. By employing five distinct layers of compression—ranging from rule-based deduplication and dictionary encoding to advanced observation extraction and progressive context loading—the skill achieves massive savings. Unlike methods that rely on LLMs, Claw Compactor is strictly deterministic, ensuring that roundtrip compression and decompression remain consistent and reliable. The tool is particularly effective for managing large workspaces, lengthy memory files, and deep session transcripts, allowing developers to maintain long-term context while staying within the constraints of strict token budgets.

Installation

To install this skill, use the OpenClaw hub command: clawhub install openclaw/skills/skills/aeromomo/cut-your-tokens-97percent-savings-on-session-transcripts-via-observation-extraction

Ensure that you have Python 3.9 or higher installed on your system. For highly precise token counting, it is recommended to install the optional dependency using pip install tiktoken. Once installed, you can verify your environment by running the benchmark script against your workspace directory.

Use Cases

  • Long-term Agent Memory: Shrink years of session transcripts down to a fraction of their original size while keeping key decisions and context available for the AI.
  • Optimizing Workspace Context: Reduce the token overhead of workspace files, markdown documentation, and system logs before feeding them into an agent's memory window.
  • Cost Management: Drastically lower the API bill for applications that require extensive context loading for sub-agents.
  • Cross-Language Operations: Benefit from CJK-aware encoding that optimizes content even in Chinese, Japanese, and Korean environments.

Example Prompts

  1. "Run the claw-compactor benchmark on my /projects/work-log directory to see how many tokens I can save before a full process."
  2. "Perform a full compression on the current session workspace and apply L2 tiered summarization to optimize memory."
  3. "Summarize the last week of logs using the claw-compactor observation extraction layer to preserve only the key project decisions."

Tips & Limitations

  • Lossless vs. Lossy: While layers 1, 2, and 4 are strictly lossless, layers 3 and 5 are lossy. They are designed to strip verbose filler and conversational clutter while retaining all critical facts. Review your compressed files if they contain mission-critical non-standard formatting.
  • Benchmarking First: Always execute python3 scripts/mem_compress.py /path/to/workspace benchmark before running the full command to ensure the compression results meet your requirements.
  • Compatibility: This skill operates locally via Python and does not require external network connections, making it a highly secure choice for sensitive data projects.

Metadata

Author@aeromomo
Stars4473
Views2
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-aeromomo-cut-your-tokens-97percent-savings-on-session-transcripts-via-observation-extraction": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#compression#token-optimization#memory-management#productivity
Safety Score: 5/5

Flags: file-read, file-write, code-execution