โ† All skills
Tencent SkillHub ยท Developer Tools

Session Context Compressor

Compress OpenClaw session context to reduce token usage and extend session lifetime. Uses NLP summarization (Sumy) to intelligently compact conversation history while preserving essential context. Triggers on mentions of session compression, token reduction, context cleanup, or when session size exceeds safe thresholds (~300KB). Use when (1) OpenClaw approaches 50% context limit, (2) Sessions are slowing down due to large context, (3) Reducing API costs from excessive token consumption, (4) Extending session lifetime without forced reboots.

skill openclawclawhub Free
0 Downloads
0 Stars
0 Installs
0 Score
High Signal

Compress OpenClaw session context to reduce token usage and extend session lifetime. Uses NLP summarization (Sumy) to intelligently compact conversation history while preserving essential context. Triggers on mentions of session compression, token reduction, context cleanup, or when session size exceeds safe thresholds (~300KB). Use when (1) OpenClaw approaches 50% context limit, (2) Sessions are slowing down due to large context, (3) Reducing API costs from excessive token consumption, (4) Extending session lifetime without forced reboots.

โฌ‡ 0 downloads โ˜… 0 stars Unverified but indexed

Install for OpenClaw

Quick setup
  1. Download the package from Yavira.
  2. Extract the archive and review SKILL.md first.
  3. Import or place the package into your OpenClaw setup.

Requirements

Target platform
OpenClaw
Install method
Manual import
Extraction
Extract archive
Prerequisites
OpenClaw
Primary doc
SKILL.md

Package facts

Download mode
Yavira redirect
Package format
ZIP package
Source platform
Tencent SkillHub
What's included
CHANGELOG.md, config.yaml, README.md, SKILL.md, scripts/compress.py

Validation

  • Use the Yavira download entry.
  • Review SKILL.md after the package is downloaded.
  • Confirm the extracted package contains the expected setup assets.

Install with your agent

Agent handoff

Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.

  1. Download the package from Yavira.
  2. Extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the extracted folder.
New install

I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.

Upgrade existing

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. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.

Trust & source

Release facts

Source
Tencent SkillHub
Verification
Indexed source record
Version
1.0.0

Documentation

ClawHub primary doc Primary doc: SKILL.md 12 sections Open source page

ClawPressor - Session Context Compressor

Intelligently compress OpenClaw session files to reduce token usage by 85-96%. Author: JARVIS (AI Coder) | Managed by: BeBoX License: MIT | Version: 1.0.0

Quick Start

# Preview compression without changes python3 scripts/compress.py --dry-run # Apply compression python3 scripts/compress.py --apply # Restore from backup python3 scripts/compress.py --restore

When to Use

SituationActionContext at 30-40%Plan compression soonContext at 50%URGENT โ€” OpenClaw will force compactSession > 300KBCompress to restore performanceSlow responsesLarge context likely the causeHigh API costsCompress regularly to save tokens

How It Works

Preserves recent context โ€” Keeps last 5 messages intact for immediate context Summarizes old messages โ€” Uses LexRank algorithm to extract key information Replaces with compact block โ€” Single system message containing summary Creates backup โ€” Original preserved as .backup file

Prerequisites

pip install sumy python -c "import nltk; nltk.download('punkt_tab'); nltk.download('stopwords')"

Command Reference

# Find and compress latest session (dry-run) python3 scripts/compress.py # Compress specific session python3 scripts/compress.py --session /path/to/session.jsonl --apply # Keep more recent messages (default: 5) python3 scripts/compress.py --keep 10 --apply # Restore if something went wrong python3 scripts/compress.py --restore # View compression statistics python3 scripts/compress.py --stats

Typical Results

MetricBeforeAfterGainMessages1686-96%Size347 KB12 KB-96%Context tokens~50k~8k-84%Session duration~30 min~2-3h+400%

Integration with Workflows

  • In HEARTBEAT.md:
  • ## Context Maintenance (1x/jour)
  • Check session size: `ls -lh ~/.openclaw/agents/main/sessions/*.jsonl`
  • If > 200KB: `python3 skills/clawpressor/scripts/compress.py --apply`
  • Manual check:
  • # See current session stats
  • ls -lh ~/.openclaw/agents/main/sessions/*.jsonl | head -1

Safety

Always creates .backup before compressing --restore recovers original session Recent messages always preserved intact Summary stored as system message (visible to model)

Troubleshooting

IssueSolution"Sumy not installed"Run pip install sumy and NLTK downloadsNo session foundCheck ~/.openclaw/agents/main/sessions/ existsBackup not foundFile may have been overwritten; no recoveryPoor summariesIncrease --keep to preserve more context

Credits

Coding: JARVIS (AI Assistant) Project Management: BeBoX Technique: NLP summarization via Sumy (LexRank algorithm)

Related

See memory/openclaw-context-optimization.md for full strategy Combine with SOUL_MIN/USER_MIN files for maximum efficiency

Category context

Code helpers, APIs, CLIs, browser automation, testing, and developer operations.

Source: Tencent SkillHub

Largest current source with strong distribution and engagement signals.

Package contents

Included in package
3 Docs1 Scripts1 Config
  • SKILL.md Primary doc
  • CHANGELOG.md Docs
  • README.md Docs
  • scripts/compress.py Scripts
  • config.yaml Config