← Back to Skills Marketplace
ericgogogogogo

Context Optimizer Pro

by Ericgogogogogo · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
153
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install context-optimizer-pro
Description
Monitors token usage in long sessions, extracts key info, and creates continuation sessions to manage context limits automatically.
README (SKILL.md)

Context Optimizer

Automatic context management skill that monitors token usage and creates continuation sessions when needed.

Core Functionality

This skill provides:

  1. Context Monitoring - Track token usage against 200k max
  2. Threshold Detection - Trigger at 95% (190k tokens)
  3. Information Extraction - Extract key decisions, important context, unfinished tasks
  4. 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:

  1. Analyze conversation history
  2. Extract key information (decisions, context, todos)
  3. Generate continuation prompt
  4. Create new session with extracted context

Extraction Priority

The optimizer extracts in this order:

  1. Unfinished tasks - Incomplete actions, pending decisions
  2. Key decisions - Important choices and their rationale
  3. Critical context - Information essential to task completion
  4. User preferences - Explicitly stated preferences and requirements
  5. 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 splitting
  • session_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:

  1. Add to HEARTBEAT.md:
## Context Monitor
Every heartbeat: Check session_status
If context > 85%: Log warning
If context > 95%: Run context-optimizer split
  1. 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 usage
  • sessions_history - Fetch conversation for extraction
  • sessions_spawn - Create continuation session
  • cron - Schedule periodic checks
Usage Guidance
This skill appears to do what it says: monitor context usage, parse conversation history, and produce continuation prompts. Before installing: (1) Review and test the scripts in a safe environment to confirm they only access session history and OpenClaw tools you expect; (2) be aware continuation prompts may include file paths, config snippets, error messages, or other sensitive strings found in conversation history — consider sanitizing history or restricting which conversations it reads; (3) if you enable cron/heartbeat integration, run it in an isolated sessionTarget or with limited permissions to avoid unintentional exposure; (4) if you have strict data-handling policies, inspect/modify the extractor regexes to exclude secrets (API keys, tokens) or add explicit redaction prior to generating continuation prompts.
Capability Analysis
Type: OpenClaw Skill Name: context-optimizer-pro Version: 1.0.0 The 'context-optimizer-pro' skill is a legitimate utility designed to manage LLM context limits by monitoring token usage and automatically summarizing session history to spawn continuation sessions. It utilizes standard OpenClaw tools like 'session_status', 'sessions_history', and 'sessions_spawn' as described in 'SKILL.md' and 'scripts/context_optimizer.py'. The logic is transparent, focusing on extracting tasks, decisions, and file paths via regex to maintain continuity, with no evidence of data exfiltration, malicious execution, or unauthorized persistence.
Capability Assessment
Purpose & Capability
Name/description align with what the code and SKILL.md do: monitor token usage, parse session history, extract key items, and create continuation prompts via OpenClaw tools (session_status, sessions_history, sessions_spawn). No unrelated env vars, binaries, or config paths are requested.
Instruction Scope
Instructions and scripts explicitly read session history and session status (expected). They also recommend cron / heartbeat integration for periodic checks (also expected). Be aware the extractor intentionally searches for file paths, config lines, errors, and user preferences and will include them in generated continuation prompts — this is within scope but can surface sensitive information if present in history.
Install Mechanism
No install spec (instruction-only with included scripts). Nothing is downloaded or written by an installer; risk from install mechanism is low. The skill includes Python scripts but does not attempt to install external packages or fetch code at runtime.
Credentials
The skill requests no environment variables or credentials. The code references a HOME-based memory path (~/.openclaw/...) but does not require access to external secrets. Extraction patterns intentionally look for configuration/URLs/file paths in session content — that behavior matches the stated purpose but could reveal sensitive items present in session history.
Persistence & Privilege
always is false and the skill does not request system-wide persistence or modify other skills. It recommends periodic invocation via cron/heartbeat which is reasonable for its function; autonomous invocation is allowed by default but not exceptional here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install context-optimizer-pro
  3. After installation, invoke the skill by name or use /context-optimizer-pro
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release - context monitoring and auto-split at 95% threshold
Metadata
Slug context-optimizer-pro
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

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.

💬 Comments