[BUG] Windows: permission prompt generates backslash allow-rules that never match forward-slash Bash commands
Description
On Windows (Git Bash), when Claude Code prompts the user to approve a Bash command that contains a file path, the "always allow" option generates a rule using Windows backslash separators — even though the original command used forward slashes.
This means the saved rule can never match future commands (which also use forward slashes), so the user gets prompted again every time.
Steps to Reproduce
- Run Claude Code on Windows with Git Bash
- Have Claude execute a Bash command with a forward-slash path, e.g.:
````
sed -n '/pattern/p' docs/trackers/backlog.yaml
- Observe the permission prompt:
```
Do you want to proceed?
- Yes
- Yes, and always allow access to trackers\ from this project
- No
```
- Note
trackers\(backslash) in option 2, even though the command usedtrackers/(forward slash) - If user picks option 2, the saved allow rule uses backslash — but all subsequent commands use forward slashes, so the rule never matches and the user is prompted again
Expected Behavior
The "always allow" rule should normalize to forward slashes (matching the Bash/POSIX convention), or the permission matcher should normalize both sides before comparing — so a rule saved from one invocation actually matches the next identical command.
Related Issues
- #30736 — allowedTools glob patterns never match Windows backslash paths (same root cause: path separator mismatch in permission matching)
- #30524 — unnecessary
cdprepended due to path format mismatch - #21878 — hook scripts fail due to backslash path interpretation
Environment
- OS: Windows 11 Pro
- Shell: Git Bash
- Claude Code: latest
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗