Context Optimizer Pro
/install context-optimizer-pro
Context Optimizer
Automatic context management skill that monitors token usage and creates continuation sessions when needed.
Core Functionality
This skill provides:
- Context Monitoring - Track token usage against 200k max
- Threshold Detection - Trigger at 95% (190k tokens)
- Information Extraction - Extract key decisions, important context, unfinished tasks
- Session Continuation - Create new session with summarized context
Usage
Manual Trigger
# Check current context usage
context-optimizer check
# Force extraction and create continuation
context-optimizer split --threshold 95
# Preview what would be extracted
context-optimizer preview
Automatic Monitoring
Add to your workflow or cron:
Every 10 minutes: Run context-optimizer check
When context exceeds threshold, the skill will:
- Analyze conversation history
- Extract key information (decisions, context, todos)
- Generate continuation prompt
- Create new session with extracted context
Extraction Priority
The optimizer extracts in this order:
- Unfinished tasks - Incomplete actions, pending decisions
- Key decisions - Important choices and their rationale
- Critical context - Information essential to task completion
- User preferences - Explicitly stated preferences and requirements
- Recent progress - What has been accomplished so far
Output Format
When creating continuation, output:
# Session Continuation
## Completed
- [list of finished items]
## In Progress
- [current work items]
## Key Context
- [essential information to preserve]
## Next Steps
- [suggested next actions]
---
## Continuation Prompt
[Prompt to use in new session]
Scripts
context_optimizer.py- Main CLI for context monitoring and splittingsession_extractor.py- Extracts key information from session history
Integration with OpenClaw
Automatic Split Logic
To automatically split sessions when context exceeds 95%, integrate with OpenClaw's heartbeat:
- Add to HEARTBEAT.md:
## Context Monitor
Every heartbeat: Check session_status
If context > 85%: Log warning
If context > 95%: Run context-optimizer split
- Create Cron Job:
Use cron with
sessionTarget: "isolated"to run context checks independently.
Tool Integration
The skill uses these OpenClaw tools:
session_status- Get current token/context usagesessions_history- Fetch conversation for extractionsessions_spawn- Create continuation sessioncron- Schedule periodic checks
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install context-optimizer-pro - After installation, invoke the skill by name or use
/context-optimizer-pro - Provide required inputs per the skill's parameter spec and get structured output
What is Context Optimizer Pro?
Monitors token usage in long sessions, extracts key info, and creates continuation sessions to manage context limits automatically. It is an AI Agent Skill for Claude Code / OpenClaw, with 153 downloads so far.
How do I install Context Optimizer Pro?
Run "/install context-optimizer-pro" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Context Optimizer Pro free?
Yes, Context Optimizer Pro is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Context Optimizer Pro support?
Context Optimizer Pro is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Context Optimizer Pro?
It is built and maintained by Ericgogogogogo (@ericgogogogogo); the current version is v1.0.0.