token-saverReduce OpenClaw AI costs with model-aware optimization. Features dynamic compaction presets based on your model's context window, intelligent file compression, and robust model detection with fallback. Supports Claude, GPT-4, Gemini, DeepSeek, and more.
Install via ClawdBot CLI:
clawdbot install RubenAQuispe/token-saver๐ก Did you know? Every API call sends your workspace files (SOUL.md, USER.md, MEMORY.md, AGENTS.md, etc.) along with your message. These files count toward your context window, slowing responses and costing real money on every message.
Token Saver v3 is model-aware โ it knows your model's context window and adapts recommendations accordingly. Using Gemini's 1M context? Presets scale up. On GPT-4o's 128K? Presets adjust down.
| Feature | v2 | v3 |
|---------|----|----|
| Compaction presets | Fixed (80K/120K/160K) | Dynamic (% of model's context) |
| Model detection | Fragile, env-only | Robust fallback chain |
| Context windows | Not tracked | Full registry (9 models) |
| Model info | Hardcoded pricing | JSON registry, easy updates |
| Already-optimized | Re-compressed | Smart bypass |
| Command | What it does |
|---|---|
| /optimize | Full dashboard โ files, models, context usage % |
| /optimize tokens | Compress workspace files (auto-backup) |
| /optimize compaction | Chat compaction control (model-aware) |
| /optimize compaction balanced | Apply balanced preset (60% of context) |
| /optimize compaction 120 | Custom threshold (compact at 120K) |
| /optimize models | Detailed model audit with registry |
| /optimize revert | Restore backups, disable persistent mode |
Shows current model, context window, and usage percentage:
๐ค Model: Claude Opus 4.5 (200K context)
Detected: openclaw.json
๐ Context Usage: [โโโโโโโโโโโโโโโโโโโโ] 42% (84K/200K)
Scans all .md files, shows token count and potential savings. Smart bypass skips already-optimized files.
File-aware compression:
Presets adapt to your model's context window:
| Preset | % of Context | Claude 200K | GPT-4o 128K | Gemini 1M |
|--------|--------------|-------------|-------------|-----------|
| Aggressive | 40% | 80K | 51K | 400K |
| Balanced | 60% | 120K | 77K | 600K |
| Conservative | 80% | 160K | 102K | 800K |
| Off | 95% | 190K | 122K | 950K |
24+ models with context windows, pricing, and aliases:
Detection priority:
--model=...)SKILL_MODEL, OPENCLAW_MODEL)~/.openclaw/openclaw.json)Unknown model handling:
opus-6.5 won't fuzzy-match to opus-4.5scripts/models.jsonAdds writing guidance to AGENTS.md for continued token efficiency:
| File | Writing Style |
|------|---------------|
| SOUL.md | Evocative, personality-shaping |
| AGENTS.md | Dense instructions, symbols OK |
| USER.md | Key:value facts |
| MEMORY.md | Ultra-dense data |
.backup extension/optimize revert restores everythingclawhub install token-saver --registry "https://www.clawhub.ai"
Generated Mar 1, 2026
Companies using AI agents for customer service can integrate Token Saver to reduce API costs by compressing knowledge base files like USER.md and MEMORY.md. The dynamic presets adapt to models like GPT-4o, ensuring efficient context usage without sacrificing response quality during high-volume interactions.
Marketing teams leveraging AI for content generation can use Token Saver to optimize workspace files such as SOUL.md for brand voice preservation. The model-aware dashboard helps manage token usage across platforms like Claude and Gemini, cutting costs while maintaining creative output consistency.
Development teams employing AI coding assistants can apply Token Saver to compress AGENTS.md and PROJECTS.md, reducing token overhead in code review and debugging sessions. The robust detection ensures compatibility with models like DeepSeek V3, optimizing for technical workflows without external dependencies.
Researchers using AI for data summarization and analysis can utilize Token Saver's file-aware compression on MEMORY.md to handle large datasets efficiently. The persistent mode guides dense writing styles, enabling cost-effective use of high-context models like Gemini 1M for complex queries.
Offer a free tier with basic compression and limited model support, then charge for advanced features like dynamic presets, model registry updates, and priority support. Revenue can come from monthly subscriptions targeting small to medium businesses using AI agents regularly.
Sell annual licenses to large organizations with custom integrations, dedicated support, and enhanced security features. This model leverages Token Saver's local analysis and safety features to appeal to industries like finance or healthcare with strict data privacy requirements.
Partner with AI platform providers to bundle Token Saver as a value-add service, sharing revenue based on token savings achieved for users. This model incentivizes adoption by reducing overall API expenses for clients using models from providers like OpenAI or Anthropic.
๐ฌ Integration Tip
Start by running /optimize tokens to compress workspace files, then use /optimize compaction balanced for adaptive chat optimization based on your model's context window.
Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock scoring, viral trend detection (Hot Scanner), and rumor/early signal detection. Use for stock analysis, portfolio tracking, earnings reactions, crypto monitoring, trending stocks, or finding rumors before they hit mainstream.
Get stock prices, quotes, fundamentals, earnings, options, dividends, and analyst ratings using Yahoo Finance. Uses yfinance library - no API key required.
Yahoo Finance (yfinance) powered stock analysis skill: quotes, fundamentals, ASCII trends, high-resolution charts (RSI/MACD/BB/VWAP/ATR), plus optional web a...
Become an autonomous prediction market trader on Polymarket with AI-powered analysis and a performance-backed token on Base. Trade real markets, build a track record, and let the buyback flywheel run.
Get cryptocurrency token price and generate candlestick charts via CoinGecko API or Hyperliquid API. Use when user asks for token price, crypto price, price chart, or cryptocurrency market data.
Trade and monitor Hyperliquid perpetual futures. Check balances, view positions with P&L, place/cancel orders, execute market trades. Use when the user asks about Hyperliquid trading, portfolio status, crypto positions, or wants to execute trades on Hyperliquid.