[WSL] Every Claude Code process spawns `reg.exe` twice via WSL interop to read managed-settings policy
Status Open
Reported on v2.1.295
Maintainer reply None cached
Activity 0 comments · opened Oct 9, 2026
Environment
- Claude Code 2.1.295 (npm, Node 22), Linux inside WSL2
- WSL 2.6.3.0 at the time of measurement (later updated to 3.0.1.0), kernel 6.18.x
- Windows 11, 63 GB RAM
What happens
On WSL, each Claude Code process start (interactive session, claude -p, background session, claude plugin eval child, etc.) runs these two commands through WSL interop:
/mnt/c/Windows/System32/reg.exe query HKLM\SOFTWARE\Policies\ClaudeCode /v Settings
/mnt/c/Windows/System32/reg.exe query HKCU\SOFTWARE\Policies\ClaudeCode /v Settings
Sampling ps for 60 seconds while ~10 Claude Code sessions were running observed 10 interop reg.exe processes (2 per Claude Code process start).
Why it matters
- Each interop call needs a new Hyper-V socket (hvsocket) channel from Windows to the WSL VM. During an incident where Windows could not hand out new hvsocket channels (
WSAENOBUFS/0x80072747; new WSL terminals failed to open,UtilAcceptVsock: accept4 failed 110in the VM), every interop call hung ~10 s and then failed. Claude Code startup was delayed by these two lookups each time. - With many concurrent sessions (orchestration, background jobs, plugin eval runs), these lookups add steady interop traffic on top of whatever else is running. We cannot claim they caused the exhaustion, but they contribute load and they make Claude Code start slowly exactly when WSL interop is degraded.
Expected
One of:
- Skip the Windows registry policy lookup by default inside WSL (Linux managed settings at
/etc/claude-code/managed-settings.jsonalready exist), or make it opt-in via an env var / setting. - Cache the result (per boot or with a TTL) instead of querying on every process start.
- At minimum, use a short timeout and do not block startup on it.
Repro
- In WSL2 with interop enabled, run in one terminal:
while true; do ps -eo pid,ppid,args | grep -F 'reg.exe query' | grep -v grep; sleep 1; done
- In another terminal, run
claude -p "hi"a few times. - Observe two
reg.exe query …\Policies\ClaudeCode /v Settingsprocesses per run.
Related
- #52318 (closed): startup crash on WSL2 when interop is unavailable while spawning
reg.exe— same lookup, different failure mode.