[BUG] VS Code sidebar extension ignores CLAUDE_CODE_DISABLE_1M_CONTEXT on Pro plan (Windows)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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
- Set
CLAUDE_CODE_DISABLE_1M_CONTEXT=1via any method (see below) - Open VS Code
- Launch Claude Code from the sidebar extension
- Send any message
- Error appears immediately
What I Tried (all failed for the sidebar extension)
terminal.integrated.env.windowsin VS Codesettings.json:
{
"terminal.integrated.env.windows": {
"CLAUDE_CODE_DISABLE_1M_CONTEXT": "1"
}
}
envkey in~/.claude/settings.json:
{
"env": {
"CLAUDE_CODE_DISABLE_1M_CONTEXT": "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.
- 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_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗