clawpressor
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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/beboxos/clawpressorWhat This Skill Does
ClawPressor is an intelligent session optimization tool designed for the OpenClaw ecosystem. It functions by systematically condensing verbose session history into a concise summary using the LexRank algorithm via the Sumy NLP library. By intelligently distilling hours of conversation into a single, structured system message while preserving the most recent five interactions verbatim, ClawPressor can reduce memory and token footprints by up to 96%. This allows users to maintain the continuity of long-running AI sessions without hitting context limits, suffering from performance degradation, or incurring unnecessary API costs associated with massive input tokens.
Installation
To install ClawPressor, ensure you have the OpenClaw environment initialized. First, pull the module using the clawhub CLI: clawhub install openclaw/skills/skills/beboxos/clawpressor. Following the package retrieval, you must install the required NLP dependencies to power the summarization engine. Execute the following command in your terminal: pip install sumy. Finally, perform the one-time initialization of the NLTK data libraries by running: python -c "import nltk; nltk.download('punkt_tab'); nltk.download('stopwords')". Once these dependencies are met, the script is ready for deployment.
Use Cases
ClawPressor is intended for power users and developers managing persistent OpenClaw agents. Ideal scenarios include: maintaining a single agent session for multi-day coding projects to keep the model 'aware' of codebase history; managing sessions exceeding 300KB where latency begins to impact response times; reducing token consumption for budget-conscious users operating on paid LLM APIs; and preventing the forced, disorganized context pruning that occurs when OpenClaw hits its hard token limit. By manually triggering a clean-up, you retain full control over what information is summarized.
Example Prompts
- "OpenClaw, our session is getting a bit sluggish and the token count is rising. Please run ClawPressor to summarize our previous discussions while keeping the current technical context."
- "I need to extend our session life for this long-term project. Execute context cleanup using ClawPressor so we can maintain our current progress without hitting the 50% limit."
- "Compress the current session file; I want to reduce our footprint to save on API costs while ensuring the last 10 messages remain fully intact for reference."
Tips & Limitations
To maximize effectiveness, always verify your session size using the ls -lh command before applying compression. While ClawPressor creates an automated .backup file, it is best practice to perform periodic backups of your ~/.openclaw/agents/main/sessions/ directory to external storage. Note that summaries are only as good as the input; if you require specific minute details from a conversation six hours ago, increase the --keep argument in the script to ensure those specific segments are preserved. Avoid running compression while a model response is actively streaming to prevent file I/O conflicts.
Metadata
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-beboxos-clawpressor": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution