[BUG] Here's the issue ready to copy: Title: Skill model field not propagated to Agent sub-invocations when disable-model-invocation: true

Resolved 💬 3 comments Opened Apr 6, 2026 by arutkayb Closed Apr 6, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When a skill is configured with model: sonnet and disable-model-invocation: true, and uses Agent in allowed-tools, the spawned sub-agents inherit the session-level model instead of the skill's declared model. This causes unexpected errors when the session model requires extended context (e.g., Opus). When I switch to Sonnet via /model explicitly and re-run my skill, it worked as expected.

Analysis:

Since disable-model-invocation: true prevents the skill itself from making direct model calls, the model field on the skill has no effect. The Agent tool spawns sub-agents that pick up the session-level model instead. There is no mechanism to pass a model override to Agent sub-invocations from the skill configuration.

Suggested fix:

The model field on a skill should propagate to all Agent sub-invocations spawned within that skill's execution, even when disable-model-invocation: true is set. Alternatively, an explicit model parameter on the Agent tool would allow skills to control this.

Environment:

  • Claude Code (latest)
  • Skill type: custom slash command
  • Session model: opus
  • Skill model: sonnet

What Should Happen?

Agent sub-invocations spawned by the skill should respect the skill's model: sonnet field, regardless of the session-level model.

Error Messages/Logs


Agent sub-invocations inherit the session model (Opus), triggering:


API Error: Extra usage is required for 1M context · run /extra-usage to enable, or /model to switch to standard context

Steps to Reproduce

  1. Create a skill with the following configuration:
  • model: sonnet
  • disable-model-invocation: true
  • allowed-tools: Read, Write, Edit, Glob, Grep, Bash, Agent
  1. Set session model to opus
  2. Run the skill

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.92

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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