switch-modes
Switch between AI models dynamically to optimize costs and performance. Use when the user says mode commands like "eco mode", "balanced mode", "smart mode", or "max mode", or when they want to check their current mode with "/modes status" or configure modes with "/modes setup".
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- switch-modes
- license
- MIT
- metadata
- { "author": "serudda", "version": "1.0.0" }
- description
- Switch between AI models dynamically to optimize costs and performance. Use when the user says mode commands like "eco mode", "balanced mode", "smart mode", or "max mode", or when they want to check their current mode with "/modes status" or configure modes with "/modes setup".
03 SKILL.md 正文
Switch Modes
Dynamically switch between AI models to optimize costs and performance.
When to Use This Skill
Activate this skill when the user mentions:
- Mode switching commands:
eco mode,balanced mode,smart mode,max mode - Status check:
/modes status - Configuration:
/modes setup
How It Works
The skill manages 4 predefined modes, each mapped to a specific model:
- eco → Cheapest model (for summaries, quick questions)
- balanced → Daily driver model (for general work)
- smart → Powerful model (for complex reasoning)
- max → Most powerful model (for critical tasks)
Configuration is stored in ~/.openclaw/workspace/switch-modes.json.
Step-by-Step Instructions
1. Detect Mode Commands
When the user message contains any of these patterns:
eco modeoreco(standalone)balanced modeorbalancedsmart modeorsmartmax modeormax/modes status/modes setup
2. Handle Setup Command (/modes setup)
If the configuration file doesn't exist or user requests setup:
-
Use
AskUserQuestionto gather model preferences for each mode:- ECO mode: Recommend
anthropic/claude-3.5-haiku - BALANCED mode: Recommend
anthropic/claude-sonnet-4-5 - SMART mode: Recommend
anthropic/claude-opus-4-5 - MAX mode: Recommend
anthropic/claude-opus-4-6oropenai/o1-pro
- ECO mode: Recommend
-
Create/update
~/.openclaw/workspace/switch-modes.jsonwith the structure:
{
"eco": "model-id",
"balanced": "model-id",
"smart": "model-id",
"max": "model-id"
}
- Confirm setup completion to the user.
3. Handle Status Command (/modes status)
- Read the OpenClaw config at
~/.openclaw/openclaw.jsonto get current model - Read
~/.openclaw/workspace/switch-modes.jsonto get mode mappings - Determine which mode is currently active by matching the current model
- Display:
✅ Currently in [MODE] mode using [MODEL_ID]
4. Handle Mode Switch Commands
When user requests a mode switch:
-
Read configuration:
cat ~/.openclaw/workspace/switch-modes.jsonIf file doesn't exist, prompt user to run
/modes setupfirst. -
Get the target model from the config based on requested mode (eco/balanced/smart/max)
-
Update OpenClaw config:
- Read current config:
~/.openclaw/openclaw.json - Update the
modelfield with the new model ID - Write back to
~/.openclaw/openclaw.json
- Read current config:
-
Confirm to user:
✅ [MODE] mode activated Now using: [MODEL_ID]
Examples
Example 1: Mode Switch
User: eco mode
Agent: [reads switch-modes.json, gets model for "eco"]
Agent: [updates openclaw.json with new model]
Agent: ✅ ECO mode activated
Now using: anthropic/claude-3.5-haiku
Example 2: Status Check
User: /modes status
Agent: [reads openclaw.json for current model]
Agent: [reads switch-modes.json for mode mappings]
Agent: ✅ Currently in BALANCED mode using anthropic/claude-sonnet-4-5
Example 3: First Time Setup
User: /modes setup
Agent: [uses AskUserQuestion for each mode]
Agent: [creates ~/.openclaw/workspace/switch-modes.json]
Agent: ✅ Setup complete! You can now use:
- eco mode
- balanced mode
- smart mode
- max mode
File Locations
- Configuration:
~/.openclaw/workspace/switch-modes.json - OpenClaw Config:
~/.openclaw/openclaw.json - Example Config: See
example-config.jsonin skill directory
Common Edge Cases
- Config file missing: Prompt user to run
/modes setup - Invalid model ID: Show error and ask user to reconfigure that mode
- Model not available: Suggest checking API keys and model access in OpenClaw
- Ambiguous input: If just "eco" or "smart" without "mode", still treat as mode switch command
- Case insensitive: Accept "ECO MODE", "Eco Mode", "eco mode" all the same
Important Notes
- Mode switching is instant - no restart required
- Changes only affect the current session's default model
- Preserve all other settings in
openclaw.jsonwhen updating model - Always validate JSON before writing config files
- Use absolute paths:
~/.openclaw/...not relative paths
Reference
For detailed troubleshooting, supported models list, and FAQ, see ./REFERENCE.md.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.