Skip to content

[BUG] Windows: permission prompt generates backslash allow-rules that never match forward-slash Bash commands #46783

Description

@mikeprince-ac

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

  1. Run Claude Code on Windows with Git Bash
  2. Have Claude execute a Bash command with a forward-slash path, e.g.:
    sed -n '/pattern/p' docs/trackers/backlog.yaml
    
  3. Observe the permission prompt:
    Do you want to proceed?
    1. Yes
    2. Yes, and always allow access to trackers\ from this project
    3. No
    
  4. Note trackers\ (backslash) in option 2, even though the command used trackers/ (forward slash)
  5. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:permissionsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsstaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions