[BUG] bypassPermissions not working on Windows/WSL — still prompts for Edit/Write

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 4 comments · opened Mar 23, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Bug Description

defaultMode: "bypassPermissions" in ~/.claude/settings.json is ignored when running Claude Code on Windows with WSL paths (\wsl.localhost\Ubuntu\...). Claude Code still prompts for permission on every Edit() and Write() call.

Environment

  • OS: Windows 11 Pro (10.0.26200) with WSL2 Ubuntu
  • Claude Code: latest
  • Working directory: \wsl.localhost\Ubuntu\home\dev\Code

Configuration (~/.claude/settings.json)

{
  "permissions": {
    "defaultMode": "bypassPermissions"
  },
  "skipDangerousModePermissionPrompt": true
}

Steps to Reproduce

  1. Set defaultMode: "bypassPermissions" in global settings
  2. Open Claude Code in a WSL directory
  3. Ask Claude to create or edit any file
  4. Permission prompt appears despite bypass mode

Related Issues

  • #18187 (closed as NOT PLANNED by bot, no Anthropic response)
  • #29574 (duplicate)

View original on GitHub ↗

4 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/29574
  2. https://github.com/anthropics/claude-code/issues/37192
  3. https://github.com/anthropics/claude-code/issues/36192

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

ddarbyson · 6 months ago

Dealt with this same thing — spent way too long trying every combination of bypassPermissions, Edit(*), dontAsk, etc. None of it works because the protection is hardcoded for certain paths. See #37516.

Ended up finding that PreToolUse hooks actually run before the hardcoded check, so you can short-circuit it. Here's what I landed on:

~/.claude/hooks/approve-edits.sh:

#!/bin/bash
INPUT=$(cat)
FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null)

# Auto-approve paths you trust
case "$FILE" in
    /your/safe/path/*)
        jq -n '{
            "hookSpecificOutput": {
                "hookEventName": "PreToolUse",
                "permissionDecision": "allow",
                "permissionDecisionReason": "auto-approved safe path"
            }
        }'
        exit 0 ;;
esac

# Everything else falls through to the normal prompt
exit 0

Then register it in settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/hooks/approve-edits.sh"
          }
        ]
      }
    ]
  }
}

The thing that surprised me — hooks override the hardcoded protection, not just user-configured permissions. Exit 0 with no JSON output just falls through to the normal prompt, so anything you don't explicitly match stays protected.

Not a proper fix but it works. Hopefully proper path-level permissions show up eventually.

ashwin-ant collaborator · 6 months ago

This was fixed in v2.1.105 — bypassPermissions mode now applies to files on \\wsl$\ and \\wsl.localhost\ paths instead of falling back to per-edit prompts. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.