VS Code and Claude Code Refuse to send any Requests on Large Projects
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?
Description
The Claude Code native binary silently exits (exit code 0, no error, no output) when a workspace's .claude/settings.local.json accumulates too many entries in permissions.allow + permissions.additionalDirectories combined. The binary completes initialization (TLS, certs, policy limits) but never reaches the STARTUP phase or makes an API call.
This manifests as "Query closed before response received" in VS Code and the Claude desktop app Code tab, while Chat tab and CLI from other directories work fine.
Reproduction Steps
- Create
.claude/settings.local.jsonin a workspace with ~48 allow rules + ~6+ additionalDirectories - Run:
claude -p "hello" < /dev/nullfrom that workspace - Binary exits with code 0, no stdout, no stderr
- Run from
/tmpwith sameCLAUDE_CONFIG_DIR— works fine
Root Cause (Verified)
Bisected via --debug-file:
- Working (from /tmp): Debug log shows full
[STARTUP]sequence (MCP configs, setup, skills, LSP, API call) — 245+ log lines - Failing (from workspace): Debug log stops after
Policy limits: Applied new restrictions successfully— only 25 log lines, never reaches[STARTUP]
Reducing additionalDirectories from 12 to 3 entries (keeping all 48 allow rules) fixes the issue. The threshold appears to be related to total combined size/count of settings entries across user + local settings files.
Environment
- OS: Windows 11 Enterprise 10.0.26100
- Claude Code: 2.1.132 and 2.1.133 (both affected)
- Context: VS Code extension, desktop app Code tab, and standalone CLI
-pmode all affected when run from the workspace directory
Expected Behavior
The binary should either:
- Process the settings normally regardless of count, OR
- Log an error/warning if a limit is exceeded, instead of silently exiting with code 0
Workaround
Trim additionalDirectories in .claude/settings.local.json to reduce combined entry count. In my case, reducing from 12 to 3 directories fixed it.
Related Issues
- #50616 — similar symptoms (silent exit after "No git remote URL found") but different root cause
- #51732 / #49522 — same error message, different trigger
What Should Happen?
I shouldn't received "Query closed before receiving response" or similar messages in Claude Code app Code tab or Visual Studio Code.
Error Messages/Logs
Steps to Reproduce
- Load Visual Studio Code
- click File => Open Folder and open a folder that has many connected folders and directories, local or remote in context history
- type a question or comment
- receive error sending before response received.
alternative path
- sign out of your claude code account from within VS Code
- try to reauthenticate
- receive error: "Query closed before response received."
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.133
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗