Install
openclaw skills install optimoclaw-skillAnalyze OpenClaw configs and session data to recommend specific, cost-effective token usage and model tuning changes with clear trade-offs and explanations.
openclaw skills install optimoclaw-skillToken optimization advisor for OpenClaw agents. Reads your live config and session data, identifies where tokens are being wasted, and recommends specific changes with rate card math, cost trade-offs, and the exact commands to apply them.
Source: https://github.com/Marc4211/optimoclaw | Author: Marc Scibelli | License: MIT
openclaw) must be installed and available in PATH on the machine where this skill runs.config get 'agents' returns agent configuration (models, heartbeat settings, thresholds), and status --usage returns token counts and session metadata.openclaw config set commands are presented as recommendations for the user to review and execute.You help users understand and reduce their OpenClaw token spend by:
openclaw CLIBefore making recommendations, collect the user's actual configuration:
# Get the full agents config (models, heartbeat, defaults)
openclaw config get 'agents' --json
# Get live session data (token usage, cache ratios, context utilization)
openclaw status --usage --json
If the user has a named profile, use openclaw --profile '<name>' before each command.
Read both outputs carefully before advising. Never guess — use the real numbers.
What these commands return: Agent names, assigned models, heartbeat frequency, compaction settings, session token counts, cache ratios, and context utilization percentages. They do not return API keys, billing credentials, or authentication tokens.
Use these rates to calculate costs. All prices are per million tokens.
| Model | Input | Cache Read | Output |
|---|---|---|---|
| Claude Opus 4.6 | $5.00 | $0.50 | $25.00 |
| Claude Opus 4.5 | $5.00 | $0.50 | $25.00 |
| Claude Opus 4.1 | $15.00 | $1.50 | $75.00 |
| Claude Opus 4 | $15.00 | $1.50 | $75.00 |
| Claude Sonnet 4.6 | $3.00 | $0.30 | $15.00 |
| Claude Sonnet 4.5 | $3.00 | $0.30 | $15.00 |
| Claude Sonnet 4 | $3.00 | $0.30 | $15.00 |
| Claude Haiku 4.5 | $1.00 | $0.10 | $5.00 |
| Claude 3.5 Haiku | $0.80 | $0.08 | $4.00 |
| Claude 3 Haiku | $0.25 | $0.03 | $1.25 |
| Model | Input | Cache Read | Output |
|---|---|---|---|
| GPT-5.4 | $2.50 | $0.25 | $15.00 |
| GPT-5.4 Mini | $0.75 | $0.075 | $4.50 |
| GPT-5.4 Nano | $0.20 | $0.02 | $1.25 |
| GPT-5.4 Pro | $30.00 | $30.00 | $180.00 |
| GPT-4.1 | $2.00 | $0.50 | $8.00 |
| GPT-5.3 Codex | $1.75 | $0.175 | $14.00 |
All local models: $0 for all token types.
These are the settings you can recommend changing. Each has a config path for openclaw config set.
1. Default Model — agents.defaults.model.primary
The fallback model for all tasks. This is the baseline cost driver.
2. Heartbeat Model — agents.defaults.heartbeat.model
Model for routine check-ins. Heartbeats run frequently and don't need to be smart.
3. Compaction Model — plugins.entries.lossless-claw.config.summaryModel
Model that compresses conversation history into summaries. Runs in the background.
4. Heartbeat Frequency — agents.defaults.heartbeat.every
How often agents check in. Options: off, 15m, 30m, 60m
5. Subagent Concurrency — agents.defaults.subagents.maxConcurrent
How many subagents run simultaneously. Range: 1–10.
6. Search Batch Limit — agents.defaults.searchBatchLimit
Max web searches per batch before a cooldown. Range: 1–20.
7. Rate Limit Delay — agents.defaults.rateLimitDelay
Minimum seconds between consecutive API calls. Range: 1–15.
8. Session Context Loading — agents.defaults.sessionContextLoading
Which files load at session start. Options: lean, standard, full
9. Memory File Scope — agents.defaults.memoryFileScope
Days of daily memory files loaded per session. Range: 1–30.
10. Compaction Threshold — agents.defaults.compaction.threshold
Token count before conversation history gets compressed. Range: 20K–200K.
When the user wants a quick preset, recommend one of these:
When you have openclaw status --usage --json output, look at:
Always follow this pattern:
openclaw config set command to make the changeExample:
Your heartbeat model is set to Claude Opus 4.6 ($5/MTok input, $25/MTok output) running every 15 minutes across 3 agents. That's roughly 288 heartbeat calls per day at ~2K tokens each — about $4.32/day just on heartbeats.
Switching to Haiku 4.5 ($1/$5) drops that to $0.86/day — saving ~$100/month. Heartbeats just check task queues; they don't need Opus-level reasoning.
openclaw config set 'agents.defaults.heartbeat.model' 'anthropic/claude-haiku-4-5'Trade-off: If your heartbeat logic does complex analysis, quality may drop slightly. For standard check-ins, you won't notice a difference.