[BUG] Direct execution skills with model: frontmatter trigger spurious "Rate limit reached"

Resolved 💬 3 comments Opened Apr 4, 2026 by aimsise Closed May 14, 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?

Direct execution skills (non-forked, with disable-model-invocation: true ) that specify model: sonnet in SKILL.md
frontmatter trigger API Error: Rate limit reached when the conversation's default model is Opus.

The error occurs even when Sonnet's usage is far below the limit. In my case, Sonnet weekly usage was at 2% when the
error occurred. The error appears immediately on invocation, not after processing.

Critically, requesting the exact same operation via natural language (which uses the conversation's default Opus
model) succeeds within 5 seconds of the skill failure. This rules out an actual rate limit condition.

The issue is 100% reproducible when switching from Opus to Sonnet via a direct execution skill's model: field. A
direct execution skill with model: haiku has not exhibited this issue, suggesting the problem is
specific to the Opus → Sonnet model switch path.

What Should Happen?

The skill should execute using the specified model without triggering a rate limit error, especially when the
model's usage is well within the limit.

Error Messages/Logs

API Error: Rate limit reached

Steps to Reproduce

  1. Create a direct execution skill ( .claude/skills/my-skill/SKILL.md ) with a model: field that differs from the

conversation's default model:

---
name: my-skill
disable-model-invocation: true
model: sonnet # conversation default is opus
allowed-tools:

  • Read
  • Edit

---

Do something: $ARGUMENTS

  1. Invoke the skill:

/my-skill test

  1. Observe: API Error: Rate limit reached
  2. Immediately (within 5 seconds), type the same request in natural language:

Do something with test

  1. Observe: succeeds normally using the default conversation model (opus)
  2. Try again in a fresh session (exit and restart Claude Code):

/my-skill test

  1. Observe: same API Error: Rate limit reached even as the first command

Note: Skills using context: fork + agent: with model: in the agent definition (e.g., model: sonnet in a
.claude/agents/researcher.md ) work correctly. The issue is specific to the inline model switch in direct execution
skills.

Claude Model

opus-4.6 1M

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.81 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

### Affected vs Unaffected Configurations

• Direct execution skill + model: sonnet (conversation default is Opus) -> Always fails
• Direct execution skill + model: haiku (conversation default is Opus) -> Works fine
• Direct execution skill + no model: field -> Works fine
• context: fork + agent: with model: sonnet in agent .md -> Works fine

### Workaround

Remove the model: field from the direct execution skill's frontmatter:

# Before (always fails with rate limit error)
disable-model-invocation: true
model: sonnet

# After (works correctly)
disable-model-invocation: true

### Hypothesis

The inline model switch from Opus to Sonnet in direct execution skills appears to hit a different rate limit bucket
or internal routing constraint. Notably:

• Opus → Sonnet switch in direct execution skills: always fails
• Opus → Haiku switch in direct execution skills: works fine
• Opus → Sonnet switch in forked agent contexts: works fine
• Sonnet used via natural language (no switch): works fine

This suggests the issue is specific to the Opus → Sonnet inline routing path, not model switching in general.

View original on GitHub ↗

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