Model Switch
Agent Buildingmodel-switchModel Switch is an Agent Skill for agent building published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Switch the agent's model at runtime and restart. Use when the user asks to change models (e.g., "switch to kimi", "use opus", "go cheaper"), or when the agent decides a different model is better for the current workload.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/ai-llm/model-switch/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/model-switch, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Model Switch
Overview
This skill switches the agent's primary model by patching the gateway config and letting the gateway auto-restart. Use it when a user explicitly requests a model change or when you determine a different model is better suited for the task (cost, speed, quality).
Workflow
1) Trigger
- User asks to change models ("switch to X", "use opus", "go cheaper")
- Or you decide a different model is better for the current workload
2) Map alias → full model ID
Use the reference table below to resolve common aliases. If the alias is unknown, ask for clarification or the exact model ID.
3) Patch gateway config
Update the primary model:
gateway config.patch→agents.defaults.model.primary = <full_model_id>
4) Gateway restarts automatically
No manual restart needed.
5) Confirm to the user
Confirm the model switch in plain language.
Reference: Known Model Aliases
| Alias | Full model ID |
|---|---|
| opus | anthropic/claude-opus-4-5 |
| sonnet | anthropic/claude-sonnet-4-5 |
| kimi | nvidia-build/moonshotai/kimi-k2.5 |
| codex | github-copilot/gpt-5.2-codex |
Notes
- Context resets after restart. Warn the user if the switch happens mid-conversation.
- Per-session override (no restart): You can use the
session_statustool with themodelparameter to override the model for a single session without changing defaults.