[BUG] "Related to #10520 (locked). Additional data point with different configuration..."
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?
VS Code Extension Host crashes with "JavaScript heap out of memory" at ~2.2GB during Claude Code initialization. This occurs in a crash loop making the extension completely unusable.
Related: #10520 (locked), #8722, #12611
What Should Happen?
Extension should initialize without exhausting heap memory. CLI mode (claude in terminal) works perfectly with identical configuration, confirming the issue is specific to VS Code extension host integration.
Error Messages/Logs
Steps to Reproduce
- Have accumulated permission rules in
settings.local.json(~248 rules over time) - Have 1-3 MCP servers configured (chrome-devtools, gemini, postgres)
- Open VS Code in project directory
- Extension host crashes within seconds during initialization
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
2.1.19
Claude Code Version
2.1.20
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Root Cause Analysis from Debug Logs
1. Parallel OAuth Token Checks (30+ simultaneous)
2026-01-27T23:18:06.213Z [DEBUG] [API:auth] OAuth token check starting
2026-01-27T23:18:06.213Z [DEBUG] [API:auth] OAuth token check starting
2026-01-27T23:18:06.213Z [DEBUG] [API:auth] OAuth token check starting
... (repeated 30+ times at identical timestamp)
2026-01-27T23:18:06.214Z [DEBUG] [API:auth] OAuth token check complete
... (30+ completions)
2. Permission Rule Accumulation
Applying permission update: Adding 248 allow rule(s) to destination 'localSettings'
Rules accumulate in settings.local.json and are all loaded into memory at init.
3. Duplicate Process Spawning
Logs show two separate Claude processes spawning on startup, each loading the full permission set and initializing MCP servers independently:
2026-01-28 00:18:03.338 [info] Spawning Claude with SDK query function - cwd: e:\GEEO-Ag
2026-01-28 00:18:04.023 [info] Spawning Claude with SDK query function - cwd: e:\GEEO-Ag
Failed Workarounds
| Attempt | Result |
|---------|--------|
| set NODE_OPTIONS=--max-old-space-size=8192 env var before launching VS Code | Raised crash from 2.2GB to ~3GB, still crashes |
| extensions.experimental.extensionHostNodeOptions in settings.json | Not respected |
| Deleted settings.local.json (248 → 27 rules) | Still crashes at 2.18GB |
| Disabled 2 of 3 MCP servers | Still crashes |
| Fresh VS Code profile, minimal extensions | Still crashes |
Working Workaround
CLI mode works perfectly:
cd e:\GEEO-Ag
claude
No memory issues with identical project and configuration.
System Specs
- Windows 11
- 32GB RAM
- VS Code latest stable
- Project: ~12 custom skills, 3 MCP servers
Suggested Investigation Areas
- Debounce/batch OAuth checks - 30+ simultaneous checks seems excessive
- Lazy load permissions - Don't load all rules into memory at once
- Single process initialization - Avoid spawning duplicate Claude processes
- Sequential MCP init - Initialize servers one at a time
Full debug logs available on request.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗