Workflow agent() spawns inherit the session model with no override; built-in workflows ship unpinned — one deep-research launch ran 84 agents on Fable 5

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Jul 7, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Workflow scripts spawn agents through a path that bypasses both CLAUDE_CODE_SUBAGENT_MODEL and PreToolUse Agent/Task hooks. The docs confirm there is no configuration lever: "Every agent in a workflow uses your session's model unless the script routes a stage to a different one" (code.claude.com/docs/en/workflows, Cost section). The built-in workflows (for example deep-research) contain no model: routing on any agent() call.

Result: on July 6, 2026 (v2.1.201), a single deep-research invocation from a session whose main loop ran claude-fable-5 spawned 84 subagents, all on claude-fable-5, consuming ~11.6M tokens (908k input / 202k output / 3.8M cache-write / 6.6M cache-read, deduplicated by message id) from the limited Fable weekly inclusion before it was manually killed. There was no warning at launch time that a built-in workflow would fan out dozens of agents on the session's frontier model.

Related: issue #75054 (pins dropped on wake/resume) — together these mean there is currently no reliable way to keep delegated work off an expensive session model.

Requested (any of):

  1. A default-model setting for workflow-spawned agents (env var or settings key), or
  2. model: pins in the built-in workflow scripts, or
  3. At minimum, a launch-time warning showing which model the fan-out will run on and roughly how many agents the workflow may spawn.

Environment: Claude Code v2.1.201, macOS, Max subscription, main loop on claude-fable-5[1m].

View original on GitHub ↗

4 Comments

rpelevin · 3 months ago

This looks like a model-budget authority bug, not only a workflow default question.

For workflow-spawned agents, I would want the launch path to produce one decision record before fan-out:

  • workflow id and script version
  • parent session model and any workflow default model
  • per-agent requested role, model, and reason for inheritance or override
  • estimated fan-out count and budget envelope before launch
  • user-visible warning when the workflow will inherit a frontier/session model
  • terminal outcome per spawned agent: completed, cancelled, budget-stopped, model-overridden, or launch-blocked

The negative tests I would add are:

  • a built-in workflow with no model pins from a frontier-model session
  • an env/settings default that should apply to workflow spawns
  • a PreToolUse Agent/Task hook that should see or block delegated fan-out
  • resume/wake after a parent session model changes

The invariant is that model choice for delegated work is authority, cost, and policy state. If the system fans out 80+ agents, the user should be able to inspect whether each agent inherited the session model intentionally, was pinned by workflow policy, or was blocked because no budget/model authority was available.

Boundary: diagnostic/test-boundary feedback only; no claim about Anthropic fix, Claude Code adoption, implementation correctness, official alignment, partnership, customer interest, integration, or Neura usage.

davidpp · 2 months ago

A single request just burned my 5h budget and 10-15% of my Fable usage for the week.

bcherny collaborator · 1 month ago

Thanks for the detailed report. Two of the three asks are available today:

  • Default model for workflow agents: set the CLAUDE_CODE_SUBAGENT_MODEL environment variable (for example haiku or sonnet). It applies to subagents, agent teams, and every agent spawned by a workflow, taking precedence over the session model and any per-stage model: in the script.
  • Launch-time warning: when a workflow schedules more than 25 agents or its projected token total passes 1.5M, the progress line below the input shows a Large workflow warning pointing to /workflows, where you can stop the run. The workflowSizeGuideline setting (or Dynamic workflow size in /config) also lets you steer how large dynamic workflows get.

Docs: https://code.claude.com/docs/en/workflows#cost and https://code.claude.com/docs/en/model-config#environment-variables

If you still see workflow agents ignoring CLAUDE_CODE_SUBAGENT_MODEL on a current version, please open a bug with the version and a /share link.

🤖 Generated with Claude Code

webby-box · 1 month ago

Pin CLAUDE_CODE_SUBAGENT_MODEL before deep-research — unpinned workflows inherit frontier session model across dozens of agents.