
model-router
Routing table that sets model and effort for every subagent, replacing banned models at dispatch.
- GitHub stars
- 5
What it does
- Adds
/model-routerto show the routing table and the last 20 routing decisions with reasons - Routes security, unknown-cause bugs, and reviews to the strong model at high effort; builds and fixes to medium; lookups and log triage to
haiku - Keeps explicit model or effort choices from callers, and replaces banned models with the first allowed fallback
- Designed for projects that want routing rules enforced at dispatch instead of relying on CLAUDE.md instructions
Gives every subagent the right model and effort from a routing table you control: reviews, security and hard bugs on the strong model at high effort, builds and fixes at medium, lookups and log triage on the small fast model. Replaces banned models and keeps explicit choices.
Add marketplace
/plugin marketplace add ychampion/ystackRun it inside Claude Code once, then install the plugin below.
Install
/plugin install model-router@ystackRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourcemodel-router
Gives every subagent the right model and effort, so your routing rules are applied at dispatch instead of hoped for in CLAUDE.md.
| Tier | Tasks | Default |
|---|---|---|
| high | security, bugs whose cause is unknown, concurrency, parsers, edge cases, and (with reviewTier: high, the default) all review and verification | the session's model at high effort |
| medium | builds, features, refactors, tests, docs, research, fix rounds, and plain reviews with reviewTier: medium | the session's model at medium effort |
| fast | locating files and symbols, log triage, bulk classification, reshaping data, polling | haiku |
By default only effort is set for the high and medium tiers; the model stays whatever the session would give the subagent. Set strongModel to pin one.
The tier comes from keyword rules over the task's description and agent type, plus the first 600 characters of its prompt. Keywords match whole words (fix doesn't match prefix); a trailing * matches any ending (verif* matches verify and verification). The first rule that matches wins, in this order:
- Always high: security terms (secret, credential, injection, XSS, auth, permission, vulnerability, crypto...), crash, race, deadlock, flaky, regression triage, and an unknown cause ("unknown cause", "not sure why", "intermittent"). No other rule lowers these.
- Fix rounds: a fix round, a findings list, or a bug whose cause is known, is medium.
- High keywords, then medium keywords, then fast keywords. One high word beats any number of build words, and a task is fast only when nothing high or medium is in it.
A task no rule matches gets the medium tier (or is left alone, with unmatched: leave). With classifier: haiku, an unmatched task is sent once to the small fast model to pick a tier; with the default off, nothing is sent anywhere.
- Banned models: a subagent asking for one in
bannedModelsruns on the strong model instead (with none set, the first allowed model infallbackModels), and the agent that dispatched it gets a one-line note naming the model it runs on. A bannedstrongModelis replaced the same way. - Explicit choices stand: a model or effort the caller set is kept.
enforce: truemakes the table win over those, for the agent types ingenericTypes. Any other agent type always keeps its own model and effort. - Plain reviews:
reviewTier: mediumsends review, verification and audit work to medium. A review that names security, a parser, concurrency, debugging or edge cases still goes high, because those keywords are checked first. In one blind test on the same code, a medium reviewer caught as many known bugs as a high one in half the time; high went deeper on parser edge cases. /model-routershows the table and the last 20 decisions, with the reason for each.
Settings
strongModel (empty: the session's model), fastModel (haiku), highEffort (high), mediumEffort (medium), reviewTier (high), highKeywords / mediumKeywords / fastKeywords (extra comma-separated words, same * syntax), unmatched (medium), bannedModels (none), fallbackModels (opus, sonnet, haiku), genericTypes (general-purpose), enforce (off), classifier (off). Models are aliases or full ids.
Limits
Effort can be set only on Agent tool calls. Workflow agents and other plugins' spawns get the model but keep their effort. A model set in a named agent type's own definition can't be seen, so a banned model there is not replaced unless the call names it. A session setting that forces one model on every subagent outranks the router.
Readme
model-router
Gives every subagent the right model and effort, so your routing rules are applied at dispatch instead of hoped for in CLAUDE.md.
| Tier | Tasks | Default |
|---|---|---|
| high | security, bugs whose cause is unknown, concurrency, parsers, edge cases, and (with reviewTier: high, the default) all review and verification | the session's model at high effort |
| medium | builds, features, refactors, tests, docs, research, fix rounds, and plain reviews with reviewTier: medium | the session's model at medium effort |
| fast | locating files and symbols, log triage, bulk classification, reshaping data, polling | haiku |
By default only effort is set for the high and medium tiers; the model stays whatever the session would give the subagent. Set strongModel to pin one.
The tier comes from keyword rules over the task's description and agent type, plus the first 600 characters of its prompt. Keywords match whole words (fix doesn't match prefix); a trailing * matches any ending (verif* matches verify and verification). The first rule that matches wins, in this order:
- Always high: security terms (secret, credential, injection, XSS, auth, permission, vulnerability, crypto...), crash, race, deadlock, flaky, regression triage, and an unknown cause ("unknown cause", "not sure why", "intermittent"). No other rule lowers these.
- Fix rounds: a fix round, a findings list, or a bug whose cause is known, is medium.
- High keywords, then medium keywords, then fast keywords. One high word beats any number of build words, and a task is fast only when nothing high or medium is in it.
A task no rule matches gets the medium tier (or is left alone, with unmatched: leave). With classifier: haiku, an unmatched task is sent once to the small fast model to pick a tier; with the default off, nothing is sent anywhere.
- Banned models: a subagent asking for one in
bannedModelsruns on the strong model instead (with none set, the first allowed model infallbackModels), and the agent that dispatched it gets a one-line note naming the model it runs on. A bannedstrongModelis replaced the same way. - Explicit choices stand: a model or effort the caller set is kept.
enforce: truemakes the table win over those, for the agent types ingenericTypes. Any other agent type always keeps its own model and effort. - Plain reviews:
reviewTier: mediumsends review, verification and audit work to medium. A review that names security, a parser, concurrency, debugging or edge cases still goes high, because those keywords are checked first. In one blind test on the same code, a medium reviewer caught as many known bugs as a high one in half the time; high went deeper on parser edge cases. /model-routershows the table and the last 20 decisions, with the reason for each.
Settings
strongModel (empty: the session's model), fastModel (haiku), highEffort (high), mediumEffort (medium), reviewTier (high), highKeywords / mediumKeywords / fastKeywords (extra comma-separated words, same * syntax), unmatched (medium), bannedModels (none), fallbackModels (opus, sonnet, haiku), genericTypes (general-purpose), enforce (off), classifier (off). Models are aliases or full ids.
Limits
Effort can be set only on Agent tool calls. Workflow agents and other plugins' spawns get the model but keep their effort. A model set in a named agent type's own definition can't be seen, so a banned model there is not replaced unless the call names it. A session setting that forces one model on every subagent outranks the router.
Details
- Marketplace
- ychampion/ystack
- Source
- claude/mods/model-router
- Category
- Community
More from ychampion/ystack
All 39Similar to model-router
More Security & Compliance
eccaffaan-m/everything-claude-code308.6K starsHarness-native ECC operator layer - 72 agents, 328 skills, 99 legacy command shims, reusable hooks, rules, selective install profiles, and production-ready work
security-guidanceanthropics/claude-code156.1K starsSecurity review for Claude-generated code. Pattern-based warnings on edits, LLM-powered diff review on Stop, and an agentic commit reviewer that catches injecti
ruflo-aidefenceruvnet/ruflo82.2K starsAI safety scanning, PII detection, prompt injection defense, and adaptive threat learning
front-end-checklistthedaviddias/Front-End-Checklist74.8K starsReview frontend code and live pages against 386 quality-gated rules for accessibility, performance, SEO, security, and HTML/CSS/JS best practices.
agentic-bundle-aas-privacy-compliance-engineeringsickn33/agentic-awesome-skills50.1K starsInstall the "AAS Privacy & Compliance Engineering" editorial skill bundle for Claude Code.
42crunch-api-security-testinganthropics/claude-plugins-official47.9K starsAutomate API security directly in Claude Code with 42Crunch - automatically audit OpenAPI specs, detect vulnerabilities aligned with OWASP API Security risks (i