# Send Openclaw Context Optimizer to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openclaw-context-optimizer",
    "name": "Openclaw Context Optimizer",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/AtlasPA/openclaw-context-optimizer",
    "canonicalUrl": "https://clawhub.ai/AtlasPA/openclaw-context-optimizer",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/openclaw-context-optimizer",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-context-optimizer",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "AGENT-PAYMENTS.md",
      "hooks/request-after.js",
      "hooks/request-before.js",
      "hooks/session-end.js",
      "IMPLEMENTATION_SUMMARY.md",
      "migrations/001-init.sql"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "openclaw-context-optimizer",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T23:32:24.746Z",
      "expiresAt": "2026-05-09T23:32:24.746Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-context-optimizer",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-context-optimizer",
        "contentDisposition": "attachment; filename=\"openclaw-context-optimizer-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "openclaw-context-optimizer"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/openclaw-context-optimizer"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/openclaw-context-optimizer",
    "downloadUrl": "https://openagent3.xyz/downloads/openclaw-context-optimizer",
    "agentUrl": "https://openagent3.xyz/skills/openclaw-context-optimizer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-context-optimizer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-context-optimizer/agent.md"
  }
}
```
## Documentation

### OpenClaw Context Optimizer

Reduce context/token usage by 40-60% through intelligent compression and learning.

### What is it?

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.

### Key Features

⚡ 40-60% Token Savings - Intelligent compression without information loss
🧠 Learning System - Adapts to what context matters in your workflow
🔄 Multiple Strategies - Dedup, prune, summarize, hybrid
💾 Memory Integration - Works with OpenClaw Memory System
💰 x402 Payments - Agents can pay for unlimited compressions (0.5 USDT/month)
📊 ROI Tracking - Automatically calculates return on investment

### Free vs Pro Tier

Free Tier:

100 compressions per day
All compression strategies
Basic statistics and ROI tracking

Pro Tier (0.5 USDT/month):

Unlimited compressions
Advanced learning algorithms
Priority compression
Detailed analytics
Custom compression rules

### Installation

claw skill install openclaw-context-optimizer

### Commands

# 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

### How It Works

Hooks into requests - Automatically intercepts context before API calls
Analyzes content - Identifies redundant, irrelevant, or summarizable info
Applies strategy - Deduplication → Pruning → Summarization
Learns patterns - Tracks what context was useful vs. wasted
Compresses intelligently - Reduces tokens by 40-60%

### Compression Strategies

Deduplication (20-30% savings):

Removes repeated information across messages
Best for long conversations with repeated facts

Pruning (30-40% savings):

Removes low-importance messages (greetings, confirmations)
Best for conversations with filler content

Summarization (40-60% savings):

Condenses long exchanges into key points
Best for technical discussions and planning

Hybrid (40-60% savings - Recommended):

Combines all strategies intelligently
Best for most use cases

### Use Cases

Reduce token costs on long conversations
Compress repeated project context
Summarize technical discussions
Remove filler from chat history
Learn compression patterns over time

### Agent Economy

Agents can autonomously evaluate if Pro tier is worth it:

Cost: 0.5 USDT/month
Value: Saves 40-60% on token costs
ROI: If saves >0.5 USDT/month in tokens, it pays for itself

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.

### Memory System Integration

Works best with OpenClaw Memory System:

Stores compression patterns as memories
Learns what context is important over time
Recalls successful strategies from past sessions
Combined savings: 50-70%

claw skill install openclaw-memory
claw skill install openclaw-context-optimizer

### Privacy

All data stored locally in ~/.openclaw/openclaw-context-optimizer/
No external servers or telemetry
Compression happens locally (no API calls)
Open source - audit the code yourself

### Dashboard

Access web UI at http://localhost:9092:

Real-time compression statistics
Token savings over time
ROI calculation (savings vs. Pro cost)
Strategy performance comparison
Compression history with before/after view
Quota usage and license status

### ROI Tracking

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% 🎉

### Requirements

Node.js 18+
OpenClaw v2026.1.30+
OS: Windows, macOS, Linux
Optional: OpenClaw Memory System (recommended)

### API Reference

# 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

### Statistics Example

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)

### Economic Rationale

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:

Small projects: $2-5/month saved → $1.50-4.50 profit
Medium projects: $10-20/month saved → $9.50-19.50 profit
Large projects: $50+/month saved → $49.50+ profit

### Links

Documentation
Agent Payments Guide
GitHub Repository
ClawHub Page

Built by the OpenClaw community | First context optimizer with x402 payments
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: AtlasPA
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-02T23:32:24.746Z
- Expires at: 2026-05-09T23:32:24.746Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/openclaw-context-optimizer)
- [Send to Agent page](https://openagent3.xyz/skills/openclaw-context-optimizer/agent)
- [JSON manifest](https://openagent3.xyz/skills/openclaw-context-optimizer/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/openclaw-context-optimizer/agent.md)
- [Download page](https://openagent3.xyz/downloads/openclaw-context-optimizer)