Model Routing
How MeowKit assigns the right AI model tier to each task — Trivial, Standard, or Complex.
The orchestrator classifies every task by complexity before work begins. mk:scale-routing emits provider-neutral complexity, workflow, and execution-tier signals; the active provider adapter maps those signals to its available models. The table below describes the Claude Code adapter.
Routing table
| Complexity | Claude Code model | Examples |
|---|---|---|
| Trivial | Haiku | Rename, typo, format, version bump |
| Standard | Sonnet | Feature (<5 files), bug fix, test writing |
| Complex | Opus | Architecture, security audit, auth, payments |
Per-agent routing (subagents)
The table above governs the session model by task complexity. Subagents instead carry a fixed model assignment in their definition, and each provider expresses it natively:
| Provider | Where | How |
|---|---|---|
| Claude Code | .claude/agents/<name>.md frontmatter | model: — a tier alias (opus / sonnet / haiku), a named profile pinning an exact id (fable, claude-opus-5), or inherit. See Claude Agent Models for the full per-agent table. |
| Codex | .codex/agents/<name>.toml | model + model_reasoning_effort — a concrete Codex model id (e.g. gpt-5.6-sol, gpt-5.6-terra, gpt-5.4-mini) with its own effort (low/medium/high). See Codex Agent Models for the full per-agent table. |
| Cursor | .cursor/agents/<name>.md frontmatter | model: — a concrete Cursor model id (e.g. claude-opus-5[effort=high], composer-2.5[fast=true]) or inherit. See Cursor Agent Models for the full per-agent table. |
All three targets pin a model per agent rather than deriving one from the session tier: each agent gets the model its role actually needs, so bounded wrapper work does not run at top-tier cost. See Claude Agent Models, Codex Agent Models, and Cursor Agent Models for the per-agent tables and for how to override a pin.
Escalation rules
- Always Complex: authentication, payment processing, database schema, security audit
- Never downgrade: once assigned, a task stays at its tier for the session
- Code review always Complex: structural audits need highest reasoning
- Domain override:
mk:scale-routingchecks a CSV of domain keywords (fintech, healthcare → high-assurance); the Claude Code adapter maps high-assurance to COMPLEX.
Domain-based routing (Phase 0)
Before manual classification, mk:scale-routing reads keywords from the task and matches against domain-complexity.csv:
| Domain | Keywords | Execution tier / Claude Code mapping |
|---|---|---|
| fintech | payment, stripe, billing, invoice | high-assurance → COMPLEX |
| healthcare | hipaa, phi, ehr, patient data | high-assurance → COMPLEX |
| auth | oauth, jwt, session, credentials | high-assurance → COMPLEX |
| docs | readme, changelog, comment | Allow one-shot |
| config | env, .yaml, version bump | Allow one-shot |
The CSV is user-editable. Add rows for your project's domains. Scale-routing verdicts cannot be downgraded mid-task; each provider adapter then applies its own model policy.
Planning depth per mode
| Mode | Researchers | Approach |
|---|---|---|
strict, architect | 2 (parallel) | Competing approaches, forced synthesis |
default, audit | 1 | Standard depth |
fast, cost-saver, document | 0 | Skip research |
Adaptive density
For Claude Code harness builds, density auto-adjusts per model tier: Haiku → MINIMAL, Sonnet → FULL, Opus 4.6+ → LEAN. See Adaptive Density.
See also
- Claude Agent Models — per-agent pins in the Claude Code toolkit
- Adaptive Density — scaffolding by model capability
- Orchestrator agent — the routing agent