Direct answer
A Claude Code memory warning is not automatically a measurement of the Claude process. In community issue #33426, a 13.38 GB warning appeared after /clear while Windows Task Manager showed roughly 2 to 3 GB for VmmemWSL. The issue closed as a duplicate of #32770, which reports that monitoring included system-wide processes.
Before killing anything, measure the Windows CLI process, the WSL virtual machine, subagent processes and MCP server processes separately. Official: Anthropic’s troubleshooting guidance recommends /compact or a restart for memory and hang symptoms. Unknown: the supplied record provides no official fix version or universal memory threshold.
Why the wrong number leads to the wrong cleanup
Memory has several meanings. Private bytes describe memory committed to one Windows process. A working set describes pages currently resident for that process. Linux RSS, resident set size, is another process-level view. VmmemWSL represents the WSL virtual machine, which can hold memory for many Linux processes at once. A system-wide metric can be larger still.
Those values answer different questions. Comparing a system total with one process column can manufacture a crisis. A comparison with a Linux process can also mislead, because the VM contains more than that process. The right first question is not “Why is Claude using so much?” It is “Which process or layer produced this number?”
A blind cleanup can cost more than the warning. Killing every node process may stop an unrelated development server, editor helper or test runner. Restarting WSL can close unsaved terminal work. Deleting task directories can remove evidence before anyone knows whether a session still references them.
The useful win is a small measurement worksheet. It turns a scary banner into a baseline, a controlled change and a recovery check. The Windows subagent MCP memory investigation goes deeper on duplicate processes and stale task folders, while this guide focuses on what each memory number actually covers.
What the warning measures
Issue #33426 supplies the key contrast. Community: the author saw a 13.38 GB warning after /clear, while Windows Task Manager showed roughly 2 to 3 GB for VmmemWSL. The issue was closed as a duplicate rather than fixed. This distinction matters. A duplicate label points to an existing report, not an official root-cause statement.
Issue #32770 reports that the monitoring included system-wide processes. It closed as NOT_PLANNED, with no official fix version in the supplied record. The report supports a measurement-scope hypothesis. It does not prove that every warning is wrong or that Claude never consumes substantial memory.
Use a scope label beside every measurement. “Claude private bytes,” “WSL VM private bytes,” “sum of identified MCP process private bytes” and “Linux free memory” are different rows. Do not shorten all of them to “Claude memory.” The label is what makes the worksheet auditable.
| Layer | Example surface | What it can include | What it cannot prove alone |
|---|---|---|---|
| Windows CLI process | claude.exe private bytes or working set |
Memory attributed to that process | Total WSL or subagent memory |
| WSL virtual machine | VmmemWSL, when exposed to Windows tools |
Memory used by the Linux VM and its processes | Which Linux process caused growth |
| Linux process | RSS from a process listing | Resident memory attributed to a process | Exact Windows private-byte accounting |
| MCP server process | Identified server process and children | Server runtime, caches and request state | Whether duplication is a defect |
| System-wide telemetry | Warning source or host-wide query | Multiple processes and kernel accounting | A Claude-specific leak |
Official: custom subagents normally run in the background, and permission prompts appear in the main session. This lifecycle matters because a warning may persist while a child task is still active or while its state is being reconciled. The background running-count diagnosis explains why the displayed count is not always the source of truth.
VmmemWSL versus claude.exe
VmmemWSL is the Windows-facing VM process for WSL. A value attached to it can move when Linux workloads start and stop. It is not a direct substitute for the memory of claude.exe, and it is not a direct substitute for one Linux process inside the VM.
The reported 21.7 GB value in issue #32304 belongs to claude.exe, not to a universal WSL baseline. Community: that report described claude.exe growing to about 21.7 GB during a session with subagents. It closed as a duplicate of #28126. Do not call 21.7 GB typical, and do not combine it with the 13.38 GB report as if they were measurements from the same scope.
A process can release memory slowly after a task ends. Caches may remain, and the operating system may keep pages resident even when they are eligible for reuse. A post-task snapshot therefore needs a recovery interval and a second snapshot. The fact pack does not define how long that interval should be, so choose one before the test and record it as part of your method.
For a Windows process, collect the same metric before and after. Private bytes and working set can move differently. Capture both rather than selecting whichever produces the more dramatic chart. For Linux processes, use RSS consistently and note that the values are not directly interchangeable with Windows counters.
A process identity check
A process name is not enough. Two Node processes can belong to unrelated projects. Note the process ID, parent process ID, start time and a redacted command line before stopping anything. Match the parent to the CLI session you intend to affect.
The settings-file secret exposure guide is a reminder that command lines and environment captures can carry credentials. Preserve the local evidence intact, but remove secrets before sharing a report.
MCP server overhead
MCP stands for Model Context Protocol. An MCP server exposes tools or context to the agent through a separate server process or connection. Each server has its own runtime and memory behavior. Several servers can be configured, and subagents can add more activity.
Issue #28126 reports duplicate MCP server processes on Windows and links the behavior to a v2.1.50 MCP discovery change. Community: that causal explanation came from the user, not an official maintainer statement. The same issue reports that interrupted sessions could leave ~/.claude/tasks/{uuid}/ directories. Those directories are storage artifacts, not proof of memory consumption.
A controlled comparison can still be useful. Capture the identified server processes at idle. Start one bounded, read-only subagent task. Repeat the same process fields after it finishes. Stop the task through the documented cancellation path, then observe whether the identified child processes exit.
Do not label every additional Node process a duplicate. Compare command identity, configuration, parentage and timing. A new process may be expected, and a persistent process may be shared. “Duplicate candidate” is the honest label until the evidence establishes otherwise.
Official: the default concurrent subagent limit is 20, adjustable with CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS. This number is a concurrency limit, not a promise that 20 subagents fit comfortably in a given machine’s memory. Set a team limit from measured workload and available RAM, not from the default alone.
A measurement worksheet
Start with a quiet baseline. Close unrelated heavy workloads if possible, or record them so they do not masquerade as Claude growth. Hold the repository and task constant. A memory comparison without a baseline is just a collection of large numbers.
On Windows, this read-only command lists the relevant process names with consistent units:
Get-Process claude, node, VmmemWSL -ErrorAction SilentlyContinue |
Select-Object Id, ProcessName, StartTime,
@{Name='PrivateMiB';Expression={[math]::Round($_.PrivateMemorySize64 / 1MB, 1)}},
@{Name='WorkingSetMiB';Expression={[math]::Round($_.WorkingSet64 / 1MB, 1)}}
VmmemWSL may not be exposed on every setup. An absent row is not a zero reading. It means this collection method did not return that process.
Inside WSL, use a process listing and a host memory view:
ps -eo pid,ppid,rss,etime,comm,args --sort=-rss
free -h
The process listing helps identify children. A host memory view explains pressure without attributing it to Claude. Capture both with timestamps.
| Worksheet field | Baseline | After one subagent | After cancellation | Recovery check | Notes |
|---|---|---|---|---|---|
| Timestamp and terminal route | Record | Record | Record | Record | Keep WSL and IDE routes distinct |
Identified claude.exe private MiB |
Measure | Measure | Measure | Measure | Same process ID if possible |
| Identified MCP process IDs | List | List | List | List | Redact command lines |
| Linux process RSS | Measure | Measure | Measure | Measure | Record PID and PPID |
VmmemWSL private MiB |
Measure if exposed | Measure if exposed | Measure if exposed | Measure if exposed | VM scope, not process scope |
| Linux memory view | Capture | Capture | Capture | Capture | Do not attribute host pressure automatically |
| Warning text and scope | Capture | Capture | Capture | Capture | Quote the exact metric name |
Derived formula: process delta in MiB equals the later private-byte value divided by one MiB, minus the baseline private-byte value divided by one MiB. Use the same process ID and the same counter. If the process restarted, report the old and new processes separately instead of calculating a continuous delta.
Derived formula: aggregate identified MCP private MiB equals the sum of private bytes for the recorded MCP process IDs divided by one MiB. This aggregate is not equal to total WSL memory. It excludes the VM, kernel, other Linux processes and any server that was not identified.
Leave cells blank until you measure them. An illustrative number in a worksheet can easily become a fake benchmark after a screenshot circulates. The useful output is a method another developer can repeat.
Repeat the worksheet after a client update or a server configuration change. Retain the prior sheet as a comparison, but do not merge counters from different process IDs. If the new run uses a different WSL route or a different set of MCP servers, label that difference before interpreting the trend. A clean method survives an inconclusive result.
Worked example: a bounded reproduction
Choose a read-only task with a clear finish condition. Ask one subagent to inspect a small directory and return a list of candidate files. Do not allow edits, package installation or external writes during the memory test.
Record the baseline process IDs and counters. Start the subagent and note its task identifier. While it runs, capture a second process listing. When it reports completion, use /tasks to inspect state before cancelling anything. The official subagent documentation says stopped subagents do not auto-resume when messaged, while completed subagents can be resumed with conversation history.
If the UI still shows a task running after completion, do not assume it is consuming memory. Community issue #348900 reports that background subagents can finish while the UI count remains stale and stopping can fail with “No task found.” Verify the process and result first.
After cancellation, record which identified child processes exit and which remain. Wait for the recovery interval you chose, then measure again. If a candidate duplicate remains, preserve its process identity and open a focused report. When memory falls without process changes, record that outcome too. The test is successful when it narrows the explanation, not when it confirms a leak.
Measurement has a cost too. Capturing frequent full process lists can add noise and expose command lines that should stay local. Choose a few meaningful moments instead: idle, active, cancelled and recovered. Keep raw captures access-controlled and share only redacted fields.
Reducing concurrency trades throughput for headroom. Disabling an optional MCP server trades a capability for a cleaner test. Neither choice proves the original warning was caused by that server or by subagents. Apply one change, repeat the same worksheet and keep the result even when it contradicts the hypothesis.
Safe cleanup
Use the least disruptive action that fits the evidence. A permission prompt is not a hang by default. Official: permission prompts appear in the main session, and users can stop a subagent with Esc on a permission prompt or through /tasks. Try that path before touching process IDs.
| Evidence | Safe action | Avoid | Why |
|---|---|---|---|
| A subagent is waiting on permission | Review the prompt, then approve, deny or stop it | Killing the parent CLI | The task may need a human decision |
/tasks shows an active child |
Stop that task and observe its identified processes | Killing every Node process | Unrelated services may share the runtime |
| A specific orphan candidate is verified | Record its PID and command identity, then stop that PID only | Stopping by image name | Process names do not establish ownership |
| WSL remains under pressure after Claude exits | Save terminal work, then consider a deliberate WSL restart | Restarting during an active write | A restart can interrupt unsaved work |
| Official memory or hang symptom persists | Use /compact or restart the client as troubleshooting guidance |
Repeated restarts without evidence | They can erase the comparison |
| Task folders remain after interruption | Preserve and inventory them | Bulk deletion before output review | They may contain the only task record |
A PID-targeted stop should follow your normal operations policy. Verify start time, parent and redacted command line immediately before acting. The repository’s own process rule is the same: kill by PID only, never by image name.
If a WSL restart is justified, warn other terminal users and save work first. It is a broad action, not a Claude-specific cleanup. Log it as a disruptive recovery step with an owner.
When cleanup does not help
A restart can restore availability without explaining the warning. If memory climbs again on the same bounded task, keep the new baseline and compare it with the old one. Do not label the restart a fix just because the immediate pressure fell.
Check whether the workload changed. A new MCP server, a larger repository or more concurrent subagents can increase memory without a product defect. Record those differences before escalating. A comparison that changes both workload and client version cannot isolate either one.
If the same process keeps growing across repeated runs, attach the process-level evidence to the report. Include the counter name, timestamps, task boundaries and recovery observations. Avoid a headline built from the largest number alone. The useful claim is that an identified process grew under a stated workload, not that Claude Code always leaks.
If the warning falls but the process counters do not move the way you expected, keep both results. Different counters can lag or retain pages. The fact pack does not define their release timing, so an unexplained difference should stay visible rather than being rounded into a clean story.
Prevention controls
Reduce simultaneous work when a machine is already constrained. Limit optional MCP servers for the task, cap subagent concurrency below the team’s measured comfortable level and avoid overlapping large tool outputs. These are engineering controls, not a published memory formula.
Keep long sessions bounded. /compact or a restart may help with official memory and hang symptoms, but compaction changes conversation state and can have its own cost. The compaction cost worksheet helps decide whether restarting or summarizing is the better operational choice.
Use parallel-agent worktree isolation when simultaneous sessions edit files. Worktrees reduce checkout collisions, but they do not reduce process memory automatically. They also share some project state, so resource limits still matter.
Monitor trends rather than one peak. A process list after idle, after a subagent and after recovery is more informative than a single Task Manager screenshot. Keep the metric names in the trend so later comparisons do not mix private bytes, working set and RSS.
Give the worksheet an owner and a retention rule. It may contain internal paths, usernames and redacted command structure. Store it with the team’s diagnostic records rather than in a public issue attachment. Record the client version and WSL launch route so a later run can be compared fairly.
Set an escalation condition before the test. For example, the team can decide to investigate when an identified process keeps growing across repeated bounded tasks and does not recover after cancellation. That condition is a local operating rule, not a Claude Code defect threshold. Write it down so the response does not depend on who sees the largest number.
Honest loss and future updates
Community: the 13.38 GB warning and the 21.7 GB claude.exe report are individual observations. Neither is a typical value. The memory-monitoring issue closed as NOT_PLANNED, and the duplicate process report has no official fix version in the supplied record.
Unknown: there is no public per-process attribution for the warning, no controlled memory benchmark and no documented guarantee that a given cleanup releases memory within a fixed interval. A future update should capture a fresh version, process identities and consistent counters before changing these conclusions.
The practical implication is to make scope part of every memory alert. An alert that says “system-wide telemetry increased” needs a different response from one that says “this identified CLI process doubled its private bytes.” Good telemetry makes that distinction visible.
The honest verdict is that the warning needs attribution before action. Public reports justify measuring process identity and scope. They do not justify treating every large value as a Claude leak or every restart as a cure.
Future evidence should include a consistent counter, the exact terminal architecture, identified child processes and a recovery observation. With those fields, a later maintainer response can be tested against a real reproduction. Without them, another large screenshot will only restart the argument.
FAQ
Is 13.38 GB a normal Claude Code WSL2 footprint?
No such claim is supported. It is one community warning report. The same report showed roughly 2 to 3 GB for VmmemWSL, and the linked issue says monitoring included system-wide processes. Measure your own scope before drawing a conclusion.
Why does VmmemWSL stay high after Claude closes?
The VM can retain memory for Linux workloads, caches and other processes. No release timeline is provided in the fact pack. Record a baseline and recovery interval, identify active processes, then consider a deliberate WSL restart only after saving terminal work.
Should I kill all Node processes to clear MCP memory?
No. Verify process ID, parent, start time and command identity. Stop only the process you have tied to the affected session. The Windows MCP containment runbook provides the focused sequence.
Does /clear free Claude Code memory?
The supplied sources do not promise that. Issue #33426 observed a warning after /clear. Official troubleshooting recommends /compact or a restart for memory and hang symptoms, but neither is a measured guarantee of immediate release.
Connected Claude Code troubleshooting
Windows and desktop paths: WSL IDE environment-variable diagnosis, Windows subagent MCP memory investigation, VS Code WebSocket regression test, and desktop browser-pane crash recovery.
Subagent operations: subagent hang and timeout controls, background running-count diagnosis, stop and resume semantics, parallel-agent worktree isolation, and context isolation and duplicate-work analysis.
Costs and quotas: compaction cost worksheet, prompt-caching break-even math, idle-session cache-miss analysis, long-context prefill latency test, MCP output truncation guide, usage tracking and cost API guide, task budgets versus hard stops, 429 decision tree, billing-dispute evidence packet, and refund and support policy guide.
Security and codebase work: hallucinated-package supply-chain controls, GitHub Actions secret boundaries, repository-hook security review, extension-trojan remediation, CVE-2026-55607 sandbox boundary, auto-mode classifier limitations, destructive git guardrails, generated-test oracle bias, monorepo search and token budget, and legacy-code characterization workflow.
A practical OpenAI-format alternative after measurement
One AI API Key is a separate OpenAI-format testing route, not a memory cleanup tool. On 2026-11-27, the 46 live free model IDs covered 22 families. They shared 100 requests and 5,000,000 tokens per day per account, reset at 05:30 IST or 00:00 UTC. Accounts could have up to three keys, with one request in flight per key on free models.
Use an OpenAI-format agent such as OpenCode, Cline or Cursor with https://api.oneaiapikey.com/v1, one key and a selected free ID. The quickstart covers endpoint setup. Format differences matter because an OpenAI-format request should not be copied into an Anthropic-format client without adaptation, as the comparison guide explains.
Availability boundary: the documented Claude Code route uses the Anthropic-format endpoint, but all four Claude IDs were marked unavailable on 2026-11-27. Free IDs are OpenAI-format only and do not work inside Claude Code. Check the current catalogue and live status before a new test instead of treating this dated snapshot as a live promise.
New accounts received $10 credit without a card. The prepaid pricing page states that there is no subscription or seat fee. Use per-key controls to cap exposure and the cost calculator to compare a bounded workload. Review the privacy policy, including the boundary that upstream providers receive requests under their own terms.
Keep the memory test on one dedicated key with a selected-model allowlist, expiry and request-level usage records. The gateway says it does not train on prompts and leaves prompt logging off by default. Those first-party statements do not change upstream provider terms. Avoid relying on automatic cross-model fallback because the supplied documentation conflicts on whether a different model can answer.
A useful comparison keeps the same diagnostic prompt, tool permissions and acceptance check across agents. Record process memory, completion and human review time separately. A different model route does not remove local MCP or WSL overhead. Create an account only if that separate experiment fits the team’s data and budget rules.
Sources
- Official Claude Code troubleshooting guidance
- Official subagent concurrency and lifecycle documentation
- Community issue #33426 on the 13.38 GB warning
- Community issue #32770 on system-wide memory metrics
- Community issue #28126 on duplicate MCP processes
- Community issue #32304 on
claude.exegrowth - Community VS Code issue #348900 on background task state