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?
1. Yes
2. Yes, and always allow access to trackers\ from this project
3. No
- Note
trackers\ (backslash) in option 2, even though the command used trackers/ (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
Environment
- OS: Windows 11 Pro
- Shell: Git Bash
- Claude Code: latest
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
trackers\(backslash) in option 2, even though the command usedtrackers/(forward slash)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
cdprepended due to path format mismatchEnvironment