Too good not to share. Post ideas or corrections in comments:
So we can build on this as a group.
Quick Summary
OpenClaw can get expensive fast. Learn to optimize token usage without losing quality.
Why This Matters
Token costs add up:
- GPT-4: ~$15-30 per million tokens
- Claude: ~$15 per million tokens
- MiniMax: ~$1 per million tokens
At 100 conversations/day, that’s $100+/month quickly.
With optimization: Same quality, 80% less cost.
The Framework
Token = Money
Every message costs money. Treat tokens like: - Time: Don’t waste - Money: Don’t overspend - Space: Use only what fits
The 3 Principles
1. Be Concise - Say more with less
2. Load Only What’s Needed - Context matters, not everything
3. Cache Frequently - Don’t regenerate what’s cached
Step 1: Model Selection
Step 2: Prompt Optimization
Bad Prompt (500 tokens)
Can you please, if you have time, look at my emails and tell me what they say about my meeting tomorrow and also check if there's anything important I should know about?
Optimized Prompt (50 tokens)
Summarize my emails for tomorrow's meeting.
Same result, 10x less cost.
Prompt Rules
1. Remove filler - No “please”, “if you have time”
2. Be specific - Clear asks, not vague requests
3. One task - Don’t combine multiple tasks
4. Use limits - “Summarize in 3 bullet points”
Step 3: Context Management
Load Only What’s Needed
Bad: Copy entire document
Good: “From section 3 of document.md, what’s the key point?” Summarize Instead of Full Context
“Summarize the last 50 messages about Project X”
Use File References
{ "context": { "file": "memory/projects/deployclaw.md", "load": "status only" }} Step 4: Caching
Enable Caching
{ "caching": { "enabled": true, "ttl": "24h", "strategies": ["summaries", "search_results"] }}
What to Cache
· Summaries (don’t regenerate)
· Search results
· Common lookups
· Frequently used info
Step 5: Session Optimization
Concise Responses
Don’t: - Repeat context - Add unnecessary explanations - Use verbose language
Do: - Get to the point - Use bullets - Reference files, don’t copy
Session Reset
Set automatic reset:
{ "session": { "reset": { "mode": "daily", "atHour": 4 } }}
This clears expensive context daily.
Step 6: Budget Alerts
Set Limits
{ "budget": { "daily": "2.00", "alertAt": "1.50", "action": "reduce_quality" }}
Monitor Usage
openclaw usage today
openclaw usage this-week
The Token Optimization Checklist
☐ Use cheapest model for simple tasks
☐ Write concise prompts
☐ Load only needed context
☐ Enable caching
☐ Set session reset
☐ Set budget alerts
Common Mistakes
❌ Using GPT-4 for everything ✅ Use MiniMax for 90% of tasks
❌ Long prompts with filler ✅ Get to the point
❌ Full context always loaded ✅ Load only relevant sections
❌ No caching ✅ Cache summaries and lookups
Exercise
This week: 1. Check your token usage: openclaw usage
2. Identify most expensive tasks
3. Switch to cheaper models where possible
4. Optimize top 3 prompts
Summary
· ✅ Select right model
· ✅ Write concise prompts
· ✅ Manage context
· ✅ Enable caching
· ✅ Optimize sessions
· ✅ Set budget alerts