ysskrishna logoysskrishna

Chapter 5 of 9 · 3 min

Subagent models and cost: make the model in the file the model that runs

How model routing works in Claude Code and Cursor, the two cases where Cursor ignores your agent's model, and how to get a receipt for every run.

Putting model: haiku on a scout is the cheapest optimisation in agent work: a search-and-summarise job rarely needs a frontier model. It only works if the host actually runs that model. This chapter shows how to check, and what to do when it does not.

How hosts resolve model:

ValueClaude CodeCursor
haiku, sonnet, opusLatest model of that familyCursor's own alias mapping, which may differ from Claude Code's
Full ID like claude-…That exact modelThat model, if enabled in your settings
inherit or missingSame as the main chatSame as the main chat

The alias difference matters. When last checked for the Claude Code Subagents for Cursor README, Cursor mapped haiku to an older Haiku that many plans have disabled, while Claude Code mapped it to its latest Haiku. Same file, different model.

The two cases where Cursor ignores your agent's model

Cursor's Task tool runs the subagent on the parent chat's model when:

  1. You use a personal Anthropic API key (BYOK). Cursor staff confirmed this on the Cursor forum.
  2. The model named in the agent file is not enabled in your Cursor model settings.

Nothing in the reply tells you. You find out from the usage meter.

Check which model ran

Before you optimise, measure.

  1. Give the scout a trivial, recognisable task: "List the top-level folders."
  2. Run it once with your parent chat on an expensive model.
  3. Check your provider's usage dashboard or request logs for the model of that request. In Claude Code, the transcript and /cost show usage for the session.
  4. If the request was billed to the parent's model, you have hit one of the two cases.

Fix 1: enable the model (Cursor's own models)

If you are not using BYOK, open Cursor's model settings and enable the model your agent names. Then re-run the check. This is the only change needed for many setups.

Fix 2: route subagents through Claude Code

If you use BYOK, or you want Claude Code's alias mapping, run the subagent through Claude Code's headless mode from Cursor's shell. Claude Code Subagents for Cursor is a skill that does this routing:

npx skills add ysskrishna/claude-code-subagents-for-cursor -a cursor -g

Then, in a Cursor chat:

/use-claude-code-subagents

The agent confirms Subagent mode: claude code. Every custom subagent now runs through claude -p on the model in its own file, and each answer ends with a receipt like:

scout ran on claude-haiku-…

Requirements from the README: Cursor desktop running locally (Cloud Agents have no claude CLI), Claude Code 2.1.281 or later signed in, and a POSIX shell (macOS or Linux; native Windows is not supported). Runs bill your Claude Code account. Say "use cursor subagents" to switch back.

Permissions when routing

Claude Code runs outside Cursor's sandbox, so pick a Cursor run mode that allows it (Auto-Review with Sandbox is the suggested one; Allowlist modes are not supported). On the Claude Code side the skill passes --permission-prompts none, so anything Claude Code would ask about is denied and reported, and only editing agents get --permission-mode acceptEdits.

Choosing models by job

JobModel tierWhy
Repo search, file listingSmall (Haiku class)Mostly reading; output is a list
Log or PR summarisationSmallCompression, not reasoning
Code reviewMid (Sonnet class)Needs judgment, not maximum depth
Architecture, tricky debuggingLarge, usually the main chatKeep it where the context is

Treat this as a starting point and measure. A subagent that misses things on a small model costs more in re-runs than it saved.

Quick check

  1. You use BYOK in Cursor and your agent says model: haiku. What model runs via the Task tool?The parent chat's model.

  2. What is the receipt line for, beyond reassurance?It catches routing mistakes per run, before they show up on the bill.

  3. Why might model: haiku run a newer model through Claude Code than through Cursor?The two hosts resolve the alias differently; Claude Code maps it to its latest Haiku.

Continue exploring

Productnpm+3Thinking Methods

Thinking Methods

17 well-known thinking methods your AI coding assistant can actually run.
Agent Skills
AI Apps & Assistants
Bash
Gemini
BlogCover image for 17 Thinking Skills for AI Agents: Pre-Mortem, Five Whys, Six Hats and More

17 Thinking Skills for AI Agents: Pre-Mortem, Five Whys, Six Hats and More

AI Apps & Assistants
Agent Skills
4 min read
ToolCover image for AI Token Counter

AI Token Counter

AI token counter with model pricing and context-window comparison in your browser.

Chat & AI
AI Apps & Assistants
+1
Productskills.sh+1Claude Code Subagents for Cursor

Claude Code Subagents for Cursor

Your Cursor subagents can finally run on the model you picked in each agent file.
Chat & AI
Agent Skills
AI Apps & Assistants
Bash
CourseCover image for Prompt Engineering for Coding Agents

Prompt Engineering for Coding Agents

Write prompts that coding agents act on: clear goals, the right context, output contracts, examples, structured thinking, shorter answers and a tiny eval set.

Agent Skills
Chat & AI

8 chapters · 21 min

BlogCover image for How to Install Caveman in Cursor and Claude Code

How to Install Caveman in Cursor and Claude Code

AI Apps & Assistants
Agent Skills
+1
3 min read