claude-code - 💡(How to fix) Fix [BUG] VS Code sidebar extension ignores CLAUDE_CODE_DISABLE_1M_CONTEXT on Pro plan (Windows)

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…

Error Message

API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context

Fix Action

Workaround

Launching claude from the integrated terminal works correctly — the variable is respected in that context. However, the terminal interface is significantly less user-friendly than the sidebar extension.

Code Example

API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context

---

{
  "terminal.integrated.env.windows": {
    "CLAUDE_CODE_DISABLE_1M_CONTEXT": "1"
  }
}

---

{
  "env": {
    "CLAUDE_CODE_DISABLE_1M_CONTEXT": "1"
  }
}

---

[System.Environment]::SetEnvironmentVariable("CLAUDE_CODE_DISABLE_1M_CONTEXT", "1", "User")

---

$env:CLAUDE_CODE_DISABLE_1M_CONTEXT = '1'

---
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?

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?

The VS Code sidebar extension ignores CLAUDE_CODE_DISABLE_1M_CONTEXT=1 and always attempts to use 1M context, resulting in the following error on Pro plan:

API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context

This happens even though actual usage is well within plan limits (Session: 23%, Weekly: 4%).

What Should Happen?

The sidebar extension should respect CLAUDE_CODE_DISABLE_1M_CONTEXT=1 and use standard context, exactly like the terminal (claude command) does.

Steps to Reproduce

  1. Set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 via any method (see below)
  2. Open VS Code
  3. Launch Claude Code from the sidebar extension
  4. Send any message
  5. Error appears immediately

What I Tried (all failed for the sidebar extension)

  1. terminal.integrated.env.windows in VS Code settings.json:
{
  "terminal.integrated.env.windows": {
    "CLAUDE_CODE_DISABLE_1M_CONTEXT": "1"
  }
}
  1. env key in ~/.claude/settings.json:
{
  "env": {
    "CLAUDE_CODE_DISABLE_1M_CONTEXT": "1"
  }
}
  1. Windows user-level environment variable (no admin rights required):
[System.Environment]::SetEnvironmentVariable("CLAUDE_CODE_DISABLE_1M_CONTEXT", "1", "User")

Confirmed with [System.Environment]::GetEnvironmentVariable("CLAUDE_CODE_DISABLE_1M_CONTEXT", "User") returning 1.

  1. PowerShell profile ($PROFILE):
$env:CLAUDE_CODE_DISABLE_1M_CONTEXT = '1'

Confirmed with echo $env:CLAUDE_CODE_DISABLE_1M_CONTEXT returning 1 in the integrated terminal.

All four methods correctly set the variable, but the sidebar extension still triggers the 1M context error.

Workaround

Launching claude from the integrated terminal works correctly — the variable is respected in that context. However, the terminal interface is significantly less user-friendly than the sidebar extension.

Environment

  • Claude Code version: 2.1.128
  • Platform: Windows
  • Launch method: VS Code sidebar extension
  • Plan: Claude Pro
  • VS Code terminal: PowerShell

Related Issues

#62063, #62199, #63700

What Should Happen?

The VS Code sidebar extension should respect CLAUDE_CODE_DISABLE_1M_CONTEXT=1 and use standard context, just like launching claude from the integrated terminal does.

Error Messages/Logs

Steps to Reproduce

Mets :

    Set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 via any of the following methods (all tested, all confirmed active via echo $env:CLAUDE_CODE_DISABLE_1M_CONTEXT returning 1):
        terminal.integrated.env.windows in VS Code settings.json
        env key in ~/.claude/settings.json
        [System.Environment]::SetEnvironmentVariable("CLAUDE_CODE_DISABLE_1M_CONTEXT", "1", "User") in PowerShell
        PowerShell $PROFILE with $env:CLAUDE_CODE_DISABLE_1M_CONTEXT = '1'
    Restart VS Code completely
    Open Claude Code from the sidebar extension (not the terminal)
    Send any message
    Error appears immediately: API Error: Usage credits required for 1M context

Note: launching claude from the integrated terminal works correctly with the same variable set.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.128

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

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] VS Code sidebar extension ignores CLAUDE_CODE_DISABLE_1M_CONTEXT on Pro plan (Windows)