claude-code - 💡(How to fix) Fix [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"

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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. Even claude --debug --verbose -p "say hello" *> file.txt 2>&1 writes 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 lines Error spawning Claude (on channel ...), Failed to load config cache: ... Query closed before response received, and Channel 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.

Error Message

[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>

Root Cause

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. Even claude --debug --verbose -p "say hello" *> file.txt 2>&1 writes 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 lines Error spawning Claude (on channel ...), Failed to load config cache: ... Query closed before response received, and Channel 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.

Code Example

[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>

---

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"
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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. Even claude --debug --verbose -p "say hello" *> file.txt 2>&1 writes 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 lines Error spawning Claude (on channel ...), Failed to load config cache: ... Query closed before response received, and Channel 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 --version2.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 -p instead 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 --version fine. Not it.
  • PowerShell execution policy: was Restricted (blocked npm/.ps1 shims); set to RemoteSigned. Fixed that separate issue; query still fails.
  • PATH: claude resolves correctly; C:\Users\<user>\AppData\Roaming\npm present on PATH.
  • Duplicate installs: had npm-global + a native install; collapsed to one. No change.
  • Config size/corruption: ~/.claude.json and 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.json is large-but-valid permissions only; one Playwright MCP server in a subfolder. Not the cause.
  • Network: curl https://api.anthropic.com/v1/models returns HTTP 401 in ~0.07s, both with and without Tailscale. No HTTPS_PROXY, no ANTHROPIC_BASE_URL.
  • Tailscale: failure occurs with it on or off.
  • Microsoft Defender: no ASR rules configured (AttackSurfaceReductionRules_Ids empty), no threat detections (Get-MpThreatDetection empty).
  • 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.exe existed, 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_PATH made 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 claude frozen 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

  1. Windows 11, Claude Code 2.1.158, authenticated.
  2. claude --version → works.
  3. claude -p "say hello" → no output, exit 0.
  4. claude (interactive) → cursor shows, keyboard input not accepted.
  5. 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. Even claude --debug --verbose -p "say hello" *> file.txt 2>&1 writes 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 lines Error spawning Claude (on channel ...), Failed to load config cache: ... Query closed before response received, and Channel 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [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"