[BUG] VS Code Extension memory leak in code-server - RAM grows unbounded with empty panel

Status Fixed / completed
Reported on v2.1.12
Maintainer reply None cached
Activity 7 comments · opened Jan 19, 2026 · closed Jan 23, 2026

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 Claude Code VS Code Extension (v2.1.11) running in code-server causes an unbounded memory leak. RAM consumption grows continuously to 13GB+ simply by opening an empty Claude Code panel in the sidebar – without entering any prompts or performing any tasks.
Critical observation: The Claude Code CLI (v2.1.12) on the same system remains completely stable and shows no memory leak. This strongly indicates the issue is isolated to the VS Code Extension, specifically in the code-server environment.
The leak appears to be independent of:

User input or active sessions
MCP server configurations
Configured hooks
Installed plugins

What Should Happen?

Opening the Claude Code panel should:

Initialize with minimal, stable memory footprint
Maintain constant RAM usage when idle
Only increase memory proportionally to actual task complexity
Release memory after task completion

Expected idle memory consumption: ~100-2000MB (similar to CLI behavior)

Error Messages/Logs

=== Environment ===
Claude CLI Version: 2.1.12 (Claude Code)
Extension Version: 2.1.11
code-server Version: 4.106.2 904942a1944f66a886b0ec5c0c60f312d559a6e6 with Code 1.106.2
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
Node.js: v20.20.0
Linux vscode 6.8.12-17-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-17 (2025-11-21T11:16Z) x86_64 GNU/Linux

=== Memory Status ===
               total        used        free      shared  buff/cache   available
Mem:            14Gi       1.3Gi        12Gi       140Ki       132Mi        12Gi
Swap:             0B          0B          0B

=== Top Memory Processes ===
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
codedev    15927  1.1  2.2 33659116 336492 ?     Sl   11:38   0:12 /usr/lib/code-server/lib/node --dns-result-order=ipv4first /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false
codedev     5040  0.4  2.0 33628964 303412 ?     Sl   08:51   0:47 /usr/lib/code-server/lib/node --dns-result-order=ipv4first /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false
codedev     5300  0.1  1.6 11991516 236100 ?     Sl   08:52   0:22 /usr/lib/code-server/lib/node --use-system-ca /home/codedev/.local/share/code-server/extensions/gitlab.gitlab-workflow-6.64.1-universal/assets/language-server/main-bundle-node.js --stdio --clientProcessId=5040
codedev    16066  0.4  1.2 11930044 178360 ?     Sl   11:38   0:04 /usr/lib/code-server/lib/node --use-system-ca /home/codedev/.local/share/code-server/extensions/gitlab.gitlab-workflow-6.64.1-universal/assets/language-server/main-bundle-node.js --stdio --clientProcessId=15927
codedev      318  0.4  0.7 11889592 116848 ?     Sl   08:15   1:00 /usr/lib/code-server/lib/node /usr/lib/code-server/out/node/entry
codedev    16005  0.6  0.3 1393108 44620 ?       Sl   11:38   0:06 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=fileWatcher
codedev     5091  0.1  0.2 1262124 43776 ?       Sl   08:52   0:11 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=fileWatcher
codedev     1703  0.1  0.2 1127496 39884 ?       Sl   08:17   0:15 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=ptyHost --logsPath /home/codedev/.local/share/code-server/logs/20260119T081516
codedev       85  0.0  0.1 1117104 22924 ?       Ssl  08:15   0:00 /usr/lib/code-server/lib/node /usr/lib/code-server --config /home/codedev/.config/code-server/config.yaml
codedev    16161  0.2  0.1 1019068 19292 ?       Sl   11:38   0:02 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/extensions/markdown-language-features/dist/serverWorkerMain --node-ipc --clientProcessId=15927
codedev    19347  0.2  0.1 1016188 18992 ?       Sl   11:39   0:02 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=15927
root           1  0.0  0.0  23076  5596 ?        Ss   08:15   0:09 /sbin/init
root          44  0.0  0.0  50972  5180 ?        Ss   08:15   0:07 /usr/lib/systemd/systemd-journald
codedev     6388  0.0  0.0   6188  3968 pts/3    S    08:58   0:00 -bash

=== Extension Host Details ===
Extension Host PID: 5040
Name:   node
Pid:    5040
VmPeak: 33788300 kB
VmSize: 33628964 kB
VmRSS:    303412 kB
VmData:   384888 kB
Threads:        13

Memory Mappings (top 10):
   1069 
      9 /usr/lib/code-server/lib/node
      8 anon_inode:[io_uring]
      5 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.33
      5 /usr/lib/x86_64-linux-gnu/libpthread.so.0
      5 /usr/lib/x86_64-linux-gnu/libm.so.6
      5 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
      5 /usr/lib/x86_64-linux-gnu/libdl.so.2
      5 /usr/lib/x86_64-linux-gnu/libc.so.6
      5 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2

=== Claude Configuration ===
{
  "permissions": {
    "allow": [
      "Bash(glab issue create:*)",
      "Bash(glab label list:*)"
    ]
  },
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/docs-reminder.sh"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/docs-check.sh"
          },
          {
            "type": "command",
            "command": "~/.claude/hooks/auto-commit-push.sh"
          }
        ]
      }
    ]
  },
  "enabledPlugins": {
    "document-skills@anthropic-agent-skills": true,
    "example-skills@anthropic-agent-skills": true
  }
}

=== Temp Files ===
Claude temp files count: 2

=== code-server Processes ===
codedev       85  0.0  0.1 1117104 22924 ?       Ssl  08:15   0:00 /usr/lib/code-server/lib/node /usr/lib/code-server --config /home/codedev/.config/code-server/config.yaml
codedev      318  0.4  0.7 11889592 116848 ?     Sl   08:15   1:00 /usr/lib/code-server/lib/node /usr/lib/code-server/out/node/entry
codedev     1703  0.1  0.2 1127496 39884 ?       Sl   08:17   0:15 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=ptyHost --logsPath /home/codedev/.local/share/code-server/logs/20260119T081516
codedev     5040  0.4  2.0 33628964 303412 ?     Sl   08:51   0:47 /usr/lib/code-server/lib/node --dns-result-order=ipv4first /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false
codedev     5091  0.1  0.2 1262124 43776 ?       Sl   08:52   0:11 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=fileWatcher
codedev     5300  0.1  1.6 11991516 236100 ?     Sl   08:52   0:22 /usr/lib/code-server/lib/node --use-system-ca /home/codedev/.local/share/code-server/extensions/gitlab.gitlab-workflow-6.64.1-universal/assets/language-server/main-bundle-node.js --stdio --clientProcessId=5040
codedev    15927  1.1  2.2 33659116 336492 ?     Sl   11:38   0:12 /usr/lib/code-server/lib/node --dns-result-order=ipv4first /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false
codedev    16005  0.6  0.3 1393108 44620 ?       Sl   11:38   0:06 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/out/bootstrap-fork --type=fileWatcher
codedev    16066  0.4  1.2 11930044 178360 ?     Sl   11:38   0:04 /usr/lib/code-server/lib/node --use-system-ca /home/codedev/.local/share/code-server/extensions/gitlab.gitlab-workflow-6.64.1-universal/assets/language-server/main-bundle-node.js --stdio --clientProcessId=15927
codedev    16161  0.2  0.1 1019068 19292 ?       Sl   11:38   0:02 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/extensions/markdown-language-features/dist/serverWorkerMain --node-ipc --clientProcessId=15927
codedev    19347  0.2  0.1 1016188 18992 ?       Sl   11:39   0:02 /usr/lib/code-server/lib/node /usr/lib/code-server/lib/vscode/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=15927

Steps to Reproduce

  1. Install code-server on a Linux system
  2. Install Claude Code VS Code Extension (v2.1.11) in code-server
  3. Start code-server and open in browser
  4. Open the Claude Code panel via sidebar (Ctrl+Shift+P → "Claude Code: Open Panel" or click icon)
  5. Do not enter any prompts – leave the panel completely idle
  6. Monitor system memory: watch -n 5 'free -h'
  7. Observe RAM consumption growing continuously without bound
  8. Compare: Run claude CLI in separate terminal – remains stable

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.12 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

CLI vs Extension Isolation Test

| Interface | Memory Behavior | Result |
|-----------|-----------------|--------|
| Claude Code CLI (v2.1.12) | Stable ~150MB idle | ✅ No leak |
| Claude Code Extension (v2.1.11) in code-server | Unbounded growth to 13GB+ | ❌ Leaks |

This rules out system-level memory issues, Node.js runtime problems, and Claude backend/API issues.

Potentially Related Issues

  • #17650: Memory leak ~3GB within seconds (CLI, Linux) – CLI issue
  • #18280: Memory thrashing loop (CLI v2.1.7, Proxmox) – CLI with CPU
  • #12611: Extension host OOM crash (VS Code) – closed as duplicate
  • #13130: EventEmitter memory leak after Auto-Update
  • #11315: 129GB RAM consumed (CLI, Linux)

None exactly match: Extension in code-server leaking without activity while CLI remains stable.

Environment Details

  • code-server: 4.106.2
  • Proxmox LXC container
  • Kernel: 6.8.12-17-pve

View original on GitHub ↗

7 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/16508
  2. https://github.com/anthropics/claude-code/issues/15906
  3. https://github.com/anthropics/claude-code/issues/12611

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

roboticsalign · 7 months ago

👎

After reviewing the referenced issues in detail, this appears related to #15906 but documents a distinct trigger condition.

Relationship to #15906

#15906 documents worker process accumulation when creating multiple new chats – the leak scales linearly with chat count (N chats → N+2 processes).

This issue shows the leak occurring with a single open panel – no additional chats created, no prompts entered. The memory grows continuously from idle state.

Additional diagnostic value

  1. CLI vs Extension isolation: The CLI (v2.1.12) on the same system remains stable (~150MB), proving this is Extension-specific. This comparison is absent from #15906.
  1. Single-panel trigger: This suggests the leak mechanism activates on panel open, not only when accumulating chats – potentially narrowing down the root cause.

If maintainers consider this a duplicate of #15906, I can add this data as a comment there instead.

roboticsalign · 7 months ago

Root Cause Identified: Native Binary Memory Leak

After active monitoring and analysis, I've identified the actual source of the memory leak:

Finding

The leak is NOT in extension.js but in the native binary:

/path/to/extensions/anthropic.claude-code-2.1.11-linux-x64/resources/native-binary/claude

Live Observation

| Time | System RAM | Native Binary RSS |
|------|------------|-------------------|
| 0s | 1.6 GB | (just started) |
| 60s | 5.8 GB | 5.8 GB |

Leak rate: ~70 MB/second - the binary grew from 0 to 5.8 GB in under 60 seconds while idle (no prompts entered).

Key Distinction

  • Extension Host processes: Remained stable at ~300-370 MB
  • Native binary (resources/native-binary/claude): Leaked to 5.8 GB+
  • CLI (claude from npm): Stable at ~300 MB

This explains why the CLI works fine but the Extension leaks - they use different binaries.

Workaround Tested

Setting "claudeCode.useTerminal": true prevents the leak by using the stable CLI instead of the native binary. However, this disables Webview features (drag & drop, etc.).

Recommendation

The fix needs to address the native binary in resources/native-binary/, not the JavaScript code. The binary appears to have an unbounded memory growth pattern even when idle.

---
Analysis performed by monitoring memory in real-time while opening an empty Claude Code panel

ghost · 7 months ago

Glad someone filed the issue, I had this problem on my pc (Linux mint with 16 GB RAM), but it seems that it is not on my laptop (also Linux mint with 8GB RAM) and the ram and CPU usage is stable , but I am no coder/ developer, so I had no idea what is happening, or what to inspect, but I wanted to tell that the issue is not on all Ubuntu and Debian Linux instances, maybe that could help, and if you want me to record or give you any data regarding the laptop configurations, just tell me what you need, I will be glad to help 🙏🏻

roboticsalign · 7 months ago

Thanks for your feedback.

Did you ask claude code to find the root cause for you on the affected pc?

roboticsalign · 7 months ago

Resolved

Issue fixed with version 2.1.17 — memory leak no longer occurs.

Thanks for the fix!

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.