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".
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install switch-modes或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install switch-modes⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/switch-modes/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: switch-modes 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". license: MIT metadata: author: serudda version: "1.0.0" ---
Dynamically switch between AI models to optimize costs and performance.
Activate this skill when the user mentions:
eco mode, balanced mode, smart mode, max mode/modes status/modes setupThe skill manages 4 predefined modes, each mapped to a specific model:
Configuration is stored in ~/.openclaw/workspace/switch-modes.json.
When the user message contains any of these patterns:
eco mode or eco (standalone)balanced mode or balancedsmart mode or smartmax mode or max/modes status/modes setup/modes setup)If the configuration file doesn't exist or user requests setup:
AskUserQuestion to 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-6 or openai/o1-pro
~/.openclaw/workspace/switch-modes.json with the structure:{
"eco": "model-id",
"balanced": "model-id",
"smart": "model-id",
"max": "model-id"
}
/modes status)~/.openclaw/openclaw.json to get current model~/.openclaw/workspace/switch-modes.json to get mode mappings✅ Currently in [MODE] mode using [MODEL_ID]When user requests a mode switch:
```bash cat ~/.openclaw/workspace/switch-modes.json ```
If file doesn't exist, prompt user to run /modes setup first.
- Read current config: ~/.openclaw/openclaw.json - Update the model field with the new model ID - Write back to ~/.openclaw/openclaw.json
``` ✅ [MODE] mode activated Now using: [MODEL_ID] ```
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
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
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
~/.openclaw/workspace/switch-modes.json~/.openclaw/openclaw.jsonexample-config.json in skill directory/modes setupopenclaw.json when updating model~/.openclaw/... not relative pathsFor detailed troubleshooting, supported models list, and FAQ, see ./REFERENCE.md.
安装 Switch Modes 后,可以对 AI 说这些话来触发它
Help me get started with Switch Modes
Explains what Switch Modes does, walks through the setup, and runs a quick demo based on your current project
Use Switch Modes to switch between AI models dynamically to optimize costs and performance
Invokes Switch Modes with the right parameters and returns the result directly in the conversation
What can I do with Switch Modes in my developer & devops workflow?
Lists the top use cases for Switch Modes, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/switch-modes/ 目录(个人级,所有项目可用),或 .claude/skills/switch-modes/(项目级)。重启 AI 客户端后,用 /switch-modes 主动调用,或让 AI 根据上下文自动发现并使用。
Switch Modes 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
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".
Switch Modes 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Switch Modes
Identifies repetitive steps in your workflow and sets up Switch Modes to handle them automatically