Skill subagent fails silently with misleading error when session model is Opus but skill frontmatter specifies Sonnet
Summary
When running a Claude Code session with Opus (1M context) and invoking a skill that specifies model: sonnet in its frontmatter, the skill systematically fails. The same skill works correctly when the session model is also Sonnet.
Steps to reproduce
- Start a Claude Code session with Opus (claude-opus-4-6, 1M context)
- Create a skill with
model: sonnetin its frontmatter - The skill uses
!inline commands to inject large content (e.g. git diff, git status, git log) and the session has many skills loaded - Invoke the skill
Expected behavior
The skill runs on Sonnet as specified in the frontmatter, regardless of the parent session model.
Actual behavior
The skill fails immediately after loading:
Successfully loaded skill · N tools allowed · claude-sonnet-4-6
API Error: Rate limit reached
Root cause (from --debug log)
The actual API error is:
429 {"type":"rate_limit_error","message":"Extra usage is required for long context requests."}
The UI displays "Rate limit reached" — a misleading translation of the real error.
Hypothesis: when the parent session runs on Opus (1M context window), Claude Code passes a significantly larger context to the skill subagent than when the session runs on Sonnet (200K). Combined with inline ! command outputs and skill attachments (17 skills observed in debug log), this exceeds the long context threshold for Sonnet under a standard Claude Team plan.
Two distinct issues
- Misleading error message: "Rate limit reached" is shown instead of "Extra usage is required for long context requests", making diagnosis extremely difficult.
- Context inheritance bug: a skill subagent running on a smaller model (Sonnet) silently inherits the large context of a parent Opus session, causing it to exceed the subagent model's long context threshold.
Workaround
Switch the session model to Sonnet before invoking the skill (/model → Sonnet). The skill then works correctly with the same model: sonnet frontmatter.
Environment
- Claude Code v2.1.81
- Platform: macOS (darwin 25.3.0)
- Subscription: Claude Team
- Session model: claude-opus-4-6 (1M context)
- Skill subagent model: claude-sonnet-4-6
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗