claude-code - 💡(How to fix) Fix Skill model override inherits session's 1M context window [1 comments, 2 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#47186Fetched 2026-04-13 05:39:11
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

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

Code Example

---
name: commit
description: Analyze all uncommitted changes
model: sonnet
user-invocable: true
allowed-tools: Bash, Read, Edit, Write, Grep, Glob
---
RAW_BUFFERClick to expand / collapse

Problem

Custom skills with model: sonnet in frontmatter inherit the session's 1M context window instead of using the model's default context. This causes skills to fail with "Extra usage is required for 1M context" even though the skill explicitly requests a cheaper model.

Steps to reproduce

  1. Start Claude Code with Opus 4.6 (1M context) — do NOT enable extra usage
  2. Create a skill at .claude/skills/commit/SKILL.md with model: sonnet in frontmatter
  3. Invoke /commit

Expected: Skill runs with Sonnet at standard context (no extra usage needed) Actual: Error: "API Error: Extra usage is required for 1M context · run /extra-usage to enable, or /model to switch to standard context"

Skill frontmatter

---
name: commit
description: Analyze all uncommitted changes
model: sonnet
user-invocable: true
allowed-tools: Bash, Read, Edit, Write, Grep, Glob
---

Suggestion

The model field in skill frontmatter should fully override the session's model config, including context window — not just the model family. Alternatively, support an explicit context window option like model: sonnet[200k] or a separate context field.

Skills like /commit are designed to be quick and don't need 1M context. Users should be able to use cheaper models for utility skills without being gated by the session's context window setting.

extent analysis

TL;DR

The issue can be fixed by adding an explicit context window option to the model field in the skill frontmatter, such as model: sonnet[200k], to override the session's context window setting.

Guidance

  • Verify that the model field in the skill frontmatter is correctly set to sonnet and that the session's context window is set to 1M.
  • Consider adding a separate context field to the skill frontmatter to explicitly set the context window, such as context: 200k.
  • Test the skill with the updated frontmatter to ensure it runs with the correct context window and does not require extra usage.
  • If the issue persists, try setting the model field to a different value, such as `model: sonnet[

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