[BUG] Slash command invocation blocked by context-limit check on Opus 4.7 1M (false positive)

Resolved 💬 3 comments Opened May 14, 2026 by musicMan1337 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
  • [x] I am using the latest version of Claude Code

What's Wrong?

On the Opus 4.7 1M-token context model (claude-opus-4-7[1m]), invoking a slash command directly fails with a "Context limit reached" error well before the 1M cap is approached. The same skill loads and runs fine when the slash command is prefixed with any user text in the same message.

This appears to be a false positive: the slash-command loader is checking against a stale or lower context-window cap (the 200k default, possibly) rather than the model's actual context size.

What Should Happen?

On a 1M-token model, slash commands should remain directly invocable until the session is actually near 1M tokens. The loader's context-cap check should be keyed to the active model's true cap, not a fixed lower threshold.

Error Messages/Logs

Context limit reached

(That's the entire user-facing message — no stack trace, no hint that a workaround exists, no indication of which cap was tripped.)

Steps to Reproduce

  1. Start a Claude Code session on claude-opus-4-7[1m] (Opus 4.7, 1M context).
  2. Have a normal working session — files read, edits made, subagents spawned. In my repro, context was near or over 200k tokens but was nowhere near 1M tokens.
  3. Type a bare slash command as the next message, e.g. /git:commit (a skill whose definition is ~3-4k tokens).
  4. → Fails with "Context limit reached". The skill body never loads, the command never runs.

Workaround that succeeds in the same session at the same context size:

Prefix the slash command with any free-text content in the same message:

run /git:commit

The skill then loads and executes normally. Reproducible: bare invocation fails, prefixed invocation succeeds.

Hypothesis

The user turn forces an auto-compaction pass before the skill loader runs, freeing whatever margin the loader is checking against, OR the invocation is checked against a 200k context window limit despite being on a 1M context window model. A bare slash command skips that pass and trips the (apparently stale) limit check directly. So the issue is likely in whichever code-path decides \"can I afford to load this skill's body\" — it's using a cap that isn't model-aware.

Claude Model

Opus (specifically claude-opus-4-7[1m] — the 1M-context variant of Opus 4.7)

Is this a regression?

I don't know

Claude Code Version

2.1.141 (Claude Code)

Platform

Anthropic API

Operating System

macOS (Darwin 25.1.0)

Terminal/Shell

Warp

Additional Information

The model dropdown in this template doesn't have a 1M-context option — the distinction is load-bearing for this bug, since the entire claim is \"the cap-check ignores the 1M variant.\" Worth adding Opus (1M context) as a separate option if this is a recurring source of reports.

Asks:

  • Confirm whether the slash-command loader's context-cap check is model-aware.
  • If not, key it to the active model's actual context size so 1M-model sessions don't trip on a 200k-style threshold.
  • Failing that, surface a better error message that points users at the prefix workaround (or runs the compactor automatically).

View original on GitHub ↗

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