claude-code - 💡(How to fix) Fix Skill frontmatter `model:` field is ignored at runtime [1 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#45191Fetched 2026-04-09 08:11:09
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

The model: field in a skill's SKILL.md frontmatter has no effect at runtime. Setting model: sonnet does not change the model used to execute the skill — it always runs under the main session's model (e.g., Opus).

Root Cause

The model: field in a skill's SKILL.md frontmatter has no effect at runtime. Setting model: sonnet does not change the model used to execute the skill — it always runs under the main session's model (e.g., Opus).

Fix Action

Fix / Workaround

Users who set model: sonnet to route cheaper tasks to smaller models end up consuming Opus tokens unintentionally. The only workaround is to explicitly spawn Agent(model="sonnet") inside the skill, which adds boilerplate and is easy to miss.

Code Example

---
   model: sonnet
   effort: medium
   ---
RAW_BUFFERClick to expand / collapse

Bug Report

Description

The model: field in a skill's SKILL.md frontmatter has no effect at runtime. Setting model: sonnet does not change the model used to execute the skill — it always runs under the main session's model (e.g., Opus).

Steps to Reproduce

  1. Create a skill with the following frontmatter in SKILL.md:
    ---
    model: sonnet
    effort: medium
    ---
  2. Invoke the skill from a main session running Opus.
  3. Observe that the skill executes under Opus, not Sonnet.

Expected Behavior

The skill should execute using the model specified in the frontmatter, or the documentation should clearly state that model: is informational only and does not control execution.

Actual Behavior

The model: frontmatter field is silently ignored. All skills run under the main session's model regardless of the specified value.

Impact

Users who set model: sonnet to route cheaper tasks to smaller models end up consuming Opus tokens unintentionally. The only workaround is to explicitly spawn Agent(model="sonnet") inside the skill, which adds boilerplate and is easy to miss.

Request

Either:

  1. Honor the model: frontmatter field when executing the skill, or
  2. Document clearly that model: does not control execution, so users are not misled.

extent analysis

TL;DR

The model: field in a skill's SKILL.md frontmatter should be honored at runtime to execute the skill under the specified model.

Guidance

  • Verify that the model: field is correctly parsed from the frontmatter and passed to the execution environment.
  • Check if there's an existing mechanism to override the main session's model for skill execution, and if it can be adapted to honor the model: field.
  • Consider adding a clear documentation statement about the current behavior of the model: field, to avoid misleading users.
  • Investigate the feasibility of automatically spawning an Agent with the specified model inside the skill, to minimize boilerplate code.

Example

---
model: sonnet
effort: medium
---

This frontmatter should ideally trigger the skill to execute under the Sonnet model.

Notes

The current implementation ignores the model: field, leading to unintended consumption of Opus tokens. A fix or clear documentation is necessary to address this issue.

Recommendation

Apply a workaround by explicitly spawning Agent(model="sonnet") inside the skill, until the model: field is honored at runtime. This ensures that skills execute under the intended model, albeit with added boilerplate code.

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 Skill frontmatter `model:` field is ignored at runtime [1 participants]