[BUG] WSL2 Sandbox bwrap fails to mount ~/.aws when symlinked to inaccessible path

Resolved 💬 3 comments Opened Apr 8, 2026 by saver-r Closed May 27, 2026

Preflight Checklist

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

What's Wrong?

Claude code's sandbox tries to mount a symlink that points to a directory that is already forbidden.

Steps to reproduce

  1. ~/.claude/settings.json
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "permissions": {
    "allow": [
      "Bash"
    ],
    "deny": [
      "Read(~/.ssh/**)",
      "Read(~/.gnupg/**)",
      "Read(~/.aws/**)",
      "Read(/mnt/**)",
      "Edit(~/.ssh/**)",
      "Edit(~/.gnupg/**)",
      "Edit(~/.aws/**)",
      "Edit(/mnt/**)"
    ]
  },
  "sandbox": {
    "enabled": true,
    "failIfUnavailable": true,
    "filesystem": {
      "allowWrite": [
        "~/allowed",
        "/tmp"
      ],
      "denyRead": [
        "~/.ssh",
        "~/.gnupg",
        "~/.aws"
      ]
    }
  },
  "additionalDirectories": [
    "/home/user/allowed"
  ]
}
  1. Create a symlink to Windows file system: mkdir -p /mnt/c/Users/me/.aws ; ln -s /mnt/c/Users/me/.aws $HOME/.aws. Replace me with your windows username.
  2. Ensure that sandbox is enabled.
  3. Have claude code execute any bash command, e.g. _Please list directory content of ~/allowed_.

Expected result

Directory is listed.

Actual result

Error: Exit code 1
     bwrap: Can't mount tmpfs on /newroot/home/user/.aws: No such file or
     directory

You cannot get around that. The symlink is intentional and must be retained.

Worse!

If I remove the "~/.aws" line from settings.json and restart claude code, it still fails with the same error!

It looks like Claude Code caches the old configuration and retains it, ignoring more recent changes to the sandbox configuration.

Workaround

Deactivate sandbox which defeats security measures.

What Should Happen?

see above

Error Messages/Logs

Steps to Reproduce

see above

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.96

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗