[Bug] Extension Fails with Spaces in Project Directory Path

Status Closed — not planned
Maintainer reply ✓ Yes — hackyon-anthropic
Activity 11 comments · opened Sep 30, 2025 · closed Feb 5, 2026
💡 Likely answer: A maintainer (hackyon-anthropic, collaborator) responded on this thread — see the highlighted reply below.

Bug Report:

Bug Description
Claude Code VS Code extension hangs indefinitely ("Unravelling..." state) when the workspace directory path contains spaces. Extension works correctly only when all directory names in the path have no spaces.

Current Workaround
Opening Claude via VS Code's integrated terminal (claude command) works correctly regardless of spaces in directory path.

Expected Behavior
Extension should properly escape/quote directory paths with spaces, matching the behavior of the CLI.

Environment

  • Platform: darwin (macOS)
  • VS Code Extension Version: 2.0.0
  • Claude Code CLI Version: 2.0.1
  • Terminal: vscode
  • Feedback ID: 20b18886-3527-4632-a325-0e758b93071e

Steps to Reproduce

  1. Open VS Code in a directory with spaces in the path (e.g., /Users/theo/My Projects/test)
  2. Attempt to use Claude Code extension (Cmd+Shift+/)
  3. First query may work, but subsequent queries hang on "Unravelling..." indefinitely
  4. Extension becomes unresponsive

Error Log

[
  {
    "error": "AbortError: The operation was aborted.\n    at unknown\n    at abortChildProcess (node:child_process:859:42)\n    at onAbortListener2 (node:child_process:35:24)\n    at abort (unknown)\n    at <anonymous> (/$bunfs/root/claude:3557:80)",
    "timestamp": "2025-09-30T23:31:01.204Z"
  }
]

Impact
Forces users to rely on integrated terminal instead of extension features, significantly reducing UX quality for projects with spaces in paths.

View original on GitHub ↗

11 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/1726
  2. https://github.com/anthropics/claude-code/issues/5648
  3. https://github.com/anthropics/claude-code/issues/8152

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

hackyon-anthropic collaborator · 11 months ago

hey @tlcaputi - we haven't been able to repro this on our end. Is this consistently reproducible for you? If so, any chance you can share some of the logs you're seeing (which can be obtained through the bottom panel, as shown below):

!Image

Thanks!

tlcaputi · 11 months ago

Yes, it is consistently reproducible for me. However, I don't know where I would find the logs you're describing. The issue only comes up with the Claude Code VS Code extension -- not using Claude Code in the VS Code integrated terminal. It just hangs on any question like this:

<img width="731" height="1410" alt="Image" src="https://github.com/user-attachments/assets/1790bf73-d7dd-4c69-8837-6c138c737e35" />

hackyon-anthropic collaborator · 10 months ago

hey @tlcaputi - any chance you can share the VSCode logs with us? These can be accessed in the VSCode command palette (Cmd+Shift+P) under Claude Code: Show VSCode Logs

brettdavies · 10 months ago

Not OP, but I am experiencing the same issue. I have documentation related to the codebase in a folder that contains a [space] in the path. In my case, as in #1726 , the second directory (additionaldirectory, additionalDirectories, /add-dir) is an iCloud folder.

Claude DOES see the additional directory setting and attempts to load it. In the logs below, it is not clear if Claude thinks the path was loaded successfully (false positive) or if there is a silent error.

2025-10-23 13:50:31.610 [info] From claude: [DEBUG] Applying permission update: Adding 1 directory with destination 'cliArg': ["/Users/brett/Library/Mobile Documents/[redacted-no-spaces]"]

In a brief 5 minutes, what I think I see is that:

  1. The (invalid) path that Claude attempts to load is "/Users/brett/Library/Mobile" as the [space] in the path is not escaped.
  2. In the Claude Code for VS Code logs shown below, there is no error raised when:

A. The path is not actually valid
B. There are additional (invalid?) arguments passed when loading the path (e.g., the remainder of the path after the [space])

  1. When running directly in the terminal, claude DOES show the user an error if the path specified in the settings file is invalid. This is the expected behavior for an invalid path. It is unclear why this error is not triggered when there is a [space] in the path.

Happy to provide further details if needed. If you need additional Claude logs, please provide instructions as part of your request.

Reproduction

I have reproduced the bug 3 different ways.

1) claude application in the terminal

<details>
<summary>
2) Claude Code for VS Code with UI </summary>

"claude-code.useTerminal": false

</details>
<details>
<summary>
3) Claude Code for VS Code with terminal </summary>

"claude-code.useTerminal": true

</details>

Prompt and Output Logs

<details>

Prompt in Claude

please read TECHNICAL_SPECIFICATION.md

Claude UI Copy

Prompt: `please read TECHNICAL_SPECIFICATION.md`

Thinking ^
> The user is asking me to read a file called TECHNICAL_SPECIFICATION.md. I need to use the Read tool to read this file. However, I need the absolute path to the file. The user is working in /Users/brett/[redacted] directory based on the environment context. Let me try to read the file from the working directory first by constructing the path.

Read TECHNICAL_SPECIFICATION.md (fail)

Thinking ^
> The file doesn't exist at that path. Let me check if it might be in the other working directory mentioned in the environment.

Read TECHNICAL_SPECIFICATION.md (fail)

Thinking ^
> Hmm, the file isn't found in either directory. Let me search for the file in the working directories to see if it exists elsewhere or with a different name.

Globpattern: "**/TECHNICAL_SPECIFICATION.md"
>    ```plaintext
>    ⎿
>    Found 1 file
>    No files found
>    ```

Thinking ^
> The file isn't found in the main working directory. Let me check what files exist in the working directory to get a sense of the structure.

>    ```plaintext
>    I couldn't find the TECHNICAL_SPECIFICATION.md file in your working directory. Could you provide the correct path to the file, or check if the file exists with a different name? I can help you search for it if you'd like - just let me know where the file might be located.
>    ```

Claude VSCode Output

2025-10-23 13:50:31.274 [info] Received message from webview: {"type":"request","requestId":"ndevzasktb","request":{"type":"rename_tab","title":"Claude Code"}}
2025-10-23 13:50:31.275 [info] Received message from webview: {"type":"request","requestId":"0clpp28zxcru","request":{"type":"rename_tab","title":"Claude Code"}}
2025-10-23 13:50:31.277 [info] Received message from webview: {"type":"launch_claude","channelId":"d3b9nse833","cwd":"/Users/brett/dev/[redacted]","model":"haiku","permissionMode":"default","thinkingLevel":"default_on"}
2025-10-23 13:50:31.282 [info] Launching Claude on channel: d3b9nse833
2025-10-23 13:50:31.282 [info] Spawning Claude with SDK query function - cwd: /Users/brett/dev/[redacted], permission mode: default, version: 2.0.25, /Users/brett/.cursor/extensions/anthropic.claude-code-2.0.25-darwin-arm64/resources/native-binary/claude, resume: undefined
2025-10-23 13:50:31.282 [info] From claude: Spawning Claude Code native binary: /Users/brett/.cursor/extensions/anthropic.claude-code-2.0.25-darwin-arm64/resources/native-binary/claude --output-format stream-json --verbose --input-format stream-json --append-system-prompt 
# VSCode Extension Context

You are running inside a VSCode native extension environment.

## Code References in Text
IMPORTANT: When referencing files or code locations, use markdown link syntax to make them clickable:
- For files: [filename.ts](src/filename.ts)
- For specific lines: [filename.ts:42](src/filename.ts#L42)
- For a range of lines: [filename.ts:42-51](src/filename.ts#L42-L51)
- For folders: [src/utils/](src/utils/)
Unless explicitly asked for by the user, DO NOT USE backtickets ` or HTML tags like code for file references - always use markdown [text](link) format.
The URL links should be relative paths from the root of  the user's workspace.

## User Selection Context
The user's IDE selection (if any) is included in the conversation context and marked with ide_selection tags. This represents code or text the user has highlighted in their editor and may or may not be relevant to their request. --max-thinking-tokens 31999 --model haiku --debug-to-stderr --permission-prompt-tool stdio --setting-sources user,project,local --permission-mode default --debug
2025-10-23 13:50:31.561 [info] From claude: [DEBUG] Watching for changes in setting files /Users/brett/.claude/settings.json, /Users/brett/dev/[redacted]/.claude/settings.local.json...

2025-10-23 13:50:31.609 [info] From claude: [DEBUG] Applying permission update: Adding 5 allow rule(s) to destination 'localSettings': ["Bash(done)","Bash(source:*)","Bash(python:*)","Read(//private/tmp/**)","Bash(cat:*)"]

2025-10-23 13:50:31.610 [info] From claude: [DEBUG] Applying permission update: Adding 1 directory with destination 'cliArg': ["/Users/brett/Library/Mobile Documents/[redacted-no-spaces]"]

2025-10-23 13:50:31.611 [info] From claude: [DEBUG] Found 0 plugins (0 enabled, 0 disabled)

2025-10-23 13:50:31.619 [info] From claude: [DEBUG] >>>>> getSkillsIfEnabled() CALLED <<<<<
[DEBUG] ENABLE_SKILLS value: true, type: boolean
[DEBUG] ENABLE_SKILLS check passed, loading skills...

2025-10-23 13:50:31.620 [info] From claude: [DEBUG] Loading skills from directories: managed=/Library/Application Support/ClaudeCode/.claude/skills, user=/Users/brett/.claude/skills, project=/Users/brett/dev/[redacted]/.claude/skills

2025-10-23 13:50:31.620 [info] From claude: [DEBUG] >>>>> getPluginSkills CALLED <<<<<

2025-10-23 13:50:31.622 [info] From claude: [DEBUG] getPluginSkills: Processing 0 enabled plugins
[DEBUG] Total plugin skills loaded: 0
[DEBUG] Total plugin commands loaded: 0
[DEBUG] Loaded 0 skills total (managed: 0, user: 0, project: 0)

2025-10-23 13:50:31.622 [info] From claude: [DEBUG] getSkillsIfEnabled returning: 0 skill dir commands, 0 plugin skills

2025-10-23 13:50:31.713 [info] From claude: [DEBUG] Writing to temp file: /Users/brett/.claude.json.tmp.64643.1761245431713
[DEBUG] Preserving file permissions: 100600

2025-10-23 13:50:31.713 [info] From claude: [DEBUG] Temp file written successfully, size: 42350 bytes
[DEBUG] Applied original permissions to temp file
[DEBUG] Renaming /Users/brett/.claude.json.tmp.64643.1761245431713 to /Users/brett/.claude.json

2025-10-23 13:50:31.713 [info] From claude: [DEBUG] File /Users/brett/.claude.json written atomically

2025-10-23 13:50:31.714 [info] From claude: [DEBUG] Writing to temp file: /Users/brett/.claude.json.tmp.64643.1761245431714
[DEBUG] Preserving file permissions: 100600

2025-10-23 13:50:31.714 [info] From claude: [DEBUG] Temp file written successfully, size: 42350 bytes

2025-10-23 13:50:31.714 [info] From claude: [DEBUG] Applied original permissions to temp file
[DEBUG] Renaming /Users/brett/.claude.json.tmp.64643.1761245431714 to /Users/brett/.claude.json

2025-10-23 13:50:31.714 [info] From claude: [DEBUG] File /Users/brett/.claude.json written atomically

2025-10-23 13:50:31.756 [info] From claude: [DEBUG] Registered 0 hooks from 0 plugins

2025-10-23 13:50:31.763 [info] From claude: [DEBUG] Creating shell snapshot for zsh (/bin/zsh)

2025-10-23 13:50:31.763 [info] From claude: [DEBUG] Looking for shell config file: /Users/brett/.zshrc
[DEBUG] Snapshots directory: /Users/brett/.claude/shell-snapshots

2025-10-23 13:50:31.764 [info] From claude: [DEBUG] Creating snapshot at: /Users/brett/.claude/shell-snapshots/snapshot-zsh-1761245431763-4qqv65.sh
[DEBUG] Shell binary exists: true

2025-10-23 13:50:31.764 [info] From claude: [DEBUG] Execution timeout: 10000ms

2025-10-23 13:50:31.764 [info] From claude: [DEBUG] Writing to temp file: /Users/brett/.claude/todos/ffea536e-5375-47f7-9c36-f8944ec70f9f-agent-ffea536e-5375-47f7-9c36-f8944ec70f9f.json.tmp.64643.1761245431764

2025-10-23 13:50:31.765 [info] From claude: [DEBUG] Temp file written successfully, size: 2 bytes
[DEBUG] Renaming /Users/brett/.claude/todos/ffea536e-5375-47f7-9c36-f8944ec70f9f-agent-ffea536e-5375-47f7-9c36-f8944ec70f9f.json.tmp.64643.1761245431764 to /Users/brett/.claude/todos/ffea536e-5375-47f7-9c36-f8944ec70f9f-agent-ffea536e-5375-47f7-9c36-f8944ec70f9f.json

2025-10-23 13:50:31.765 [info] From claude: [DEBUG] File /Users/brett/.claude/todos/ffea536e-5375-47f7-9c36-f8944ec70f9f-agent-ffea536e-5375-47f7-9c36-f8944ec70f9f.json written atomically

2025-10-23 13:50:31.770 [info] From claude: [DEBUG] Total plugin agents loaded: 0

2025-10-23 13:50:31.960 [info] From claude: [DEBUG] Shell snapshot created successfully (53352 bytes)

2025-10-23 13:50:32.069 [info] From claude: [DEBUG] Ripgrep first use test: PASSED (mode=builtin, path=/Users/brett/.cursor/extensions/anthropic.claude-code-2.0.25-darwin-arm64/resources/native-binary/claude)

2025-10-23 13:50:32.336 [info] From claude: [DEBUG] Skills and commands included in Skill tool:

2025-10-23 13:50:32.336 [info] From claude: [DEBUG] Slash commands included in SlashCommand tool:

2025-10-23 13:50:32.561 [info] From claude: [DEBUG] Getting matching hook commands for SessionStart with query: startup
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "startup" (0 before deduplication)

2025-10-23 13:50:32.567 [info] From claude: [DEBUG] Stream started - received first chunk

2025-10-23 13:50:34.304 [info] From claude: [DEBUG] Getting matching hook commands for SubagentStop with query: undefined
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "no match query" (0 before deduplication)

2025-10-23 13:50:50.755 [info] Received message from webview: {"type":"request","requestId":"rgqz9007fb","request":{"type":"rename_tab","title":"please read TECHNICAL_SP…"}}
2025-10-23 13:50:50.764 [info] Received message from webview: {"type":"io_message","channelId":"d3b9nse833","message":{"type":"user","session_id":"","parent_tool_use_id":null,"message":{"role":"user","content":[{"type":"text","text":"<ide_opened_file>The user opened the file Anthropic.claude-code.Claude VSCode in the IDE. This may or may not be related to the current task.</ide_opened_file>"},{"type":"text","text":"please read TECHNICAL_SPECIFICATION.md"}]}},"done":false}
2025-10-23 13:50:50.775 [info] From claude: [DEBUG] Hooks: getAsyncHookResponseAttachments called

2025-10-23 13:50:50.775 [info] From claude: [DEBUG] Hooks: checkForNewResponses called
[DEBUG] Hooks: Found 0 total hooks in registry
[DEBUG] Hooks: checkForNewResponses returning 0 responses

2025-10-23 13:50:50.777 [info] From claude: [DEBUG] Getting matching hook commands for UserPromptSubmit with query: undefined
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "no match query" (0 before deduplication)

2025-10-23 13:50:50.779 [info] From claude: [DEBUG] Skills and commands included in Skill tool:
[DEBUG] Slash commands included in SlashCommand tool:

2025-10-23 13:50:50.780 [info] Received message from webview: {"type":"request","requestId":"e8u8gvd9pk","request":{"type":"rename_tab","title":"please read TECHNICAL_SP…"}}
2025-10-23 13:50:52.002 [info] From claude: [DEBUG] Stream started - received first chunk

2025-10-23 13:50:53.009 [info] From claude: [DEBUG] Hooks: getAsyncHookResponseAttachments called
[DEBUG] Hooks: checkForNewResponses called
[DEBUG] Hooks: Found 0 total hooks in registry

2025-10-23 13:50:53.009 [info] From claude: [DEBUG] Hooks: checkForNewResponses returning 0 responses

2025-10-23 13:50:53.010 [info] From claude: [DEBUG] Skills and commands included in Skill tool:
[DEBUG] Slash commands included in SlashCommand tool:

2025-10-23 13:50:54.604 [info] From claude: [DEBUG] Stream started - received first chunk

2025-10-23 13:50:54.647 [info] From claude: [DEBUG] executePreToolHooks called for tool: Glob

2025-10-23 13:50:54.650 [info] From claude: [DEBUG] Getting matching hook commands for PreToolUse with query: Glob
[DEBUG] Found 1 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "Glob" (0 before deduplication)

2025-10-23 13:50:54.658 [info] From claude: [DEBUG] Getting matching hook commands for PostToolUse with query: Glob
[DEBUG] Found 1 hook matchers in settings

2025-10-23 13:50:54.658 [info] From claude: [DEBUG] Matched 0 unique hooks for query "Glob" (0 before deduplication)

2025-10-23 13:50:54.670 [info] From claude: [DEBUG] Hooks: getAsyncHookResponseAttachments called
[DEBUG] Hooks: checkForNewResponses called
[DEBUG] Hooks: Found 0 total hooks in registry
[DEBUG] Hooks: checkForNewResponses returning 0 responses

2025-10-23 13:50:54.672 [info] From claude: [DEBUG] Skills and commands included in Skill tool:

2025-10-23 13:50:54.672 [info] From claude: [DEBUG] Slash commands included in SlashCommand tool:

2025-10-23 13:50:56.238 [info] From claude: [DEBUG] Stream started - received first chunk

2025-10-23 13:50:56.574 [info] From claude: [DEBUG] Hooks: getAsyncHookResponseAttachments called
[DEBUG] Hooks: checkForNewResponses called
[DEBUG] Hooks: Found 0 total hooks in registry
[DEBUG] Hooks: checkForNewResponses returning 0 responses

2025-10-23 13:50:56.575 [info] From claude: [DEBUG] Skills and commands included in Skill tool:
[DEBUG] Slash commands included in SlashCommand tool:

2025-10-23 13:50:58.183 [info] From claude: [DEBUG] Stream started - received first chunk

2025-10-23 13:50:58.244 [info] From claude: [DEBUG] executePreToolHooks called for tool: Glob
[DEBUG] Getting matching hook commands for PreToolUse with query: Glob
[DEBUG] Found 1 hook matchers in settings

2025-10-23 13:50:58.244 [info] From claude: [DEBUG] Matched 0 unique hooks for query "Glob" (0 before deduplication)

2025-10-23 13:50:58.246 [info] From claude: [DEBUG] Getting matching hook commands for PostToolUse with query: Glob
[DEBUG] Found 1 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "Glob" (0 before deduplication)

2025-10-23 13:50:58.258 [info] From claude: [DEBUG] Hooks: getAsyncHookResponseAttachments called
[DEBUG] Hooks: checkForNewResponses called
[DEBUG] Hooks: Found 0 total hooks in registry
[DEBUG] Hooks: checkForNewResponses returning 0 responses

2025-10-23 13:50:58.259 [info] From claude: [DEBUG] Skills and commands included in Skill tool:
[DEBUG] Slash commands included in SlashCommand tool:

2025-10-23 13:50:59.824 [info] From claude: [DEBUG] Stream started - received first chunk

2025-10-23 13:51:00.223 [info] From claude: [DEBUG] Getting matching hook commands for Stop with query: undefined
[DEBUG] Found 0 hook matchers in settings
[DEBUG] Matched 0 unique hooks for query "no match query" (0 before deduplication)

</details>

Environment Notes

<details>

Claude Code for VS Code Extension Information

Identifier: anthropic.claude-code
Version: 2.0.25
Last Updated: 2025-10-21, 18:16:35

Contents of .claude/settings.local.json

{
  "permissions": {
    "additionalDirectories": [
      "/Users/brett/Library/Mobile Documents/[redacted-no-spaces]/docs"
    ],  
    "allow": [
      "Bash(done)",
      "Bash(source:*)",
      "Bash(python:*)",
      "Read(//private/tmp/**)",
      "Bash(cat:*)"
    ],
    "deny": [],
    "ask": []
  }
}

tree shows the file

➜  tree "/Users/brett/Library/Mobile Documents/[redacted-no-spaces]/docs"
/Users/brett/Library/Mobile Documents/[redacted-no-spaces]/docs
├── TECHNICAL_SPECIFICATION.md

</details>

False Positive

Please note: If the file is currently open in the IDE or if the prompt contains the full path, then Claude has no issue reading the file.

While successful, this should be considered a false-positive.

Claude VSCode Output - FALSE POSITIVES

<details>
<summary>File open in IDE</summary>

2025-10-23 13:55:14.370 [info] Received message from webview: {"type":"request","requestId":"gdw5m46z6v9","request":{"type":"rename_tab","title":"please read TECHNICAL_SP…"}}
2025-10-23 13:55:14.375 [info] Received message from webview: {"type":"io_message","channelId":"hsr3s8azhld","message":{"type":"user","session_id":"","parent_tool_use_id":null,"message":{"role":"user","content":[{"type":"text","text":"<ide_opened_file>The user opened the file /Users/brett/Library/Mobile Documents/[redacted-no-spaces]/TECHNICAL_SPECIFICATION.md in the IDE. This may or may not be related to the current task.</ide_opened_file>"},{"type":"text","text":"please read TECHNICAL_SPECIFICATION.md"}]}},"done":false}

</details>

<details>
<summary>File referenced in prompt</summary>

2025-10-23 13:58:13.882 [info] Received message from webview: {"type":"request","requestId":"od4v1gksig","request":{"type":"rename_tab","title":"please read `/Users/bret…"}}
2025-10-23 13:58:13.888 [info] Received message from webview: {"type":"io_message","channelId":"z9y7vphc4o","message":{"type":"user","session_id":"","parent_tool_use_id":null,"message":{"role":"user","content":[{"type":"text","text":"please read `/Users/brett/Library/Mobile Documents/[redacted-no-spaces]/TECHNICAL_SPECIFICATION.md`"}]}},"done":false}

</details>

brettdavies · 10 months ago

🔧 Workaround: Symbolic Links for Paths with Spaces

While waiting for the official fix, here's a reliable workaround that works at the OS level:

The Problem

Claude Code fails to load directories with spaces in additionalDirectories because the path gets truncated at the first space character.

✅ Solution: Create Symbolic Links

I've created a comprehensive guide with platform-specific instructions:

📋 Complete Workaround Guide → Github Gist

The guide includes:

  • Quick reference for immediate implementation
  • Step-by-step instructions for macOS, Windows, Linux, and WSL
  • Common use cases (iCloud folders, Windows Documents, team folders)
  • Three configuration methods (settings files, CLI args, slash commands)
  • Verification steps to test the workaround
  • Troubleshooting section for common issues
  • Performance and security information
  • Alternative solutions comparison table
  • Related GitHub issues and technical context

Tested and Verified

I've tested this workaround in a development environment and confirmed it works across all platforms.

---

_This workaround should work immediately while the development team implements a proper fix for the underlying issue._

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

hackyon-anthropic collaborator · 7 months ago

how do you have this set up? are u using Bedrock and have a special settings/setup for your settings.json?

you can access the logs by starting the VSCode command palette and searching for/selecting Claude Code: Show Logs

github-actions[bot] · 6 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 6 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.