Need help optimizing your OpenClaw token usage costs? This Skill will guide you through three powerful optimization techniques to dramatically reduce token consumption.
Based on real-world case studies, applying these optimization techniques can reduce token consumption from $200+/day to $10/day, achieving a 95%+ cost reduction.
/new - Start a fresh conversation and clear old context (saves 50,000+ tokens)/compress - Compress memory by keeping important info and forgetting details (saves 30,000+ tokens)/stop - Immediately stop current task to prevent further token consumption/restart - Restart the system to clear lag and resolve issuesCore Philosophy: AI is your brain, not your hands
Automate with scripts instead of using the model for mechanical tasks:
Use premium models for complex tasks, budget models for simple ones
ComplexityRecommended ModelCostUse CasesSavings🔴 HighGPT-4 / Claude$0.03/1k tokensCode generation, creative writing, complex reasoningBaseline🟡 MediumGPT-3.5-Turbo / Ernie$0.0005/1k tokensGeneral tasks, text editing98%🟢 LowQwen, Tongyi (Budget Models)$0.00001/1k tokensData processing, report generation, formatting99.97%
Problem: Model checks emails every 5 minutes
ApproachMonthly Cost❌ Model Polling**$100+/month**✅ Script + AI Notification**<$1/monthSavings99%**
Scenario: Generate reports every 30 minutes (2000 tokens/call)
ModelDaily CostMonthly CostSavingsGPT-4$2.88$86BaselineGPT-3.5$0.048$1.4498%Qwen$0.001$0.0399.97%
Scenario: After many conversations, memory.md has grown to hundreds of thousands of characters
Solution:
/compress commandResult: Reduced context loading on each turn, saves 30,000+ tokens
Scenario: Need to check for new orders every hour
Wrong Approach:
text
Have model check orders API every hour
→ Model must understand and judge each time
→ 24 checks per day = huge costs
Correct Approach:
text
Script checks order API every hour
Notify model only on new orders
Model handles decision-making only
Savings: Script uses only CPU, saves 90%+ tokens
Scenario: Handle various complexity levels
Strategy:
Result: 90% cost reduction, zero functionality loss
/compress once daily - Prevent memory bloat/new for long conversations - Start fresh after 1+ hours/stop on wrong tasks - Stop immediately to prevent wasteTask TypeModel ChoiceReasonCode generation, deep analysisGPT-4Complex tasks worth the costGeneral tasks, text editingGPT-3.5Best value propositionData processing, reportsBudget ModelsFully capable, lowest cost
Bad PracticeConsequenceSolutionUnlimited conversation historyGrowing memory = more tokensRegular /compress or /newAI polling for updatesToken burn on each checkUse scripts insteadUsing GPT-4 for simple tasksOverkill, high costUse appropriate model tierNever compressing memoryLinear token cost growthEstablish compression habitContinuing failed tasksWasted tokensUse /stop immediately
text
Total Cost = Context Consumption + Task Consumption
Optimization Formula:
New Cost = (Original Context × 30%) + (Task Cost × 20%)
= Original Cost × (0.3 + 0.2)
= Original Cost × 0.5 or lower
Combining all three techniques achieves 95%+ cost reduction.
💡 Remember: High costs don't come from AI itself, but from making it do tasks it shouldn't do and remember information it shouldn't store.
Assign the right tasks to the right tools, and AI becomes truly cost-effective.