Memory Config
zilliztech/memsearch
Diagnose and configure MemSearch memory behavior. An agent skill from zilliztech/memsearch.
Smart cost optimization skill for OpenClaw. An agent skill from LeoYeAI/openclaw-master-skills.
$ npx skills add LeoYeAI/openclaw-master-skills --skill cost-optimizer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills cost-optimizer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/open-optimise .claude/skills/cost-optimizer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "cost-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/open-optimise into .claude/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/open-optimiseType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add LeoYeAI/openclaw-master-skills --skill cost-optimizer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills cost-optimizer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/open-optimise .agents/skills/cost-optimizer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "cost-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/open-optimise into .agents/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill cost-optimizer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills cost-optimizer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/open-optimise .cursor/skills/cost-optimizer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "cost-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/open-optimise into .cursor/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/LeoYeAI/openclaw-master-skills.git --path skills/open-optimise--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add LeoYeAI/openclaw-master-skills --skill cost-optimizer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills cost-optimizer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/open-optimise .gemini/skills/cost-optimizer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "cost-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/open-optimise into .gemini/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install LeoYeAI/openclaw-master-skills cost-optimizerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add LeoYeAI/openclaw-master-skills --skill cost-optimizer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/open-optimise .github/skills/cost-optimizer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "cost-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/open-optimise into .github/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add LeoYeAI/openclaw-master-skills --skill cost-optimizer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install LeoYeAI/openclaw-master-skills cost-optimizer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/open-optimise .opencode/skills/cost-optimizer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "cost-optimizer" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/open-optimise into .opencode/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
cost-optimizerSmart cost optimization skill for OpenClaw. An agent skill from LeoYeAI/openclaw-master-skills.
Cost Optimizer is an agent skill from LeoYeAI/openclaw-master-skills. Smart cost optimization skill for OpenClaw. Reduces API costs by 70-97% through intelligent model routing, session management, output efficiency, and free model usage. Includes 29 executable scripts for auditing, monitoring, backup/restore, health checks, and automated reporting. Walks user through setup on first activation.
Its SKILL.md is about 7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 43 other files, including scripts and reference files (for example `CHANGELOG.md`, `GUIDE.md` and `README.md`).
It sits in AI & LLM Engineering, covering Model routing and gateways and Authentication. It works with DeepSeek. The repository describes itself as: 🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai. The licence is MIT.
3 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit e5199b5. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 6 files in scripts/ (Shell, from the files we listed), which the agent can run.
Shell commands in SKILL.md call:
bashFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Cost Optimizer loads about 7k tokens when it runs, and up to ~8.1k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 3,622 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from LeoYeAI/openclaw-master-skills at commit e5199b5, republished under its MIT licence (© LeoYeAI). 3,622 words, ~6,966 tokens.
.claude/skills/cost-optimizer/SKILL.md (or your agent's skills folder). This skill also uses 40 other files; get the full folder from GitHub.This skill helps reduce your OpenClaw API costs by 70-97% through intelligent model routing, session management, and response efficiency.
New to this skill? Read
GUIDE.mdfor installation instructions, requirements, example outputs from every script, and common workflows.
| Category | Files | Purpose |
|---|---|---|
| Agent instructions | SKILL.md (this file) | 13 chapters of cost optimization logic |
| User guide | GUIDE.md | Requirements, installation, example outputs, workflows |
| References | references/ (2 files) | Model pricing card, config templates |
| Scripts | scripts/ (29 files) | Audit, monitor, backup, health check, reporting |
| Presets | presets/ (5 files) | Ready-to-apply configs: solo-coder, writer, researcher, zero-budget, agency-team |
| Metadata | VERSION, CHANGELOG.md | Version tracking and update history |
# Install
cd ~/.openclaw/workspace/skills/
unzip cost-optimizer.zip
chmod +x cost-optimizer/scripts/*.sh
# Audit current costs
bash cost-optimizer/scripts/cost-audit.sh
# Interactive setup
Tell your agent: /cost-setupWhen this skill is first activated or user says "/cost-setup", walk through these steps. Ask permission at each step before making changes:
Step 1: Budget Target Ask: "What's your monthly budget target? Options: Ultra-low ($0-5/mo), Low ($5-30/mo), Medium ($30-100/mo), Flexible (no hard limit but minimize waste)" Save their answer to memory/cost-preferences.md
Step 2: Free Models Ask: "Want me to add free OpenRouter models to your config? These cost $0.00 per request and handle 60-80% of simple tasks well. I'll add: DeepSeek V3 Free, Llama 4 Scout Free, Qwen 3 Free, Gemma 3 Free, Mistral Small Free. Approve? (yes/no)" If yes: add the free models to config with aliases
Step 3: Default Model Ask: "Your current default model is [current model]. Want me to switch your default to MiniMax M2.5 ($0.04/request) or DeepSeek V3.2 ($0.04/request)? This alone saves 73-94% vs Opus/Sonnet. Options: minimax / deepseek / keep current" If they choose: update model.primary
Step 4: Heartbeat Optimization Ask: "Heartbeats keep your agent alive but cost money on expensive models. Want me to route heartbeats to a free model at 55-minute intervals? This saves $7-562/month depending on your current setup. Approve? (yes/no)" If yes: set heartbeat model to free, interval 55m
Step 5: Session Management Ask: "Want me to enable aggressive memory flush before compaction? This prevents context bloat and saves 10-30% on long sessions. Approve? (yes/no)" If yes: enable memoryFlush with threshold 3000
Step 6: Response Style Ask: "In cost-conscious mode, should I: (a) Always be concise to save tokens, (b) Be concise by default but go detailed when you ask, or (c) Keep my normal response style?" Save preference to memory/cost-preferences.md
After setup, confirm: "Cost optimizer configured. Here's your estimated monthly cost: ~$X based on [usage estimate]. Use /cost-status anytime to check, /cost-setup to reconfigure."
When this skill is active and user hasn't overridden with [name], suggest the cheapest adequate model for each task.
Every OpenClaw request sends approximately 140,000 tokens of fixed overhead (system prompt, tool schemas, context). This overhead is the dominant cost. What it costs depends entirely on which model processes it:
| Model Tier | Overhead Cost | Per Request | Monthly (50 q/day) |
|---|---|---|---|
| Free models | $0.00 | $0.00 | $0.00 |
| Budget (MiniMax/DeepSeek) | ~$0.04 | ~$0.04 | ~$60 |
| Mid (Haiku) | ~$0.14 | ~$0.15 | ~$225 |
| Quality (Sonnet) | ~$0.42 | ~$0.43 | ~$645 |
| Premium (Opus) | ~$0.70 | ~$0.71 | ~$1,065 |
A simple question costs $0.71 on Opus and $0.00 on a free model. The answer quality for simple factual questions is nearly identical. Model selection is the single biggest cost lever.
These are your first choice for tasks that don't need premium quality:
| Alias | Model | Context | Good For |
|---|---|---|---|
| deepseek-free | DeepSeek V3 Free | 164K | Best free model overall. Coding, reasoning, general tasks. |
| llama-free | Llama 4 Scout Free | 512K | Largest context window. Research, long docs. |
| qwen-free | Qwen 3 235B Free | 40K | Multilingual and translation tasks. |
| mistral-free | Mistral Small 3.1 Free | 96K | Quick short answers. Classification. |
| gemma-free | Gemma 3 27B Free | 96K | Reliable fallback. |
If one free model is rate-limited, try the next: deepseek-free, llama-free, qwen-free, mistral-free, gemma-free
| Alias | Model | Cost/req | Good For |
|---|---|---|---|
| nano | GPT-5 Nano | ~$0.01 | Simplest tasks when free models are down |
| flashlite | Gemini Flash-Lite | ~$0.01 | Cron jobs, heartbeats |
| deepseek | DeepSeek V3.2 | ~$0.04 | Coding daily driver |
| minimax | MiniMax M2.5 | ~$0.04 | General daily driver (recommended default) |
| kimi | Kimi K2.5 | ~$0.07 | Long sessions — auto-caching drops to ~$0.02 after warmup |
| glm | GLM-5 | ~$0.14 | Complex architecture-level coding |
| Alias | Model | Cost/req | Good For |
|---|---|---|---|
| haiku | Claude Haiku 4.5 | ~$0.15 | Mid-tier quality work |
| sonnet | Claude Sonnet 4.6 | ~$0.53 | Quality writing, code review, final polish |
| Alias | Model | Cost/req | Good For |
|---|---|---|---|
| opus | Claude Opus 4.6 | ~$0.71 | Maximum reasoning power |
| gpt5 | GPT-5 | ~$0.44 | Complex multi-domain tasks |
Use premium only when user explicitly requests or task genuinely requires it.
When this skill is active, use this decision process to suggest the best model for each task:
Simple tasks — try free first: Factual questions, brainstorming, lists, first drafts, explanations, summaries, simple code, formatting, translations, yes/no questions, code scaffolds Suggest: "I can handle this on [free model] at $0.00. Want me to proceed?" If user hasn't set a preference yet, ask the first time. After that, follow their preference from setup.
Standard work — use budget models: General questions needing reliable quality, coding tasks, analysis Use the configured default (minimax or deepseek at ~$0.04)
Long reasoning sessions: Multi-turn analysis, complex problem-solving Suggest kimi ($0.07 first request, ~$0.02 after due to auto-caching)
Complex coding: Systems architecture, difficult debugging Suggest glm ($0.14) — only when task is genuinely complex
Quality output for external sharing: Final versions of writing, thorough code reviews, research synthesis Suggest doing research/gathering on budget model first, then switching to sonnet ($0.53) for the final output only. Ask: "Draft complete. Want me to polish on Sonnet (~$0.53) or is this good enough?"
Premium reasoning:
Never auto-select opus. Instead ask: "This seems to need deep reasoning. Want me to use Opus ($0.71/request) or try Sonnet first ($0.53)?"
User override: If user says /model [alias], use that model. No questions. Resume smart routing after /reset or /model auto.
When the user chose concise mode during setup, follow these guidelines to reduce output tokens:
| Task Type | Target Length | Example |
|---|---|---|
| Yes/No questions | 1-2 sentences | Direct answer with brief reason |
| Factual lookups | 1-3 sentences | The answer, sourced if relevant |
| Simple Q&A | Short paragraph | Answer first, brief context |
| Explanations | 2-3 paragraphs | Structured, no padding |
| Code snippets | Code + 1-line comment | No narration unless asked |
| Full functions | Code + minimal comments | Explain only tricky parts |
| Analysis | Structured bullets | Key findings, not essays |
Reducing average response from 800 tokens to 300 tokens saves:
Long sessions cost more because every old message gets re-sent with each new request on top of the 140K base overhead.
| Session Length | Extra Context | Extra Cost per Request (MiniMax) | Extra Cost per Request (Sonnet) |
|---|---|---|---|
| 5 exchanges | ~2,500 tokens | +$0.001 | +$0.008 |
| 10 exchanges | ~5,000 tokens | +$0.002 | +$0.015 |
| 20 exchanges | ~15,000 tokens | +$0.005 | +$0.045 |
| 50 exchanges | ~50,000 tokens | +$0.015 | +$0.150 |
| 100 exchanges | ~150,000 tokens | +$0.045 | +$0.450 |
At 100 exchanges, every request costs roughly triple its base price.
Before every reset, provide a brief summary so nothing is lost:
"Session summary:
To slow context growth within a session:
For important facts that should persist across sessions:
Each tool call triggers a full model roundtrip with the entire context window. On MiniMax that costs ~$0.04+ per call. On Sonnet it costs ~$0.43+ per call.
Before making any tool call, consider:
Can I answer from existing knowledge? Many questions don't need a tool call. If you're 90%+ confident in the answer, provide it and offer to verify: "I believe X is the case. Want me to confirm with a lookup?"
Did I already retrieve this data? If the same or similar data was fetched earlier in the session, use the cached result instead of re-fetching.
Can I batch this with other calls? If multiple pieces of related data are needed, try to get them in fewer calls rather than one call per data point.
Will the user need follow-up data? If so, fetch slightly broader data now to avoid additional calls later.
Is there a lighter tool option? Use the simplest tool that gets the job done.
Raw tool output is often thousands of tokens. Always compress it:
Each subagent spawns a separate request that carries the full system prompt overhead.
| Configuration | Base Overhead Cost (MiniMax) |
|---|---|
| Main agent only | ~$0.04 |
| Main + 1 subagent | ~$0.08 |
| Main + 2 subagents | ~$0.12 |
| Main + 4 subagents | ~$0.20 |
The ~140K base overhead per request is partially reducible. Small reductions compound significantly over hundreds of daily requests.
Unused tools (highest impact): Each tool schema adds approximately 200 tokens to every request. If you have 20 tools but only use 10, the other 10 waste ~2,000 tokens per request.
Instructions that belong in skills: Content in system.md loads on every single request. Skills only load when activated. If you have instructions that are only relevant sometimes (code review guidelines, writing style rules, specific workflows), moving them to skills reduces base overhead.
Verbose tool descriptions: Many tool descriptions are unnecessarily long. Compressing them saves tokens on every request. Before: "This tool searches the web using the Google Custom Search API and returns results in JSON format including titles, URLs, snippets, and metadata" After: "Web search. Returns title, URL, snippet per result." Savings: ~30 tokens per tool x number of verbose tools
Personality file trimming: If personality instructions are long (2000+ tokens), consider trimming to essentials. The personality is sent with every request.
If the user asks to optimize their system prompt, offer to:
Always ask permission before making any changes to system.md or tool configuration.
For complex tasks that involve multiple steps, using cheaper models for early phases and reserving expensive models for the final output saves significantly.
| Phase | Suggested Model | Cost |
|---|---|---|
| Web searches and data gathering | Free model or minimax | $0.00-0.04 per call |
| Organizing and structuring data | Free model | $0.00 |
| Writing the synthesis | minimax | $0.04 |
| Final polish (if user wants) | sonnet | $0.53 |
Total: $0.04-0.57 compared to doing everything on Sonnet: $2-4+
| Phase | Suggested Model | Cost |
|---|---|---|
| Scaffolding and boilerplate | Free model | $0.00 |
| Core logic implementation | deepseek or minimax | $0.04 |
| Debugging and testing | deepseek or minimax | $0.04 |
| Architecture review (if complex) | glm | $0.14 |
Total: $0.04-0.22 compared to doing everything on Sonnet: $1.50-2.50+
| Phase | Suggested Model | Cost |
|---|---|---|
| Outline and structure | Free model | $0.00 |
| First draft | minimax | $0.04 |
| Editing and polish (if sharing externally) | sonnet | $0.53 |
Total: $0.04-0.57 compared to doing everything on Sonnet: $1-2+
After completing the draft/gathering phase, ask: "Draft complete on [current model]. Want me to polish this on Sonnet (~$0.53) or is this version good enough?"
Let the user decide whether the polish phase is worth the cost.
Prompt caching can dramatically reduce the effective cost of the 140K base overhead.
Anthropic models (Claude): The system prompt and tool schemas are automatically cached. Subsequent requests within the cache window pay only 10% of the normal input price for cached tokens. A heartbeat every 55 minutes keeps this cache warm.
Kimi K2.5 auto-caching: Kimi K2.5 has built-in context caching that drops repeat input costs from $0.50/M to $0.13/M — a 75% discount. This means:
Stay on one model within a session. Switching models invalidates the prompt cache. Every switch means re-paying full price for the 140K base overhead.
Cluster similar work together. Do all coding tasks, then all writing tasks, then all research. This keeps the same model cached throughout each cluster.
Don't re-fetch data. If you retrieved information from a tool, remember it. Re-fetching wastes both the tool call cost and the cache benefit.
For long reasoning sessions, use Kimi. Its auto-caching compounds — the longer you stay, the cheaper each request becomes.
The 55-minute heartbeat matters. It keeps the Anthropic prompt cache warm so your next real request gets the 90% discount on base overhead.
Heartbeats keep the agent session alive. If configured to use an expensive model, they silently drain budget 24/7:
During setup, this skill configures heartbeats to use a free model. If the user reports heartbeats still costing money (known bug in some versions), suggest the cron workaround: "Set up a cron job that pings every 55 minutes with an isolated session instead of using the built-in heartbeat system."
If the user tends to send many simple questions one at a time, suggest batching: "If you have several questions on this topic, listing them all in one message saves money — each separate message pays the full 140K overhead again."
After completing multi-step or expensive operations, briefly note the approximate cost: "Done. Used minimax for research + sonnet for synthesis. Estimated cost: ~$0.57"
Don't announce cost on simple single-request tasks — that would be annoying.
Based on the budget target set during setup:
Watch for these patterns and intervene:
When this skill is active, respond to these commands:
| Command | Action |
|---|---|
| /cost-setup | Run the full setup flow, asking permission at each step |
| /cost-status | Show current model, session stats, estimated costs |
| /cost-audit | Audit current configuration and suggest optimizations |
| /cost-trim | Analyze system prompt and suggest reductions |
| /free | Switch to free-only mode ($0.00 per request) |
| /free off | Return to normal smart routing |
| Resume smart routing after a manual model override | |
| /model [alias] | Switch to specific model (overrides smart routing until reset) |
| /reset | Clear session context (provide summary first) |
When user asks for cost status, provide:
When user asks for an audit, analyze and report:
When this skill is shared with another OpenClaw user, include these instructions:
| Your Current Setup | Estimated Monthly Cost | With This Skill | Savings |
|---|---|---|---|
| Opus for everything | ~$1,000-2,500 | ~$0-30 | 97-100% |
| Sonnet for everything | ~$500-800 | ~$0-30 | 94-100% |
| MiniMax default, no free models | ~$60-80 | ~$0-15 | 75-100% |
| Already optimized | ~$30-60 | ~$0-10 | 50-100% |
When the user asks to run any cost optimization task, use the appropriate script from scripts/. All paths are relative to the skill directory.
scripts/backup-config.sh [config] [label] — Snapshot config before changesscripts/restore-config.sh [backup|"latest"] — Restore from backup, restart gatewayscripts/fallback-validator.sh [config] — Test every model in fallback chain with real API callsscripts/cost-audit.sh [config] — Full config analysis, monthly estimate, recommendationsscripts/heartbeat-cost.sh [log] [days] — Isolate heartbeat spending from real usagescripts/cost-history.sh [log] [days] — Recalculate past usage across all model tiersscripts/session-replay.sh <session|"latest"> [log] — Per-exchange cost breakdownscripts/provider-compare.sh [config] — Detect same model across providers, find cheapestscripts/tool-audit.sh [log] [days] — Find unused tools and duplicate callsscripts/token-counter.sh [workspace] — Count system prompt overhead per filescripts/context-monitor.sh [log] — Track context growth, predict compactionscripts/prompt-tracker.sh [workspace] [--snapshot|--report] — Track prompt size over timescripts/compaction-log.sh [log] [days] — Track compaction and memory flush eventsscripts/dedup-detector.sh [log] [days] — Find redundant requests and tool callsscripts/apply-preset.sh <free|budget|balanced|quality> [--dry-run] — One-command presetsscripts/token-enforcer.sh <config> <strict|moderate|normal|generous|unlimited> [--dry-run] — Set maxTokens limitsscripts/config-diff.sh [config] — Current vs recommended side-by-sidescripts/idle-sleep.sh [log] [idle-hours] [sleep-interval] — Auto-sleep during idle periodsscripts/setup-openrouter.sh <api-key> — Generate OpenRouter provider configscripts/cost-monitor.sh [log] [--live] — Real-time spend trackingscripts/cost-dashboard.js [config] [output.html] — HTML cost dashboardscripts/webhook-report.sh <url> [discord|slack|generic] — Send reports to webhooksscripts/cron-setup.sh — Generate cron job templates for automated monitoringscripts/model-switcher.sh [config] — All models: status + cost + strengthscripts/provider-health.sh [config] — Test all models: UP/DOWN/SLOW + latencyscripts/model-test.sh [config] — Basic reachability testscripts/preset-manager.sh <export|import|list> — Export/import named presetsscripts/multi-instance.sh [instances-config] — Aggregate costs across instancesscripts/parse-config.js <config> <dot.path> [default] — JSON5 config parser (dependency)When running scripts, resolve paths relative to the skill directory:
bash /path/to/skills/cost-optimizer/scripts/cost-audit.shThis skill operates on these principles:
© LeoYeAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 40 other files (scripts, references) in skills/open-optimise of LeoYeAI/openclaw-master-skills.
Open the folder on GitHubat commit e5199b5
Cost Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Cost Optimizer this skillLeoYeAI/openclaw-master-skills | 2.2k | — | ~7k | Automated safety check: Pass | MIT | |
| Memory Configzilliztech/memsearch | 2.7k | — | ~2.9k | Automated safety check: Pass | MIT | |
| New Providerfinch-xu/cc-router | 276 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Configuring Visionoxbshw/watch-skill | 470 | — | ~509 | Automated safety check: Notes | MIT | |
| ClawRouter LLM GatewayBlockRunAI/ClawRouter | 6.6k | — | ~6.8k | Automated safety check: Pass | MIT | |
| LLM Council on Fireworks AIdair-ai/dair-academy-plugins | 614 | — | ~5k | Automated safety check: Notes | MIT |
zilliztech/memsearch
Diagnose and configure MemSearch memory behavior. An agent skill from zilliztech/memsearch.
finch-xu/cc-router
用于在 cc-router 仓库新增一个 LLM provider(即在 src-tauri/providers/ 下添加 YAML 描述符并完成配套的同步改动)。当用户说「加 provider」「接入 XX 厂商」「新增订阅源」「provider YAML」「让 cc-router 支持 OpenRouter/Together/Groq/Ollama 之类」时必须触发本…
oxbshw/watch-skill
The user wants to connect an LLM or vision provider, already has an API key, asks "can I use OpenAI/Anthropic/Gemini/OpenRouter", wants local Ollama, or needs different cheap and strong models.
BlockRunAI/ClawRouter
Describes ClawRouter, a local proxy that forwards each LLM request to the blockrun.ai gateway, which routes to a cheaper capable model, paid by USDC wallet or API key credit.
dair-ai/dair-academy-plugins
Has several open-weight models answer a question, rank each other's anonymized answers, then lets a chairman model write the final response through Fireworks AI.
jamesrochabrun/skills
This skill should be used when users want to route LLM requests to different AI providers (OpenAI, Grok/xAI, Groq, DeepSeek, OpenRouter) using SwiftOpenAI-CLI.
LeoYeAI/openclaw-master-skills
Manages pipelines on a DevOps quality and efficiency platform through its OpenAPI: list workspaces and templates, create, update, run and cancel pipelines, and read run records.
LeoYeAI/openclaw-master-skills
Patches OpenClaw's Feishu extension so an edited document triggers an isolated agent session that reads the doc and replies inline, turning it into a live chat space.
LeoYeAI/openclaw-master-skills
Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation.
LeoYeAI/openclaw-master-skills
Runs a brand's AI-search visibility work end to end: diagnosing how AI platforms represent it, repositioning it, producing AI-optimized content and monitoring ongoing mentions.
LeoYeAI/openclaw-master-skills
Installs and authenticates the gws CLI, then automates Gmail, Drive, Sheets, Calendar, Docs, Chat and Tasks with ready-made recipes, persona bundles and security audits.
LeoYeAI/openclaw-master-skills
Runs four advisor roles, a fitness coach, nutritionist, data analyst and TCM practitioner, to build a health profile and track workouts, diet and wellness over time.
Works with
Categories
Smart cost optimization skill for OpenClaw. An agent skill from LeoYeAI/openclaw-master-skills. Cost Optimizer is an agent skill from LeoYeAI/openclaw-master-skills. Smart cost optimization skill for OpenClaw.
Cost Optimizer fits situations like: tasks that involve Model routing and gateways; tasks that involve Authentication.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill cost-optimizer -a claude-code`. Or copy the skill folder (skills/open-optimise in LeoYeAI/openclaw-master-skills) into .claude/skills/cost-optimizer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill cost-optimizer -a codex`. Or copy the skill folder (skills/open-optimise in LeoYeAI/openclaw-master-skills) into .agents/skills/cost-optimizer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LeoYeAI/openclaw-master-skills --skill cost-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cost-optimizer, .gemini/skills/cost-optimizer, .github/skills/cost-optimizer and .opencode/skills/cost-optimizer in your project.
Going by SKILL.md and its folder, Cost Optimizer needs a shell for the scripts in its folder and the command-line tools its instructions call (bash). Our summary lists: Node.js; A Bash shell.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Cost Optimizer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 7k tokens (SKILL.md is roughly 28k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Cost Optimizer: Memory Config (zilliztech/memsearch, 2.7k stars), New Provider (finch-xu/cc-router, 276 stars), Configuring Vision (oxbshw/watch-skill, 470 stars) and ClawRouter LLM Gateway (BlockRunAI/ClawRouter, 6.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
LeoYeAI (a GitHub user) maintains it in LeoYeAI/openclaw-master-skills, which has 2,161 GitHub stars. The repository holds 1,235 skills in this directory. The repository was last updated on July 20, 2026.
Source: LeoYeAI/openclaw-master-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.