โ† 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

Item is unstable.

This item is timing out or returning errors right now. Review the source page and try again later.

Quick setup
  1. Wait for the source to recover or retry later.
  2. Review SKILL.md only after the source returns a real package.
  3. Do not rely on this source for automated install yet.

Requirements

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

Package facts

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

Validation

  • Wait for the source to recover or retry later.
  • Review SKILL.md only after the download returns a real package.
  • Treat this source as transient until the upstream errors clear.

Install with your agent

Agent handoff

Use the source page and any available docs to guide the install because the item is currently unstable or timing out.

  1. Open the source page via Review source status.
  2. If you can obtain the package, extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the source page and extracted files.
New install

I tried to install a skill package from Yavira, but the item is currently unstable or timing out. Inspect the source page and any extracted docs, then tell me what you can confirm and any manual steps still required. Then review README.md for any prerequisites, environment setup, or post-install checks.

Upgrade existing

I tried to upgrade a skill package from Yavira, but the item is currently unstable or timing out. Compare the source page and any extracted docs with my current installation, then summarize what changed and what manual follow-up I still need. Then review README.md for any prerequisites, environment setup, or post-install checks.

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