Tokenoptimizer
Reduce OpenClaw AI costs by 97%. Haiku model routing, free Ollama heartbeats, prompt caching, and budget controls. Go from $1,500/month to $50/month in 5 min...
Reduce OpenClaw AI costs by 97%. Haiku model routing, free Ollama heartbeats, prompt caching, and budget controls. Go from $1,500/month to $50/month in 5 min...
Real data. Real impact.
Emerging
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
Slash your AI costs from $1,500+/month to under $50/month.
OpenClaw defaults prioritize capability over cost. You're burning expensive Sonnet/Opus tokens on tasks Haiku handles perfectly, paying for API heartbeats that could run free locally, and loading 50KB of context when 8KB suffices.
Four core optimizations plus powerful tooling:
Haiku by default, Sonnet/Opus only when needed
Route heartbeats to Ollama, LM Studio, Groq, or disable entirely. Not locked to one provider.
Load 8KB instead of 50KB context
Reuse prompts at 10% cost
| Period | Before | After |
|---|---|---|
| Daily | $2-3 | $0.10 |
| Monthly | $70-90 | $3-5 |
| Yearly | $800+ | $40-60 |
All changes are written under
~/.openclaw/. A backup is created before any modification.
| Path | Purpose |
|---|---|
| Main OpenClaw config (model routing, heartbeat, budgets) |
| Timestamped config backups (created automatically) |
| Template files (SOUL.md, USER.md, IDENTITY.md) |
| Agent prompt optimization rules |
| Usage stats for savings reports |
Safe by default - All commands run in dry-run (preview) mode. Pass
--apply to write changes.
# Install clawhub install token-optimizerAnalyze current setup
python cli.py analyze
Preview changes (dry-run by default)
python cli.py optimize
Apply all optimizations
python cli.py optimize --apply
Verify setup
python cli.py verify
Quick health check
python cli.py health
Configure heartbeat provider (preview)
python cli.py setup-heartbeat --provider ollama
Configure heartbeat provider (apply)
python cli.py setup-heartbeat --provider ollama --apply
List and restore backups
python cli.py rollback --list python cli.py rollback --to <backup-file>
{ "agents": { "defaults": { "model": { "primary": "anthropic/claude-haiku-4-5" }, "cache": { "enabled": true, "ttl": "5m" } } }, "heartbeat": { "provider": "ollama", "model": "ollama/llama3.2:3b" }, "budgets": { "daily": 5.00, "monthly": 200.00 } }
Smart People Connected
MIT License - Free to use, modify, and distribute.
5 minutes to setup. 97% cost reduction. Stop burning tokens. Start building.
No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.