<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/routing-subagents-to-different-models-saves-tokens-and-improves-results-jhewcyrth" -->

---
title: Routing subagents to different models saves tokens and...
description: Multiple AI coding tools are independently converging on the same cost-saving pattern: run the orchestrator on a powerful model but route subagents to cheaper...
canonical: https://daily.dev/posts/routing-subagents-to-different-models-saves-tokens-and-improves-results-jhewcyrth
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Routing subagents to different models saves tokens and improves results | daily.dev
og:description: Multiple AI coding tools are independently converging on the same cost-saving pattern: run the orchestrator on a powerful model but route subagents to cheaper...
og:url: https://daily.dev/posts/routing-subagents-to-different-models-saves-tokens-and-improves-results-jhewcyrth
og:image: https://api.daily.dev/og/posts/jHewCYRth.png
og:image:alt: Routing subagents to different models saves tokens and improves results
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Routing subagents to different models saves tokens and improves results

**[Collections](https://daily.dev/sources/collections)** · 3 min read · 1 upvotes · 0 comments

## Summary

Multiple AI coding tools are independently converging on the same cost-saving pattern: run the orchestrator on a powerful model but route subagents to cheaper or faster models for simpler tasks. Claude Code supports setting CLAUDE_CODE_SUBAGENT_MODEL to send subagents to a different model than the main agent, which one developer used to cut usage significantly. opencode2 recently added per-subagent model selection, useful for pulling in a smarter model just for code review. Vercel's v0 goes further, mixing models and reasoning budgets across a pipeline (e.g. Claude for planning, Grok for execution) without needing special server-side routing - the orchestrating model itself decides which subagent to spawn and how to configure it. The shared principle: match reasoning effort to task complexity to cut costs without much quality loss.

## Content

A pattern that's gaining traction across several AI coding tools: use a smarter (or at least different) model for planning and a faster or cheaper one for execution, rather than running everything through the same model.

## The basic idea

Not every task in an agentic workflow needs the same reasoning horsepower. A planning step that breaks down a complex problem benefits from a capable model. The subagents that carry out individual subtasks often don't — and running them on a heavyweight model burns through usage fast.

Several tools now let you configure this split explicitly.

## How different tools handle it

**Claude Code** exposes a `CLAUDE_CODE_SUBAGENT_MODEL` environment variable. Setting it to `opus` (or any other model) routes subagent calls there instead of the default. One developer noted this saved significant usage on Claude 4.5 Sonnet, since the tool tends to spawn subagents aggressively but most of those tasks don't need top-tier reasoning.

**opencode2** added optional per-subagent model selection in a recent release. The practical use case here is the reverse: running a smarter model for review passes while using a faster one for generation.

**v0 / Vercel's agent setup** takes a more explicit orchestration approach. You can specify model preferences in an `AGENTS.md` file or directly in your prompt — something like "use Claude for planning, Grok for execution." The orchestrator model reads those preferences and routes accordingly. No server-side routing required; it's just the model following instructions about how to delegate.

## A more structured version: complexity routing

For teams building their own agent harnesses, there's a more systematic approach: classify task complexity at runtime and route to different thinking levels or models based on that score.

A TypeScript implementation using Gemini 2.5 Flash does this with a heuristic classifier that scores tasks on prompt length, tool count, keyword matches, and error history, then maps tiers to `thinkingLevel` settings (`low`, `medium`, `high`). Tool-call payloads get validated with Zod before execution, and failures are fed back to the model as structured errors so it can self-correct. A retry handler with jittered exponential backoff handles transient failures, with separate caps for per-call and per-run retries.

A few practical notes from that implementation:
- Gemini 2.5 Flash removed the zero-thinking option that existed in 2.5 Flash, so `low` is now the floor
- Pin model versions in production — thinking behavior can shift between releases
- Token guardrails matter more when thinking is enabled, since reasoning tokens add up quickly

## The common thread

Whether you're setting an env variable, writing an `AGENTS.md` file, or building a classifier, the underlying logic is the same: match model capability to task complexity rather than defaulting to one model for everything. The planning/execution split is the simplest version of this. Complexity-routed thinking levels are the more granular version. Both are worth considering once your agent is spawning enough subagents that cost or latency becomes a real concern.

## Questions this post answers

### How do I make Claude Code use a different model for subagents than the main agent?

Set the environment variable CLAUDE_CODE_SUBAGENT_MODEL to the desired model, such as opus, to route subagents to that model while the main orchestrator agent uses whatever model it's already running on, such as Claude 5.1. This lets you keep frontier-level reasoning only for the orchestrator while cheaper subagent calls handle simpler spawned tasks.

_daily.dev surfaces practical configuration tricks like this for developers tuning agent costs._

### Does opencode support using different models for different subagents?

Yes, opencode2 added optional per-subagent model selection in a recent release. A common use case is assigning a smarter model specifically to code review subagents while keeping the main orchestration loop on a faster, cheaper model for everyday steps.

_Developers picking agent frameworks compare feature updates like this one on daily.dev._

### What models does Vercel's v0 use for planning versus execution in agent pipelines?

Vercel's v0 setup, as described by Guillermo Rauch, uses Claude for planning and Grok for executing, mixing models and reasoning budgets across a pipeline without requiring special server-side routing infrastructure. The orchestrating model itself decides which subagent to spin up and how to configure it, and the whole process can be steered conversationally and interrupted at any time.

_Teams choosing between agent orchestration setups follow tool comparisons like this on daily.dev._

## Similar posts on daily.dev

- [Routing Subagents to the Right Model](https://daily.dev/posts/routing-subagents-to-the-right-model-kfkza5vox) · Medium · 2 upvotes · 1 comments
- [Subagents in Gemini CLI Enable Task Delegation and Parallel Agent Workflows](https://daily.dev/posts/subagents-in-gemini-cli-enable-task-delegation-and-parallel-agent-workflows-6vgsv2yyz) · InfoQ · 1 upvotes · 0 comments
- [I set up Claude Code the way Anthropic now recommends, and the sub-agents-spawning-sub-agents trick changed how I work](https://daily.dev/posts/i-set-up-claude-code-the-way-anthropic-now-recommends-and-the-sub-agents-spawning-sub-agents-trick--kltsswmr1) · XDA Developers · 0 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#claude-code](https://daily.dev/tags/claude-code), [#llm](https://daily.dev/tags/llm), [#opencode](https://daily.dev/tags/opencode), [#v0](https://daily.dev/tags/v0)

[View this post on daily.dev](https://daily.dev/posts/routing-subagents-to-different-models-saves-tokens-and-improves-results-jhewcyrth)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Routing subagents to different models saves tokens and improves results","url":"https://daily.dev/posts/routing-subagents-to-different-models-saves-tokens-and-improves-results-jhewcyrth","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/routing-subagents-to-different-models-saves-tokens-and-improves-results-jhewcyrth"},"datePublished":"2026-09-16T15:53:43.121Z","dateModified":"2026-10-29T02:14:41.696Z","description":"Multiple AI coding tools are independently converging on the same cost-saving pattern: run the orchestrator on a powerful model but route subagents to cheaper...","image":"https://pbs.twimg.com/media/HSWXdZ2XUAA2Mjr.png","thumbnailUrl":"https://pbs.twimg.com/media/HSWXdZ2XUAA2Mjr.png","isAccessibleForFree":true,"articleSection":"Collections","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collections","logo":"https://media.daily.dev/image/upload/s--fk_6ycEi--/f_auto,q_auto/v1780996001/logos/collections?_a=BAMAMiWQ0","url":"https://daily.dev/sources/collections"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/routing-subagents-to-different-models-saves-tokens-and-improves-results-jhewcyrth","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,claude-code,llm,opencode,v0","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collections","item":"https://daily.dev/sources/collections"},{"@type":"ListItem","position":3,"name":"Routing subagents to different models saves tokens and improves results"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/routing-subagents-to-different-models-saves-tokens-and-improves-results-jhewcyrth#faq","mainEntity":[{"@type":"Question","name":"How do I make Claude Code use a different model for subagents than the main agent?","acceptedAnswer":{"@type":"Answer","text":"Set the environment variable CLAUDE_CODE_SUBAGENT_MODEL to the desired model, such as opus, to route subagents to that model while the main orchestrator agent uses whatever model it's already running on, such as Claude 5.1. This lets you keep frontier-level reasoning only for the orchestrator while cheaper subagent calls handle simpler spawned tasks. daily.dev surfaces practical configuration tricks like this for developers tuning agent costs."}},{"@type":"Question","name":"Does opencode support using different models for different subagents?","acceptedAnswer":{"@type":"Answer","text":"Yes, opencode2 added optional per-subagent model selection in a recent release. A common use case is assigning a smarter model specifically to code review subagents while keeping the main orchestration loop on a faster, cheaper model for everyday steps. Developers picking agent frameworks compare feature updates like this one on daily.dev."}},{"@type":"Question","name":"What models does Vercel's v0 use for planning versus execution in agent pipelines?","acceptedAnswer":{"@type":"Answer","text":"Vercel's v0 setup, as described by Guillermo Rauch, uses Claude for planning and Grok for executing, mixing models and reasoning budgets across a pipeline without requiring special server-side routing infrastructure. The orchestrating model itself decides which subagent to spin up and how to configure it, and the whole process can be steered conversationally and interrupted at any time. Teams choosing between agent orchestration setups follow tool comparisons like this on daily.dev."}}]}
```

