claude-code - 💡(How to fix) Fix Agent tool's `model` override silently ignored — fork always runs as parent's model [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54861Fetched 2026-04-30 06:33:51
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Timeline (top)
labeled ×3commented ×2cross-referenced ×1

The Agent tool documents a model parameter with enum: ["sonnet", "opus", "haiku"] that "takes precedence over the agent definition's model frontmatter." Passing "model": "sonnet" is accepted without error, the fork runs to completion, but the run is billed against the parent model (Opus) rather than the requested Sonnet.

Settings → Usage dashboard confirms 0% Sonnet used after multiple Agent dispatches with model: "sonnet" explicit, while All models weekly limit climbs proportionally to the Opus token counts reported in the task notification.

Error Message

The Agent tool documents a model parameter with enum: ["sonnet", "opus", "haiku"] that "takes precedence over the agent definition's model frontmatter." Passing "model": "sonnet" is accepted without error, the fork runs to completion, but the run is billed against the parent model (Opus) rather than the requested Sonnet.

Root Cause

The Agent tool documents a model parameter with enum: ["sonnet", "opus", "haiku"] that "takes precedence over the agent definition's model frontmatter." Passing "model": "sonnet" is accepted without error, the fork runs to completion, but the run is billed against the parent model (Opus) rather than the requested Sonnet.

Settings → Usage dashboard confirms 0% Sonnet used after multiple Agent dispatches with model: "sonnet" explicit, while All models weekly limit climbs proportionally to the Opus token counts reported in the task notification.

Fix Action

Workaround

Avoid forks for small work; do edits inline in main thread. Reserve forks for genuinely large tool-output cases.

Code Example

Agent({
     description: "tiny test",
     isolation: "worktree",
     model: "sonnet",
     prompt: "Edit one file: bump a number from 0.25 to 0.18, run tests, push, report SHA."
   })
RAW_BUFFERClick to expand / collapse

Environment

  • Plan: Team
  • Surface: Claude Code CLI (Opus 4.7, 1M context)
  • Date observed: 2026-04-30

Description

The Agent tool documents a model parameter with enum: ["sonnet", "opus", "haiku"] that "takes precedence over the agent definition's model frontmatter." Passing "model": "sonnet" is accepted without error, the fork runs to completion, but the run is billed against the parent model (Opus) rather than the requested Sonnet.

Settings → Usage dashboard confirms 0% Sonnet used after multiple Agent dispatches with model: "sonnet" explicit, while All models weekly limit climbs proportionally to the Opus token counts reported in the task notification.

Repro

  1. From a Claude Code session running on Opus, dispatch:
    Agent({
      description: "tiny test",
      isolation: "worktree",
      model: "sonnet",
      prompt: "Edit one file: bump a number from 0.25 to 0.18, run tests, push, report SHA."
    })
  2. Wait for the task notification; note the <usage><total_tokens>...</total_tokens></usage> count.
  3. Open Settings → Usage on claude.ai/settings/usage. Observe Sonnet only shows 0% used despite the dispatched fork having completed.

Expected

Fork runs on Sonnet; Sonnet quota increments by the fork's token usage; All-models quota does not increment (or increments at Sonnet's lower rate).

Actual

Fork runs on the parent's model (Opus); Sonnet quota stays at 0%; All-models quota increments at Opus rates. A ~30-line numerical change cost ~557k tokens — consistent with Opus, not Sonnet.

Impact

Users hitting weekly limits on Team plan can't redirect mechanical/implementation forks to Sonnet to stay under quota. The documented model override is effectively a no-op.

Workaround

Avoid forks for small work; do edits inline in main thread. Reserve forks for genuinely large tool-output cases.

extent analysis

TL;DR

The model parameter in the Agent tool may not be correctly overriding the parent model, causing the fork to run on the parent model (Opus) instead of the requested model (Sonnet).

Guidance

  • Verify that the model parameter is correctly set to "sonnet" in the Agent dispatch call.
  • Check the documentation for any specific requirements or limitations for using the model override.
  • Test the model override with a different model, such as "haiku", to see if the issue is specific to "sonnet".
  • Consider reaching out to the Claude Code support team for further assistance, as the issue may be related to the underlying billing or quota system.

Notes

The issue may be related to the billing or quota system, and further investigation is needed to determine the root cause. The provided workaround of avoiding forks for small work and doing edits inline in the main thread may help mitigate the issue, but it does not address the underlying problem.

Recommendation

Apply workaround: Avoid forks for small work and do edits inline in the main thread, as the model override is not functioning as expected. This will help prevent unnecessary quota usage until the issue is resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Agent tool's `model` override silently ignored — fork always runs as parent's model [2 comments, 3 participants]