Feature request: automatic model routing based on task type

Resolved 💬 3 comments Opened Mar 26, 2026 by DjSloth Closed May 30, 2026

Feature Request: Automatic Model Routing

Summary

Add support for automatic model selection based on task type, similar to how GitHub Copilot routes between fast and capable models depending on the operation.

Motivation

Different tasks in a Claude Code session have very different requirements:

  • Casual chat / short answers → fast, cheap model (e.g. Haiku) is perfectly sufficient
  • Research, web fetching, codebase analysis, reading docs → a more capable reasoning model (e.g. Opus) produces significantly better results
  • Implementation / coding → a balanced model (e.g. Sonnet) hits the sweet spot of speed and quality

Right now the model is fixed per session. Users have to manually /model switch between tasks, which interrupts flow and is easy to forget. Most users just pick one model and stick with it — leaving performance or cost on the table.

Proposed Behavior

A model: auto setting (in session or settings.json) that routes to the appropriate model based on detected task context:

| Task signal | Suggested model |
|---|---|
| Short conversational replies | Haiku |
| Web search, file reading, codebase exploration | Opus |
| Code generation, edits, implementation | Sonnet |

Detection could be heuristic (keyword patterns, tool use type) or explicit (user-facing task type hints).

Prior Art

  • GitHub Copilot switches between models based on completion type
  • Claude Code's own Agent tool already supports per-agent model overrides — this pattern could be extended to the main conversation

Impact

This would meaningfully reduce cost for casual use while improving quality for heavy analysis tasks — without requiring users to think about it.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗