model-routing-patterns

model-routing-patterns is a skill for Claude Code from softspark/ai-toolkit. It costs 46 tokens per session (1,584 once invoked), scanned A, original, Apache-2.0.

A guide to routing work between AI models with different costs and reasoning abilities.

In plain words
What is it for?
Use it to design model selection rules, escalation paths, fallback chains, and multi-model agent workflows.
Why use it?
It helps avoid using an expensive model for simple tasks while reserving stronger models for difficult or high-stakes work.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents; positional $N argument; mentions Claude Code.

Part of the ai-toolkit plugin — 113 skills, 44 agents, 14 hooks shipped together

Good fit Use it to design model selection rules, escalation paths, fallback chains, and multi-model agent workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/softspark/ai-toolkit/model-routing-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add softspark/ai-toolkit --skill model-routing-patterns
Clone the repo
git clone --depth 1 https://github.com/softspark/ai-toolkit

Made for: Claude Code.

Or install ai-toolkit, the plugin that ships this one along with the rest of its 113 skills, 44 agents, 14 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for model-routing-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/softspark/ai-toolkit/model-routing-patterns.svg)](https://agentmods.dev/skills/softspark/ai-toolkit/model-routing-patterns)
Your own site
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/model-routing-patterns"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/model-routing-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,584 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.01584
Opus 5 $0.00023 $0.00792
Sonnet 5 $0.00009 $0.00317
Haiku 4.5 $0.00005 $0.00158

Measured 4d ago against content hash e76942e940dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

model-routing-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

app/skills/model-routing-patterns/SKILL.md · 142 lines

How it starts

The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Model Routing Patterns

Three Claude tiers. Using Opus for everything is 10-40x more expensive than it needs to be. Using Haiku for everything loses accuracy on hard tasks. The craft is routing.

Model Characteristics (2026)

Model $/1M in·out Cost (rel.) Strengths When
Haiku 4.5 $1 / $5 1x Classification, extraction, simple tools, moderation Bulk processing, triage, labels
Sonnet 5 $3 / $15 ~3x General coding, reasoning, most agent tasks Default workhorse
Opus 4.8 $5 / $25 ~5x Complex reasoning, orchestration, architecture, large context Hard, rare, high-stakes
Fable 5 $10 / $50 ~10x Most demanding long-horizon agentic work Only when explicitly chosen

Prices are per 1M tokens; ratios are approximate and shift between releases. Re-check pricing before committing a production path.

Fable 5 is not the default "best model". Its price sits above Opus-tier, and Opus 4.8 is state-of-the-art on planning/orchestration at half the input and output cost. Reach for Fable 5 only when the user explicitly asks for it or a benchmarked task genuinely needs it — for "use the strongest model", the target is claude-opus-4-8.

Effort — the cheaper lever before swapping models

On Fable 5 / Opus 4.8 / Sonnet 5, output_config.effort (low | medium | high | xhigh | max) controls thinking depth and token spend without changing the model — so it does not invalidate the prompt cache the way a mid-session model swap does. Tune effort first; drop to a cheaper model only when effort alone can't hit the cost target.

Effort Use for
low Latency-sensitive, non-intelligence-sensitive: chat, simple lookups, cheap subagents
medium Cost-conscious step-down from the default
high Default for most intelligence-sensitive work (a good quality/cost balance)
xhigh Hardest coding and agentic tasks (Claude Code's default)
max Correctness matters more than cost; test for diminishing returns

Read the full file on GitHub · 142 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 142 lines · 46 tokens per session scan A e76942e940dc

Subscribe to this mod's changes

model-routing-patterns is a skill published in the GitHub repository softspark/ai-toolkit (170 stars, last pushed today), licensed Apache-2.0. It adds 46 tokens to every session and 1,584 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

continue-gemini-explicit

Continue's Gemini provider doesn't use the cachedContents API at all. Add explicit caching for sessions over the minimum token threshold.

OnlyTerp/prompt-cache-skills · 31 tokens

roo-fix-volatile-msg

Ladder-aware Roo Code Anthropic caching — verify the rolling read/write ladder on the wire, then close the real gaps (Vertex 4-block budget, MiniMax path).

OnlyTerp/prompt-cache-skills · 42 tokens

roo-bedrock-custom-arn

Roo Code's Bedrock provider silently disables caching for custom ARNs. Populate cachableFields to fix.

OnlyTerp/prompt-cache-skills · 29 tokens

context-manager

Gestion avancée du contexte pour agents IA — fenêtre de contexte, compression, RAG dynamique, sliding window, prompt caching. Se déclenche avec "context window", "contexte agent", "token limit", "context management", "context overflow", "trop de contexte", "agent context", "context stuffing", "context compression".…

khalilbenaz/claude-skills-collection · 84 tokens

data-analyst-agent

Création d'agents d'analyse de données qui explorent, visualisent et expliquent les données. Se déclenche avec "data analyst agent", "agent analyse données", "agent data", "agent qui analyse", "automated analysis", "data exploration agent", "agent SQL", "agent pandas". Also triggers on "agent that analyzes data"…

khalilbenaz/claude-skills-collection · 81 tokens

mcp-server-builder

Création de serveurs MCP (Model Context Protocol) pour exposer des outils, ressources et prompts aux LLMs. Se déclenche avec "MCP", "Model Context Protocol", "MCP server", "MCP tool", "MCP resource", "serveur MCP", "connecter Claude à", "exposer une API à Claude", "claude desktop config". Also triggers on "build an…

khalilbenaz/claude-skills-collection · 105 tokens