claude-code - 💡(How to fix) Fix [BUG] Opus 4.7 1M context window unreachable in VS Code extension — no documented env var / setting to opt in; client caps at 200k [2 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#50716Fetched 2026-04-20 12:15:02
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Paid Subscription MAX 20x - Opus 4.7 has a 1M-token context window per Anthropic's published model spec. Running claude-opus-4-7 in the Claude Code VS Code extension on Windows, the effective context window behaves as 200k tokens and there is no documented user-reachable setting to opt into the 1M variant from this client.

Observable: the auto-compact tooltip shows 48% of context remaining until auto-compact / 52% context used — click to compact at a token count consistent with a 200k ceiling, not ~500k of a 1M budget. Sessions compact roughly 5× earlier than the 1M spec implies.

On this machine I have configured every knob I could find that might matter, verified on disk:

  • ~/.claude/settings.json: "env": { "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "90" }, "autoCompactWindow": 900000
  • VS Code user settings.json: "claudeCode.environmentVariables": ["CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=90"]
  • Windows User-scope env vars: CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=90, CLAUDE_CODE_EFFORT_LEVEL=max

Subprocess propagation is confirmed working (echo $CLAUDE_AUTOCOMPACT_PCT_OVERRIDE returns 90 inside the integrated terminal of a freshly-launched session). None of these are window-size controls, and I cannot find any setting or env var in the docs that is. Names a user might reasonably try — CLAUDE_CODE_ENABLE_1M_CONTEXT, ANTHROPIC_BETAS=context-1m-2025-08-07, ANTHROPIC_MODEL, MAX_CONTEXT_TOKENS — are either undocumented for Claude Code or silently ignored.

What Should Happen?

When the selected model is claude-opus-4-7 and the user's plan/org has access to the 1M context window, the Claude Code VS Code extension should expose that full 1M window — either by default or via a documented, user-reachable opt-in (env var, setting, CLI flag, or extension preference). The compaction tooltip and token counter should reflect the active ceiling.

If 1M support is no longer implemented in the VS Code extension client, that limitation should be documented plainly so users stop chasing threshold knobs that cannot fix a window-size problem.

Error Messages/Logs

Steps to Reproduce

  1. On Windows 11, install Claude Code VS Code extension v2.1.114.
  2. Select model claude-opus-4-7 (via /model or claudeCode.selectedModel setting).
  3. Configure every plausible "larger window" knob available:
    • In ~/.claude/settings.json: "env": { "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "90" } and "autoCompactWindow": 900000.
    • In VS Code user settings.json: "claudeCode.environmentVariables": ["CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=90"].
    • At Windows User scope (PowerShell): [Environment]::SetEnvironmentVariable("CLAUDE_AUTOCOMPACT_PCT_OVERRIDE", "90", "User")
  4. Fully quit VS Code (taskkill /F /IM Code.exe /T) and relaunch. Confirm the env var reaches the subprocess: echo $CLAUDE_AUTOCOMPACT_PCT_OVERRIDE90.
  5. Open a new Claude Code session and work normally.
  6. Observe: the auto-compact tooltip fires at roughly 50% of a 200k budget, not roughly 50% of a 1M budget. No configuration makes it behave like 1M.

Expected: 1M window (or a documented opt-in that unlocks it). Actual: 200k ceiling with no apparent escape.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.114 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

There are only two readings of the evidence, and Anthropic should be explicit about which one applies:

  1. This is a bug. The 1M window is meant to be available to Opus 4.7 users in Claude Code but an extension-side code path is silently capping at 200k. Fix.

  2. This is a deliberate product decision. The VS Code extension is intentionally capped at 200k regardless of the user's plan or the model's spec. In that case:

    • Document the cap, plainly, on the Claude Code docs page and release notes — not buried.
    • Stop shipping CLAUDE_AUTOCOMPACT_PCT_OVERRIDE and autoCompactWindow as configurable surfaces when the underlying window is fixed. They read as knobs a user can turn to get more room; they cannot. Users configuring them are configuring against a product decision they have no way to discover.
    • Explain the rationale (cost? latency? capacity?), and name the plan tier / interface (if any) that does get 1M, so paying customers can make informed decisions about whether Claude Code is the right client for their work.

What is not acceptable is the current state: a documented model capability (1M) that cannot be reached through the advertised client, with configuration knobs that look meaningful but are no-ops, and no documentation clarifying which of the two readings above is true. That combination — silent cap + configurable-looking but inert settings + no disclosure — is indistinguishable from deliberate throttling presented as a technical limitation. Please resolve it one way or the other.

extent analysis

TL;DR

The issue can be resolved by either fixing the bug that silently caps the context window at 200k or documenting the deliberate product decision to limit the context window, along with the rationale and affected plan tiers.

Guidance

  • Verify if the 1M context window is indeed available for the Opus 4.7 model through other clients or interfaces to determine if the issue is specific to the Claude Code VS Code extension.
  • Check the extension's code to see if there's a hardcoded limit or a configuration option that's being ignored, which could be causing the 200k cap.
  • If the issue is due to a deliberate product decision, document the limitation clearly on the Claude Code docs page and release notes, and consider removing or clarifying the configurable surfaces that appear to control the context window size.
  • Test the extension with different plan tiers and models to see if the context window size varies, which could indicate a deliberate limitation.

Example

No code snippet is provided as the issue is more related to configuration and product decisions rather than a specific code problem.

Notes

The issue lacks information on the last working version, which could help in identifying when the problem started. Additionally, the Anthropic API and plan details are not fully disclosed, making it difficult to provide a more specific solution.

Recommendation

Apply a workaround by documenting the current behavior and limitations of the Claude Code VS Code extension, and consider removing or clarifying the configurable surfaces that appear to control the context window size, until the root cause is determined and addressed.

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 [BUG] Opus 4.7 1M context window unreachable in VS Code extension — no documented env var / setting to opt in; client caps at 200k [2 comments, 2 participants]