Skill subagent fails silently with misleading error when session model is Opus but skill frontmatter specifies Sonnet

Resolved 💬 2 comments Opened Mar 24, 2026 by jules-w2 Closed Mar 24, 2026

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

  1. Start a Claude Code session with Opus (claude-opus-4-6, 1M context)
  2. Create a skill with model: sonnet in its frontmatter
  3. The skill uses ! inline commands to inject large content (e.g. git diff, git status, git log) and the session has many skills loaded
  4. 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

  1. Misleading error message: "Rate limit reached" is shown instead of "Extra usage is required for long context requests", making diagnosis extremely difficult.
  1. 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

View original on GitHub ↗

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