[BUG] Process leak: each new discussion opened in the VSCode extension spawns a new claude process without terminating previous ones
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?
Environment
Extension: anthropic.claude-code v2.1.228 (linux-x64)
VSCode: 1.132.1
OS: Linux 7.0.0-28-generic
Observed behavior
During normal use of the extension (opening several discussions/panels in VSCode over the course of a work session), I find multiple native claude processes running simultaneously, all children of the same VSCode extension host utility process:
$ ps -eo pid,ppid,etimes,cmd | grep "[/]claude "
69366 35452 3434 .../native-binary/claude --output-format stream-json ... (no --resume)
81706 35452 2714 .../native-binary/claude --output-format stream-json ... --resume=5eebed37-...
94025 35452 1996 .../native-binary/claude --output-format stream-json ... (no --resume)
121486 35452 487 .../native-binary/claude --output-format stream-json ... (no --resume)
4 claude processes, all attached to the same PPID (35452, a node.mojom.NodeService belonging to the VSCode extension host), with ages ranging from 8 min to 57 min. Only one of the four carries --resume=<uuid> (resuming an existing session); the other three are brand-new sessions (--setting-sources=user,project,local --permission-mode default, no --resume).
Impact
Native claude processes progressively accumulate and are not cleaned up over a long VSCode session (cumulative memory/CPU usage, potential resource exhaustion during an extended work session).
What Should Happen?
Either reuse/resume an existing session when reopening a discussion, or terminate the previous process when a new discussion replaces it — not accumulate several live native processes in parallel with no apparent link between them.
Error Messages/Logs
$ ps -eo pid,ppid,etimes,cmd | grep "[/]claude "
69366 35452 3434 .../native-binary/claude --output-format stream-json ... (no --resume)
81706 35452 2714 .../native-binary/claude --output-format stream-json ... --resume=5eebed37-...
94025 35452 1996 .../native-binary/claude --output-format stream-json ... (no --resume)
121486 35452 487 .../native-binary/claude --output-format stream-json ... (no --resume)
Steps to Reproduce
Open VSCode with the Claude Code extension installed.
Open several successive Claude discussions in the sidebar/panel over the course of the session (without explicitly closing previous ones).
Run ps -eo pid,ppid,etimes,cmd | grep "[/]claude " in a shell.
Observe several native processes alive at the same time, sharing the same PPID, most without --resume.
Claude Model
_No response_
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Extension: anthropic.claude-code v2.1.228 (linux-x64)
Platform
Other
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_