Install
openclaw skills install openclaw-context-optimizerIntelligently compresses and optimizes context to reduce token usage by 40-60%, using deduplication, pruning, summarization, and adaptive learning.
openclaw skills install openclaw-context-optimizerReduce context/token usage by 40-60% through intelligent compression and learning.
The first OpenClaw skill that intelligently compresses context to reduce token costs by 40-60%. Uses multiple strategies (deduplication, pruning, summarization) and learns what context matters over time. Works seamlessly with Memory System for maximum efficiency.
Free Tier:
Pro Tier (0.5 USDT/month):
claw skill install openclaw-context-optimizer
# Compress context manually
claw optimize compress "Long context..." --strategy=hybrid
# Show compression stats
claw optimize stats
# View compression history
claw optimize history --limit=10
# Calculate ROI
claw optimize roi
# Open dashboard
claw optimize dashboard
# Subscribe to Pro
claw optimize subscribe
Deduplication (20-30% savings):
Pruning (30-40% savings):
Summarization (40-60% savings):
Hybrid (40-60% savings - Recommended):
Agents can autonomously evaluate if Pro tier is worth it:
Example:
Original: 5,000 tokens × $0.003/1K = $0.015 per request
Compressed: 2,000 tokens × $0.003/1K = $0.006 per request
Savings: $0.009 per request
60 requests/day = $0.54/day = $16.20/month saved
Pro cost: $0.50/month
Net profit: $15.70/month
See AGENT-PAYMENTS.md for x402 integration details.
Works best with OpenClaw Memory System:
claw skill install openclaw-memory
claw skill install openclaw-context-optimizer
~/.openclaw/openclaw-context-optimizer/Access web UI at http://localhost:9092:
Context Optimizer automatically calculates return on investment:
$ claw optimize roi
ROI Analysis (Last 30 Days)
────────────────────────────────
Total compressions: 1,247
Average savings: 60%
Cost without optimizer: $10.28
Cost with optimizer: $4.11
Savings: $6.17
Pro tier cost: $0.50/month
Net savings: $5.67/month
ROI: 1,134% 🎉
# Compress context
POST /api/compress
{
"agent_wallet": "0x...",
"context": "Long context...",
"strategy": "hybrid"
}
# Get stats
GET /api/stats?agent_wallet=0x...
# Get ROI analysis
GET /api/roi?agent_wallet=0x...
# x402 payment endpoints
POST /api/x402/subscribe
POST /api/x402/verify
GET /api/x402/license/:wallet
Token Savings:
- Original: 3,425,000 tokens
- Compressed: 1,370,000 tokens
- Saved: 2,055,000 tokens (60%)
Cost Savings (30 days):
- Without optimizer: $10.28
- With optimizer: $4.11
- Savings: $6.17
Strategy Performance:
- Hybrid: 60% avg (800 uses)
- Summarization: 55% avg (250 uses)
- Pruning: 35% avg (47 uses)
- Deduplication: 25% avg (150 uses)
Should you upgrade to Pro?
If you make enough API calls where 40-60% token savings exceed 0.5 USDT/month, Pro tier pays for itself.
Typical savings:
Built by the OpenClaw community | First context optimizer with x402 payments