Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
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.
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.
This item is timing out or returning errors right now. Review the source page and try again later.
Use the source page and any available docs to guide the install because the item is currently unstable or timing out.
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.
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.
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
# 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
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
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
pip install sumy python -c "import nltk; nltk.download('punkt_tab'); nltk.download('stopwords')"
# 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
MetricBeforeAfterGainMessages1686-96%Size347 KB12 KB-96%Context tokens~50k~8k-84%Session duration~30 min~2-3h+400%
Always creates .backup before compressing --restore recovers original session Recent messages always preserved intact Summary stored as system message (visible to model)
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
Coding: JARVIS (AI Assistant) Project Management: BeBoX Technique: NLP summarization via Sumy (LexRank algorithm)
See memory/openclaw-context-optimization.md for full strategy Combine with SOUL_MIN/USER_MIN files for maximum efficiency
Code helpers, APIs, CLIs, browser automation, testing, and developer operations.
Largest current source with strong distribution and engagement signals.