| name | model-tiering |
| description | Automatically route and tier developer prompts across Opus, Sonnet, and Haiku based on task characteristics |
Automatic Model Tiering Skill
When to activate
- Optimizing token costs during multi-step coding agent execution.
- Dynamically allocating model weights during large refactoring runs.
- Resolving complex planning tasks before generating implementation code.
- Triggering fallback configurations when high-reasoning tasks fail on smaller models.
When NOT to use
- Fast interactive chats where switching models adds noticeable latency.
- Explicit developer model overrides (e.g.
--model sonnet).
Instructions
To route tasks dynamically, classify developer queries into one of the three following tiers:
1. The Reasoning Tier (Opus/Thinking Model)
- Scope: Large architectural changes, safety audits, complex algorithm designs, cross-cutting concerns.
- Criteria: High structural risk, requires reasoning over long context windows.
- Implementation:
def route_to_reasoning(task_ctx):
return {
"model": "claude-3-opus",
"temperature": 0.2,
"max_tokens": 4096,
"system_prompt": "Focus entirely on planning and mathematical correctness."
}
2. The Planning Tier (Sonnet)
3. The Coding Tier (Haiku)
Example
import { getTaskComplexity } from "./complexity-analyzer";
export async function executeTaskWithMoE(task: string) {
const complexity = getTaskComplexity(task);
if (complexity.score > 0.8) {
const plan = await callModel("claude-3-opus", `Plan this task: ${task}`);
const code = await callModel("claude-3-5-sonnet", `Write code for plan: ${plan}`);
return { plan, code };
} else {
return callModel("claude-3-haiku", `Write snippet: ${task}`);
}
}