openclaw-model-switch
An agent skill by daymade, from daymade/claude-code-skills. Tags: ai, claude-code, configuration, debugging, setup.
What it does
Switch or repair the model configuration of an OpenClaw instance (e.g. Kimi k2p6 → k3): change the default model, add model definitions, and fix model-config failures — 401 "Invalid token", "No available channel / model not found", thinking-level rejections ("Thinking level X is not supported"), and config edits that don't take effect. Use whenever the user wants to switch/upgrade/rollback the OpenClaw model (切换模型/换模型/ 升级模型), or says the OpenClaw/龙虾 bot's model is misconfigured (模型配的错了), or the bot falls back / errors on LLM calls.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add daymade/claude-code-skills --skill openclaw-model-switch
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/daymade/claude-code-skills
cp -r claude-code-skills/openclaw-model-switch ~/.claude/skills/openclaw-model-switch
Safety box score
Grade C, moderate risk: 40 of 100 risk points, rated 2026-10-20. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill edits OpenClaw model config files under the user’s home directory, backs them up, and can restart the gateway. Its main risks are handling any API keys embedded in those configs, sending authenticated probe requests to remote model endpoints, and changing the active model for future turns.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 2 (moderate) | It runs a shipped Python script and can invoke `openclaw gateway restart` via `subprocess.run([...])`, which is a fixed local command but still real execution. |
| Network access | 2 (moderate) | It explicitly probes model endpoints with `curl -X POST "<baseUrl>/v1/messages"` and sends an auth token plus prompt content over the network. |
| Filesystem reach | 2 (moderate) | It reads and writes `~/.openclaw/openclaw.json`, `~/.kimi/kimi-claw/openclaw.json`, `~/.kimi_openclaw/openclaw.json`, and creates `config-backups/openclaw-*.json` copies. |
| Secrets & credentials | 2 (moderate) | The configs can contain `apiKey`, `headers`, and `env` blocks, and the script backs up the full JSON before editing, duplicating any embedded secrets. |
| Privilege & persistence | 1 (low) | It does not need sudo or global installs; the only privileged-ish action is restarting the user-level gateway with `openclaw gateway restart`. |
| Instruction hijack surface | 0 (none) | The files do not contain hidden instructions to ignore policies, fetch remote instructions, or conceal actions from the user. |
| Irreversible actions | 1 (low) | It can change `agents.defaults.model.primary` and optionally restart the gateway, altering future agent behavior, but it does not deploy, post, pay, or delete externally. |
| Transparency | 0 (none) | All shipped files are readable source text; there are no binaries, downloaded installers, or runtime-decoded blobs. |
Before installing
- Read `scripts/switch-model.py` and confirm you are okay with it backing up and rewriting `openclaw.json` under your home directory.
- Check whether your config contains API keys or sensitive headers, because the backup step copies the entire JSON file.
- If you plan to use `--restart`, verify that `openclaw gateway restart` only affects your user-level gateway on this machine.
- Run the Step-2 probe from a scratch account or test host first if you do not want your real endpoint token and prompt sent out.
Rated 2026-10-20 by an automated review of 4 files from the skill's repository.
Source
- Repository
- daymade/claude-code-skills (all skills from this repository)
- Path
- openclaw-model-switch/SKILL.md
- Branch
- main
- Updated
- 2026-09-20
Related skills
- setup-pstack — Configure which models pstack uses per role and at what reasoning budget.
- claude-skills-troubleshooting — Diagnose and resolve Claude Code plugin and skill issues.
- openclaw — Manage OpenClaw (龙虾) instance configurations.
- initialize-ai-navigation — Sets up and configures the Unity AI Navigation system — NavMesh surfaces, NavMesh agents, obstacles, links, modifiers, areas and costs.
- agents-debug — Use when your agent or environment is broken — wrong answers, errors, timeouts, tool failures, or CLI issues. Reads traces and logs to diagnose root causes.
- setup-benny — Configure Benny and prepare its triage and repro automations.