[BUG] Claude Code query worker dies silently on Windows — `--version` works, but every query produces no output (exit 0); VS Code extension shows "Query closed before response received"
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?
Bug Report: Claude Code query worker dies silently on Windows — --version works, but every query produces no output (exit 0); VS Code extension shows "Query closed before response received"
Summary
On a Windows 11 machine, Claude Code launches and reports its version correctly, but no query ever completes in any client:
- CLI, print mode (
claude -p "say hello"): produces zero output and exits with code 0. Evenclaude --debug --verbose -p "say hello" *> file.txt 2>&1writes 0 bytes to the file. - CLI, interactive (
claude): the TUI renders a blinking cursor but does not accept any keyboard input (cannot type, arrow keys dead). - VS Code extension:
Error: Query closed before response received, with log linesError spawning Claude (on channel ...),Failed to load config cache: ... Query closed before response received, andChannel not found. - Desktop app (Claude Code panel): hangs / same "Query closed before response received".
Regular Claude (claude.ai in the browser, and the Claude desktop app's normal chat) works perfectly on the same machine and network. The common factor in everything that fails is that it is Claude Code spawning/executing a query worker, while plain chat (which does not) is fine.
Onset
The setup was working, then broke mid-session (evening of ~2026-05-30). Two already-open sessions kept working; every newly opened session/tab failed in the manner above. This pattern is consistent with a background auto-update swapping in a new build mid-use (running processes kept the old in-memory version; new spawns hit the new build). No code, config, or repo changes were made by the user at that time.
Environment
- OS: Windows 11 (x64)
- Claude Code version: 2.1.158 (also reproduced after rolling the npm CLI back to 2.1.113)
- Installed surfaces (all reproduce the failure):
- npm global:
C:\Users\<user>\AppData\Roaming\npm\node_modules\@anthropic-ai\claude-code\bin\claude.exe - VS Code extension:
C:\Users\<user>\.vscode\extensions\anthropic.claude-code-2.1.158-win32-x64\resources\native-binary\claude.exe - Desktop app:
...\AppData\Local\Packages\Claude_*\LocalCache\Roaming\Claude\claude-code\2.1.156\claude.exe - Node.js: system install at
C:\Program Files\nodejs - Git for Windows installed (
C:\Program Files\Git\bin\bash.exe) - Personal (non-managed) machine. Also runs Tailscale and Docker Desktop.
Key diagnostic signature
claude --version→2.1.158 (Claude Code)(works instantly; binary executes and writes stdout fine).claude -p "say hello"(with valid auth) → no output, exit 0.claude --debug --verbose -p "say hello" *> "$env:USERPROFILE\cc-debug.txt" 2>&1→ file is 0 lines, exit 0. (No debug output is produced on any stream, which is the most unusual part.)- With no auth,
claude -pinstead prints "configuration file not found" — i.e., it short-circuits at the auth check; with valid auth it proceeds past auth and then dies silently. So auth is not the issue. - Modes where the prompt is passed as an argument start up; modes that rely on stdin (interactive raw-mode input, and the VS Code extension's stream-json channel) fail. The query itself never returns output regardless.
VS Code extension log (channel: "Claude VSCode")
[info] ... (loads permissions from .claude/settings.local.json) ...
[DEBUG] Git remote URL: null
[DEBUG] No git remote URL found
[info] Closing Claude on channel: <id>
[error] Error spawning Claude (on channel <id>): Error: Query closed before response received
[info] OAuth tokens found in secure storage
[error] Failed to load config cache: Error: Query closed before response received
[info] Getting authentication status
[info] OAuth tokens found in secure storage
[error] Error processing client request: Error: Query closed before response received
[info] Received message from webview: {"type":"interrupt_claude","channelId":"<id>"}
[warning] Channel not found: <id>
What was ruled out (with evidence)
- Install / corruption: clean uninstall + reinstall of npm package and VS Code extension; bundled extension binary runs
--versionfine. Not it. - PowerShell execution policy: was
Restricted(blocked npm/.ps1shims); set toRemoteSigned. Fixed that separate issue; query still fails. - PATH:
clauderesolves correctly;C:\Users\<user>\AppData\Roaming\npmpresent on PATH. - Duplicate installs: had npm-global + a native install; collapsed to one. No change.
- Config size/corruption:
~/.claude.jsonand all backups are 0–0.03 MB and valid JSON. Not bloated/corrupt. - Project/repo: clean working tree, no recent commits; project
.claude/settings.local.jsonis large-but-valid permissions only; one Playwright MCP server in a subfolder. Not the cause. - Network:
curl https://api.anthropic.com/v1/modelsreturns HTTP 401 in ~0.07s, both with and without Tailscale. NoHTTPS_PROXY, noANTHROPIC_BASE_URL. - Tailscale: failure occurs with it on or off.
- Microsoft Defender: no ASR rules configured (
AttackSurfaceReductionRules_Idsempty), no threat detections (Get-MpThreatDetectionempty). - Trend Micro AV: fully uninstalled + rebooted (confirmed no Trend Micro services/processes remain). Query still fails. (Note: a pre-existing Trend Micro file-exclusion for
bash.exeexisted, suggesting Claude Code's child processes had been flagged before — but removing Trend Micro entirely did not fix it.) - Auth: restored OAuth token from backup
~/.claude.json.bak. Query still produces no output. - CLI version: reproduced on 2.1.158 and 2.1.113.
- Git Bash path: setting
CLAUDE_CODE_GIT_BASH_PATHmade no difference.
Hypothesis
Claude Code's query/worker fails to execute in this Windows environment — the worker is spawned and immediately closes ("Query closed before response received"), producing no output or logs, while the parent exits 0. The arg-based startup path works (--version, auth check), but the actual query execution and stdin-based paths do not.
Possibly related existing issues
- #57242 — Windows 11: interactive
claudefrozen in all terminals - #7171 — Interactive mode freezes on Windows after setup
- #9929 — Interactive mode frozen on Windows 11 (raw mode not supported)
- #51732 — VS Code extension "Query closed before response received" on Windows 11
- #50616 — Claude Code CLI hangs & VS Code extension errors on Windows
Minimal repro
- Windows 11, Claude Code 2.1.158, authenticated.
claude --version→ works.claude -p "say hello"→ no output, exit 0.claude(interactive) → cursor shows, keyboard input not accepted.- VS Code extension new session → "Query closed before response received".
Where to file
Submit at: https://github.com/anthropics/claude-code/issues/new
(Search first for the related issues above; this may be additional reproduction detail for #51732 / #57242.)
What Should Happen?
Claude Code query worker dies silently on Windows — --version works, but every query produces no output (exit 0); VS Code extension shows "Query closed before response received"
Error Messages/Logs
Claude Code query worker dies silently on Windows — `--version` works, but every query produces no output (exit 0); VS Code extension shows "Query closed before response received"
Steps to Reproduce
Summary
On a Windows 11 machine, Claude Code launches and reports its version correctly, but no query ever completes in any client:
- CLI, print mode (
claude -p "say hello"): produces zero output and exits with code 0. Evenclaude --debug --verbose -p "say hello" *> file.txt 2>&1writes 0 bytes to the file. - CLI, interactive (
claude): the TUI renders a blinking cursor but does not accept any keyboard input (cannot type, arrow keys dead). - VS Code extension:
Error: Query closed before response received, with log linesError spawning Claude (on channel ...),Failed to load config cache: ... Query closed before response received, andChannel not found. - Desktop app (Claude Code panel): hangs / same "Query closed before response received".
Regular Claude (claude.ai in the browser, and the Claude desktop app's normal chat) works perfectly on the same machine and network. The common factor in everything that fails is that it is Claude Code spawning/executing a query worker, while plain chat (which does not) is fine.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.158 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗