bypassPermissions mode still prompts for Edit/Write on UNC paths (Windows)
Status Open
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 4 comments · opened Apr 1, 2026
Description
On Windows 10, bypassPermissions mode does not auto-approve Edit/Write tool calls when the working directory or file paths use UNC paths (\server\share\...). Claude Code always shows the "Do you want to make this edit?" confirmation prompt, even though the file is inside the current working directory.
Repro
- Windows 10, Claude Code latest, Git Bash shell
- Global
settings.jsonhas"defaultMode": "bypassPermissions"and"skipDangerousModePermissionPrompt": true - Launch CC from a UNC path:
cd //server/share/project && claude --dangerously-skip-permissions - Ask CC to edit any file in the project
Expected: Edit proceeds without prompting (bypass mode)
Actual: "Do you want to make this edit to file.html?" prompt appears every time
What was tried (none worked)
- Adding UNC path to
additionalDirectories(both\\server\shareand//server/shareformats) - Adding
"defaultMode": "bypassPermissions"at project level in.claude/settings.local.json - PreToolUse hook returning
{"decision":"approve"}— hook fires and returns approve correctly, but CC still prompts - Fresh session (not resumed)
- Removing local symlinks that previously pointed to the UNC path
Debug info
PreToolUse hook logging confirms:
permission_modeis"bypassPermissions"cwdis\\MURKYSERVER\murky\PROJECTS\gram1-webfile_pathis\\MURKYSERVER\murky\PROJECTS\gram1-web\site\product.html(inside cwd)- The prompt still appears
Workaround
Using a mapped drive letter (e.g., L:\PROJECTS\project) instead of a UNC path works correctly — bypassPermissions is respected and edits proceed without prompting.
Environment
- Windows 10 Home 10.0.19045
- Shell: Git Bash
- UNC path via SMB to local NAS
- Claude Code latest stable channel
4 Comments
This is also the case for windows 11 (25H2). As our team primarily works on shares this is a major headache cause currently..
Hitting the same on a different but legitimate Windows setup: Hyper-V VM accessing the host repo via Terminal Services drive redirection (
\\tsclient\C\...) — not SMB. None of the documented workarounds apply because tsclient isn't a real SMB share:net use Z: \\tsclient\C→System error 67(tsclient is a TS virtual channel, not SMB)subst Z: \\tsclient\C→ refuses UNC pathsmklink /D C:\bz \\tsclient\...→ Node callsrealpathbefore passing CWD to the CLI, so the path becomes//tsclient/...again and the check still firesNew-PSDrive→ only visible inside the PowerShell process, not to VSCodeSo for VM-based development workflows there is no client-side workaround at all — only a CLI-side fix can unblock us.
For maintainer reference, there are two hardcoded checks in the CLI binary that fire before any permission setting is consulted:
Searched for
CLAUDE_CODE_ALLOW_UNC,DISABLE_UNC,tengu_unc, an env var or a CLI flag to opt out — there is nothing.--dangerously-skip-permissions,bypassPermissionsmode,additionalDirectories, VSCodesecurity.allowedUNCHosts, andclaudeCode.allowDangerouslySkipPermissions: trueall have no effect because these checks run before the permission layer.Would be great to have an opt-in env var (e.g.
CLAUDE_CODE_ALLOW_UNC=1) for users who knowingly accept the WebDAV-credential-leak risk on a trusted UNC root.I'm facing the same issue