claude-code - 💡(How to fix) Fix [BUG] Sandbox Config tab filesystem restrictions dropping leading slash on WSL2

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Code Example

"permissions": {
    "deny": [
      "Read(/mnt/c/**)",
      "Write(/mnt/c/**)",
      "Edit(/mnt/c/**)",
      "Read(~/**)",
      "Write(~/**)",
      "Edit(~/**)",
      "Read(/home/username/**)",
      "Write(/home/username/**)",
      "Edit(/home/username/**)",
    ],
  "sandbox": {
    "enabled": true,
    "allowUnsandboxedCommands": false,
    "filesystem": {
      "denyRead": ["~/"],
      "denyEdit": ["~/"],
      "denyWrite": ["~/"],
    }
  }

---

Filesystem Read Restrictions:
  Denied: /home/username/.claude/mnt/c, ~, /home/username/.claude/home/username,

  Filesystem Write Restrictions:
  Allowed: /dev/stdout, /dev/stderr, /dev/null, /dev/tty, /dev/dtracehelper, /dev/autofs_nowait, /tmp/claude,
  /private/tmp/claude, /home/username/.npm/_logs, /home/username/.claude/debug, ., /tmp/claude-1000/,
  /git-repos/ctmbatch, /git-repos/opsutils
  Denied within allowed: /home/username/.claude/settings.json, /etc/claude-code/managed-settings.json,
  /etc/claude-code/managed-settings.d, /mnt/c/Program Files/ClaudeCode/managed-settings.json, /mnt/c/Program
  Files/ClaudeCode/managed-settings.d, /home/username/.claude/mnt/c, ~,
  /home/username/.claude/home/username

---

Filesystem Write Restrictions:
  Allowed: /dev/stdout, /dev/stderr, /dev/null, /dev/tty, /dev/dtracehelper, /dev/autofs_nowait, /tmp/claude,
  /private/tmp/claude, /home/username/.npm/_logs, /home/username/.claude/debug, ., /tmp/claude-1000/

  Denied within allowed: /home/username/.claude/settings.json, /etc/claude-code/managed-settings.json,
  /etc/claude-code/managed-settings.d, /mnt/c/Program Files/ClaudeCode/managed-settings.json, /mnt/c/Program
  Files/ClaudeCode/managed-settings.d, /mnt/c, ~, /home/username

---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

My ~/.claude/settings.json file in WSL2 includes the following:

    "permissions": {
    "deny": [
      "Read(/mnt/c/**)",
      "Write(/mnt/c/**)",
      "Edit(/mnt/c/**)",
      "Read(~/**)",
      "Write(~/**)",
      "Edit(~/**)",
      "Read(/home/username/**)",
      "Write(/home/username/**)",
      "Edit(/home/username/**)",
    ],
  "sandbox": {
    "enabled": true,
    "allowUnsandboxedCommands": false,
    "filesystem": {
      "denyRead": ["~/"],
      "denyEdit": ["~/"],
      "denyWrite": ["~/"],
    }
  }

When I use the /sandbox command in Claude Code the Config tab shows the read denies for /mnt/c are inside my ~/.claude directory as shown below:

  Filesystem Read Restrictions:
  Denied: /home/username/.claude/mnt/c, ~, /home/username/.claude/home/username,

  Filesystem Write Restrictions:
  Allowed: /dev/stdout, /dev/stderr, /dev/null, /dev/tty, /dev/dtracehelper, /dev/autofs_nowait, /tmp/claude,
  /private/tmp/claude, /home/username/.npm/_logs, /home/username/.claude/debug, ., /tmp/claude-1000/,
  /git-repos/ctmbatch, /git-repos/opsutils
  Denied within allowed: /home/username/.claude/settings.json, /etc/claude-code/managed-settings.json,
  /etc/claude-code/managed-settings.d, /mnt/c/Program Files/ClaudeCode/managed-settings.json, /mnt/c/Program
  Files/ClaudeCode/managed-settings.d, /home/username/.claude/mnt/c, ~,
  /home/username/.claude/home/username

I do not have an mnt/c sub-directory in ~/.claude and when I asked Claude Code about why that is happening it told me that the sandboxing on WSL2 must be dropping the leading slash and that I should raise a bug here.

What Should Happen?

Output on the /sandbox Config tab should use absolute paths:

  Filesystem Write Restrictions:
  Allowed: /dev/stdout, /dev/stderr, /dev/null, /dev/tty, /dev/dtracehelper, /dev/autofs_nowait, /tmp/claude,
  /private/tmp/claude, /home/username/.npm/_logs, /home/username/.claude/debug, ., /tmp/claude-1000/

  Denied within allowed: /home/username/.claude/settings.json, /etc/claude-code/managed-settings.json,
  /etc/claude-code/managed-settings.d, /mnt/c/Program Files/ClaudeCode/managed-settings.json, /mnt/c/Program
  Files/ClaudeCode/managed-settings.d, /mnt/c, ~, /home/username

Error Messages/Logs

Steps to Reproduce

  1. Launch claude
  2. /sandbox
  3. Go to Config tab

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.136

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Windows Terminal

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Sandbox Config tab filesystem restrictions dropping leading slash on WSL2