Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

Openclaw Context Optimizer

Intelligently compresses and optimizes context to reduce token usage by 40-60%, using deduplication, pruning, summarization, and adaptive learning.

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 890 · 5 current installs · 5 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Suspicious
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
The code and SKILL.md align with the name: a local context compressor with learning, quotas, and a local dashboard. However the registry metadata claimed 'no required config paths' / 'instruction-only', while SKILL.md and the code explicitly store data under ~/.openclaw/openclaw-context-optimizer/ and include many source files (package.json, migrations, express, sqlite). That mismatch (metadata vs actual delivered files/behavior) is inconsistent and should be treated as surprising.
!
Instruction Scope
Runtime instructions and hooks modify request context, record feedback, and persist compression sessions/patterns. The skill also exposes local HTTP endpoints (dashboard and x402 endpoints) and instructs agents to autonomously subscribe via x402. Critically, the AGENT-PAYMENTS docs and IMPLEMENTATION_SUMMARY note the MVP 'trusts reported transaction hashes' (no on-chain verification), which allows an agent (or actor able to call the verify endpoint) to claim payment and obtain Pro access without real on-chain validation. The instructions also encourage giving agents wallet access so they can pay autonomously — a high-risk capability if not tightly controlled.
Install Mechanism
No explicit install spec was provided in registry metadata (skill treated as instruction-only), but a full Node project is included with package.json, migrations, and scripts. Installing/running will require npm deps (express, better-sqlite3) and will create files/DB locally. That is not inherently malicious, but the absence of a declared install step in metadata combined with included executable code is an incongruence worth calling out.
!
Credentials
The skill declares no required env vars, which is plausible, but it expects 'agent_wallet' values at runtime and can programmatically create payment requests and verify payments. If an agent is granted a funded wallet or permission to send txs, the skill enables autonomous spending (0.5 USDT/month) and license changes. The skill does not request cloud/API credentials, which is proportionate, but the ability to trigger payments and upgrade licenses without robust on-chain verification is disproportionate relative to a pure compression utility.
!
Persistence & Privilege
The skill registers lifecycle hooks (request:before, request:after, session:end) that automatically modify and persist context and stats. That's expected for this kind of tool, but combined with the autonomous x402 payment flow (and the 'trust tx hash' MVP behavior), it grants an agent a path to change its tier/quota and thus affect behavior/charges without human approval. always:false and normal autonomous invocation are okay on their own, but the payment/upgrade capability raises privilege concerns.
What to consider before installing
What to consider before installing: - Mismatch & file presence: Although registry metadata suggests 'instruction-only' and 'no config paths', this package contains a Node project that writes a SQLite DB and config under ~/.openclaw/openclaw-context-optimizer/. Expect on-disk storage and an HTTP dashboard on localhost (9092). - Autonomous payments: The skill enables agents to subscribe to a Pro tier (0.5 USDT/month) via a local x402 API. AGENT-PAYMENTS.md warns the MVP trusts reported tx hashes (no on-chain verification). If you give an agent wallet access, it could authorize payments or potentially claim payments without on-chain proof. Do not grant real wallet keys or signing capability to untrusted agents. - Least privilege: If you still want to use it, run it in an isolated environment (sandbox or container), and do not expose a funded wallet to autonomous agents. Prefer manual payment workflows or require explicit human confirmation for upgrades. - Audit & test: Review the included source (especially src/x402.js, src/index.js, and dashboard code) before running. Confirm whether verifyPayment does any on-chain RPCs, and if not, require that in production. Search for any network calls to remote hosts beyond localhost; monitor network activity during initial runs. - Backup & privacy: The optimizer stores compressed and original contexts locally. If your contexts contain sensitive data, treat the DB and config directory as sensitive and back them up/secure them accordingly. - If uncertain: mark this skill as suspicious and prefer a vetted alternative or request the maintainer to implement proper on-chain verification, explicit install instructions, and clearer metadata (declaring config paths and required permissions).

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk973ay16tcbhcmt1p00w63h4as811atk

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

Clawdis
OSmacOS · Linux · Windows
Binsnode

SKILL.md

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

  1. Hooks into requests - Automatically intercepts context before API calls
  2. Analyzes content - Identifies redundant, irrelevant, or summarizable info
  3. Applies strategy - Deduplication → Pruning → Summarization
  4. Learns patterns - Tracks what context was useful vs. wasted
  5. 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


Built by the OpenClaw community | First context optimizer with x402 payments

Files

25 total
Select a file
Select a file to preview.

Comments

Loading comments…