context-optimizer
Second-pass context optimization that surgically removes irrelevant content after initial context load. Use when context is bloated, tokens need reduction, or loaded specs are irrelevant to current task. Achieves 80%+ token reduction through intelligent prompt analysis.
Why use this skill?
Boost agent performance with the OpenClaw Context Optimizer. Intelligently prune irrelevant technical specs and reduce token usage by 80% for faster results.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anton-abyzov/sw-context-optimizerWhat This Skill Does
The context-optimizer is a sophisticated second-pass middleware designed for OpenClaw agents to drastically improve token efficiency. After the initial context-loader performs a broad, manifest-based sweep of your project repository, the context-optimizer performs a surgical, intent-driven analysis. It scrutinizes your current prompt against the loaded data, identifying which sections of the documentation, codebase, and technical specs are irrelevant to the task at hand. By systematically pruning unnecessary documentation, unrelated feature specifications, and out-of-scope technical modules, it can achieve upwards of 80% total token reduction. This ensures that the agent's context window is filled exclusively with high-signal, relevant data, leading to faster response times, reduced compute costs, and higher-quality, hallucination-free outputs.
Installation
To integrate this skill into your OpenClaw environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/anton-abyzov/sw-context-optimizer
Ensure that your OpenClaw project manifest is correctly configured, as the optimizer functions most effectively as a successor to the context-loader.
Use Cases
- Precision Bug Fixing: When you need to resolve an issue in a specific backend module, the optimizer strips away frontend specs, devops documentation, and unrelated service files, allowing the LLM to focus entirely on the relevant logic.
- Refactoring Focused Components: When tasked with updating a single function or class, the tool clears the workspace of broad architectural overviews that aren't strictly required for the refactor.
- Optimized Technical Research: When querying specific security or Auth protocols, the optimizer removes general project management artifacts that would otherwise crowd the context window.
Example Prompts
- "Optimize context and fix the null pointer exception in the auth-service login controller."
- "I need to refactor the payment gateway logic; reduce tokens by optimizing the context to only include Stripe integration docs."
- "Clean context and then explain the current database schema defined in the models folder."
Tips & Limitations
- Automatic Triggering: The optimizer is designed to activate automatically when it detects high context bloat (>20k tokens) and a highly specific task. You rarely need to trigger it manually unless you feel the agent is being "distracted" by background information.
- Limitations: Avoid using this skill when performing broad system architectural reviews or when initializing a new project where full context is required for holistic understanding. If your token count is already below 10k, the optimizer will typically bypass execution to save processing cycles.
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-anton-abyzov-sw-context-optimizer": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read
Related Skills
network-engineer
Cloud network architect for VPC design, service mesh, zero-trust networking, load balancers, and CDN optimization. Use for network troubleshooting or connectivity issues.
jira-multi-project-mapper
Expert in mapping SpecWeave specs to multiple JIRA projects with intelligent project detection and cross-project coordination. Use when syncing to multiple JIRA projects (project-per-team, component-based), or managing bidirectional sync across team boundaries.
helm-chart-scaffolding
Design, organize, and manage Helm charts for templating and packaging Kubernetes applications with reusable configurations. Use when creating Helm charts, packaging Kubernetes applications, or implementing templated deployments.
performance-optimization
React Native performance with Hermes V1, FlashList, expo-image v2, concurrent rendering. Use for slow app, memory leaks, or FPS issues.
release-strategy-advisor
Release strategy advisor - detects brownfield patterns (tags, CI/CD, changelogs), recommends versioning strategy based on architecture. Creates release-strategy.md.