model-routing

model-routing is a skill for Claude Code from frankxai/claude-skills-library. It costs 58 tokens per session (2,103 once invoked), scanned A, original, MIT.

A model-selection system that chooses between Haiku, Sonnet, and Opus based on how difficult a task is.

In plain words
What is it for?
It is for choosing models, optimizing cost and quality, and building a tiered routing layer.
Why use it?
It helps balance answer quality, response speed, and cost instead of using the same model for every task.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the claude-skills-library plugin — 114 skills shipped together

Good fit It is for choosing models, optimizing cost and quality, and building a tiered routing layer.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/frankxai/claude-skills-library/model-routing
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 frankxai/claude-skills-library --skill model-routing
Clone the repo
git clone --depth 1 https://github.com/frankxai/claude-skills-library

Made for: Claude Code.

Or install claude-skills-library, the plugin that ships this one along with the rest of its 114 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/frankxai/claude-skills-library/model-routing/github.svg)](https://agentmods.dev/skills/frankxai/claude-skills-library/model-routing)
Your own site
<a href="https://agentmods.dev/skills/frankxai/claude-skills-library/model-routing"><img src="https://agentmods.dev/badge/skills/frankxai/claude-skills-library/model-routing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for model-routing

Your own site · 80×15
<a href="https://agentmods.dev/skills/frankxai/claude-skills-library/model-routing"><img src="https://agentmods.dev/badge/skills/frankxai/claude-skills-library/model-routing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,103 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.
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.00058 $0.02103
Opus 5.5 $0.00023 $0.00841
Sonnet 5.5 $0.00012 $0.00421
Haiku 4.5 $0.00006 $0.00210

Measured 1mo ago against content hash 397722720ac9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

model-routing 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 1mo 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.

free-skills/model-routing/SKILL.md · 205 lines

How it starts

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

Model Routing System

You have access to intelligent model routing. Before executing any task, analyze complexity and route to the appropriate model tier.

Current model IDs and pricing — Last verified: 2026-08-28. Re-verify at platform.claude.com before trusting these again; they have moved more than once in 2026. Haiku → claude-haiku-4-5 ($1.00 / $5.00 per 1M input/output) · Sonnet → claude-sonnet-5 ($2.00 / $10.00) · Opus → claude-opus-5 ($5.00 / $25.00, default). For the hardest long-horizon reasoning, escalate above Opus to claude-fable-5 ($10.00 / $50.00 — most capable; thinking is always on, no disabling it; reserve for genuinely demanding work). Model IDs are complete as written — never append a date suffix. The tiers below are model-agnostic.

Routing Decision Matrix

TASK COMPLEXITY ANALYSIS
────────────────────────────────────────────────────────────────

HAIKU (Fast, Cheap) - claude-haiku-4-5 - Use for:
├── Simple file operations (read, list, navigate)
├── Scaffolding and boilerplate generation
├── Deterministic transformations (format, lint, compile)
├── Status checks and health monitoring
├── SEO metadata generation
├── Deployment commands (after code is written)
├── Documentation formatting
├── Simple search and replace
│
│   Token cost: $1.00/1M input, $5.00/1M output
│   Latency: Fastest
│   Use when: Task has clear, unambiguous steps

SONNET (Balanced) - claude-sonnet-5 - Use for:
├── Feature implementation (standard complexity)
├── Bug fixes requiring analysis
├── Content writing (articles, social posts)
├── Code review and quality checks
├── Test generation
├── Refactoring with clear patterns
├── API integration work
├── Database schema design
│
│   Token cost: $2.00/1M input, $10.00/1M output
│   Latency: Medium
│   Use when: Task requires reasoning but not deep strategy

OPUS (Strategic, Complex) - claude-opus-5 - Use for:
├── Architecture decisions (system design)
├── Multi-agent coordination (council, swarm)
├── Strategic planning (business, product)
├── Complex debugging (multi-file, subtle bugs)
├── Security audits and vulnerability analysis
├── Enterprise AI system design
├── Book writing (narrative, character development)
├── Research synthesis (multiple sources)
├── Ambiguous requirements interpretation
│
│   Token cost: $5.00/1M input, $25.00/1M output
│   Latency: Slower; most capable of the routine tiers
│   Use when: Task requires deep reasoning, creativity, or strategy

FABLE (Hardest, escalation only) - claude-fable-5 - Use for:
├── Long-horizon agentic work where Opus already fell short
├── The single hardest step in an otherwise-Opus-routed task
│
│   Token cost: $10.00/1M input, $50.00/1M output
│   Latency: Slowest; thinking is always on (cannot be disabled)
│   Use when: Opus-tier reasoning wasn't enough — this is a ceiling, not a starting point

Read the full file on GitHub · 205 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago Changed · +36 lines 397722720ac9
  2. 1mo ago First seen · 169 lines · 58 tokens per session scan A 41969fd94759

Subscribe to this mod's changes

model-routing is a skill published in the GitHub repository frankxai/claude-skills-library (47 stars, last pushed today), licensed MIT. It adds 58 tokens to every session and 2,103 once invoked, about $0.0002 per session on Opus 5.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

token-saver

Token optimization guide for Claude Code. This skill should be used when the user wants to reduce API costs, learn model routing strategies, or understand how to use free/cheaper tools (Ollama, Haiku) instead of burning expensive Claude tokens on routine tasks. Triggers on: save tokens, reduce costs, token tips, cheap…

chidekina/aria-superpowers · 85 tokens

wayfinder

A planning method that maps a large, uncertain project into linked decision tickets in a repository's issue tracker. An issue tracker is a system for recording and organizing project work.

vinvcn/mattpocock-skills-zh-CN · 40 tokens

scaffold-exercises

A directory scaffold for course exercises, with sections, exercise folders, and optional problem, solution, or explanation versions. It creates the required Markdown files and checks the result with the repository's linter.

vinvcn/mattpocock-skills-zh-CN · 46 tokens

domain-modeling

A practice for building and maintaining a project’s domain model: the shared terms, concrete scenarios, and recorded architecture decisions that describe what the software is about.

vinvcn/mattpocock-skills-zh-CN · 38 tokens

migrate-to-shoehorn

A testing guide for Shoehorn, a TypeScript library that lets tests provide only the fields they need from a larger data type.

vinvcn/mattpocock-skills-zh-CN · 53 tokens

ask-matt

A skill router that helps choose the right workflow or skill for the current task. It maps work from an initial idea through building and shipping, with separate paths for research, prototypes, and multi-session projects.

vinvcn/mattpocock-skills-zh-CN · 28 tokens