[FEATURE] Add option to disable 'Contains backslash-escaped whitespace' warning
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When running Claude code in a WSL environment on Windows, if the directory name has a space in it, it breaks all agentic workflows because it constantly asks for confirmation of proceeding for Contains backslash-escaped whitespace when running even the simplest shell command, such as ls.
Proposed Solution
Add a configuration option to allow shell commands with backslash escape whitespace.
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
❯ /init The test environment is being served at the following URL. http://localhost:8084 The MySQL database credentials are in a config file, one directory up, and you can query MySQL directly
● Running 3 Explore agents… (ctrl+o to expand) ├─ Explore codebase structure · 7 tool uses · 16.5k tokens
│ ⎿ Searching for 2 patterns, reading 5 files…
├─ Explore backend and API · 2 tool uses · 14.7k tokens
│ ⎿ Searching for 1 pattern, reading 1 file…
└─ Explore PWA frontend code · 25 tool uses · 61.2k tokens
⎿ Done
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Bash command
ls -la /mnt/g/My\ Drive/Websites/tyrereviews.com/Site/tyre.info/testing/
Run shell command
Contains backslash-escaped whitespace
Do you want to proceed?
❯ 1. Yes
- No
Additional Context
_No response_
9 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a duplicate. Those three are similar; however, this is a wider ranging issue that affects all commands.
A
PreToolUsehook can auto-approve commands with escaped whitespace:Even just getting Claude to place paths in quotes instead of escaping spaces would resolve this. I've tried making Cluade do with via CLAUDE.md, but it seems to ignore it.
@yurukusa Presumably, this
PreToolUsehook will auto-approve commands that might otherwise have required approval for other reasons, like something potentially destructive.Same issue on macOS. The warning triggers constantly for:
I have ~30 explicit Bash allow patterns in settings.local.json (e.g. Bash(osascript ), Bash(python3 )) — the
backslash-escaped whitespace check ignores all of them and triggers separately.
In a single (<10min) session today I had to approve this 5+ times. For local, single-user workflows with no untrusted input,
this is pure friction.
+1 for making this configurable — ideally by respecting existing allow patterns, so if the command already matches
an allow rule, the content-level check is skipped.
For anyone experiencing this issue while running Claude Code on a Parallels virtual machine, this is how I resolved it. ⤵︎
Parallels makes shared files accessible through a mounted volume under
/Volumes/My Shared Filesas you probably know. You can change the name of this drive by unmounting it and then remounting it under a different name.You can try using a symbolic link instead but that didn't work for me. Claude Code seems to use the physical working directory so any attempts to create a symbolic link likely won't prevent Claude Code from using the physical working directory. If you have a symbolic link set up, navigate to the desired directory and run
pwdand thenpwd -P. You'll likely see that they differ.Remounting
/Volumes/My Shared Filesdiskutil info /Volumes/My\ Shared\ FilesDevice Node.diskutil unmount "/Volumes/My Shared Files"sudo mkdir /Volumes/NewDriveNameDevice Nodenoted earlier, and the new directory for the volume:sudo mount -t virtiofs /dev/disk0 /Volumes/NewDriveNameIt should now be mounted under the new name. Check using
pwd -P.You can get this to run each time you start the virtual machine by using a LaunchDaemon. Hopefully this helps someone else.
Regarding the Claude Code “backslash” issue on macOS, I fixed it by adding the following to Project/.claude/settings.json:
{
"defaultMode": "acceptEdits",
"permissions": {
"allow": [
"Bash(backslash-escaped whitespace:*)",
"Bash(folder\\ that-has-white-space-here)",
"Bash(dev-project-folder-name-here)",
.....
]
}
}
Then I asked Claude Code to apply the changes or simply restarted it, and it worked.
Generally, this issue happens when there is a space in the project or file path (for example: "my project").
Hope this helps
So much this. Manually approving every grep, ls, find, and other terminal command is exhausting and tedius if the path has a space in any if the dir names...
20, 30, 50 approvals in a session where it needs to explore a codebase is absurd.
Here is a script that seems more robust:
approve-escaped-paths.tsTests