VS Code extension crashes when searching directories containing .claude/settings.local.json with invalid paths

Resolved 💬 3 comments Opened Dec 8, 2025 by ant-bouff Closed Dec 8, 2025

NOTE: There was a real issue when Claude tried to process a file in a specific user's sandbox, but I authorized it to submit the bug report without noticing it had changed the steps in a way that was not reproducible–sorry about that!

Description

The VS Code extension crashes/disconnects when using search tools (Glob, Grep, Read) on directories that contain a .claude/settings.local.json file with invalid paths. The extension appears to load and process settings files from directories being searched through, not just the current working directory.

Steps to Reproduce

  1. Have a directory structure like:

``
/Users/userA/code/repo/sandbox/userB/.claude/settings.local.json
``

  1. The settings.local.json contains paths that don't exist on your machine:

``json
{
"permissions": {
"additionalDirectories": ["/Users/userB/Documents"]
},
"enableAllProjectMcpServers": true,
"enabledMcpjsonServers": ["asana"]
}
``

  1. From userA's working directory, ask Claude to search for files in userB's sandbox
  2. Extension crashes with stream disconnection errors

Error Messages

Tool permission request failed: Error: Tool permission stream closed before response received
Tool permission request failed: Error: Stream closed

Expected Behavior

  1. The extension should only load settings for the current working directory, not for arbitrary directories being searched through
  2. If it does encounter settings files, it should gracefully handle invalid paths (log a warning, skip the invalid entries) rather than crashing
  3. Missing additionalDirectories paths should not cause a fatal error

Environment

  • VS Code extension
  • macOS (Darwin 24.6.0)
  • Version: 2.0.59

Workaround

Removing or renaming the .claude folder in the problematic directory allows searches to work:

mv /path/to/problematic/.claude /path/to/problematic/.claude.bak

Additional Context

This was discovered when searching through a monorepo's sandbox directories where different users have their own .claude/settings.local.json files with machine-specific paths.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗