routing — Claude Code skill: what it does, how to install
A skill that hands tasks to llm_router tools so cheap models take the easy work and stronger ones get the rest.
npx skills add ypollak2/llm-router --skill routing -a claude-codeWhat routing does
Instead of answering a question, a research request or a coding job itself, the agent calls the matching llm_router tool first. The router then picks the least expensive model that can do the job, going free-first: Ollama, then Codex, then paid APIs.
A table maps each task type to a tool. Plain facts go to llm_query, current events and research to llm_research, drafts and summaries to llm_generate, debugging and deep analysis to llm_analyze, code work to llm_code. When the type is unclear, llm_auto classifies the request and keeps a running total of what was saved.
Not everything gets routed. File reads and edits run directly, and prompts under five words are treated as follow-ups rather than standalone requests. Calls take a prompt argument; llm_code also accepts complexity. Savings show up automatically every five calls through llm_auto, or on demand with llm_savings.
What it helps with
- send a trivial question to a cheap model instead of an expensive one
- pull fresh facts from the web rather than stale training data
- pick a model for code generation without guessing
- track how much routing has saved
- let
llm_autoclassify the task when the type is unclear
Example prompts for the agent
- Run
llm_autoon this request: what changed in Python 3.13? - Call
llm_codewithcomplexity="moderate"to refactor this function to async/await - Use
llm_researchto find what shipped in the latest release of this library
How to install routing
1Skills CLI (Vercel)
npx skills add ypollak2/llm-router --skill routing -a claude-code2Manually: put the files in place
~/.claude/skills/routing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/routing/
1Skills CLI (Vercel)
npx skills add ypollak2/llm-router --skill routing -a codex2Manually: put the files in place
.agents/skills/routing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ypollak2/llm-router --skill routing -a cursor2Manually: put the files in place
.cursor/skills/routing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ypollak2/llm-router routing2Manually: put the files in place
.github/skills/routing/SKILL.md1Skills CLI (Vercel)
npx skills add ypollak2/llm-router --skill routing -a gemini-cli2Platform CLI
gemini skills install https://github.com/ypollak2/llm-router --path skills/routingManually: put the files in place
.devin/skills/routing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ypollak2/llm-router --skill routing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about routing
How do I install routing in Claude Code?
Run npx skills add ypollak2/llm-router --skill routing -a claude-code. The skill lands at ~/.claude/skills/routing/SKILL.md.
What does the routing skill do?
It calls an llm_router tool before the agent answers, so the request goes to the cheapest model that fits. Selection runs from free options to paid ones.
Which tasks should skip the router?
File reads and writes are handled directly by the agent. Prompts shorter than five words are not routed either, since they usually continue an earlier message.
Source text
SKILL.md · MIT
--- name: routing description: Route tasks to the cheapest capable model automatically using llm_router MCP tools trigger: /routing --- # LLM Router — Smart Routing Skill Route tasks to the cheapest capable model automatically using llm_router MCP tools. ## When to Use This Skill Before answering research, code, writing, or analysis tasks — call the appropriate llm_router tool instead of answering directly. The router picks the cheapest model that can handle the task (Ollama → Codex → paid APIs in free-first order). ## Task → Tool Mapping | Task type | Tool to call | Why | |-----------|-------------|-----| | Simple factual question | `llm_query` | Gemini Flash / Groq — 50× cheaper than o3 | | Research / current events | `llm_research` | Perplexity (web-grounded, not stale) | | Writing / summaries / brainstorm | `llm_generate` | Gemini Flash / Haiku | | Deep analysis / debugging | `llm_analyze` | GPT-4o / Gemini Pro | | Code generation / refactoring | `llm_code` | Ollama → Codex built-in → o3 | | Don't know which type | `llm_auto` | Auto-classifies + routes, tracks savings | ## How to Call ``` llm_query(prompt="What is the capital of France?") llm_code(prompt="Refactor this function to use async/await", complexity="moderate") llm_research(prompt="What changed in Python 3.13?") llm_auto(prompt="<the full user request>") # safest default ``` ## When NOT to Route - File read/write/edit operations — execute directly - Inline tool calls where you have the answer already - Tasks under 5 words (likely follow-ups, not standalone requests) ## Cost Impact Routing simple tasks to Gemini Flash instead of o3 saves ~50–100×. `llm_auto` shows cumulative savings every 5 calls automatically. Run `llm_savings` anytime to see your totals.
© ypollak2 · MIT · ypollak2/llm-router