Sandbox mode leaves read-only bind mounts that persist after disable

Resolved 💬 2 comments Opened Apr 11, 2026 by vnz Closed May 29, 2026

Problem

After running Claude Code with the default sandbox mode enabled, certain files get mounted as read-only via bind mounts (likely from the filesystem sandbox implementation). These mounts persist even after disabling sandbox with /sandbox, making it impossible to:

  • git checkout -- <file> (error: unable to unlink old file: Read-only file system)
  • git stash (same error)
  • git pull (same error, can't update the file)
  • rm -f <file> (cannot remove: Read-only file system)
  • git reset --hard (same)

The only recovery is restarting the entire Claude Code session, which loses all conversation context.

Reproduction

  1. Start Claude Code in a git repo with sandbox mode enabled (default)
  2. Edit a file that the sandbox has restricted (e.g., .github/workflows/pr.yml)
  3. Switch branches or try to pull -- the file is now locked
  4. Run /sandbox to disable -- files remain locked
  5. All git operations involving that file fail permanently

Environment

  • Claude Code CLI on Linux (Fedora/kernel 6.18)
  • Terminal: Kitty
  • Git repo with GitHub Actions workflows in .github/

Impact

This is a workflow-breaking issue. During a session today, I:

  • Could not switch branches
  • Could not pull from remote
  • Could not push a hotfix to main
  • Could not stash or reset
  • Had to abandon the session entirely

The sandbox filesystem restrictions should be fully reversible when disabled. Read-only bind mounts must be unmounted on /sandbox disable, not left as zombie mounts that corrupt the working tree.

Expected Behavior

/sandbox disable should:

  1. Unmount all sandbox bind mounts immediately
  2. Restore full read-write access to all files
  3. Allow normal git operations to resume

Alternatively, provide a way to completely opt out of sandbox mode at the project level (e.g., in .claude/settings.json) so it never activates.

View original on GitHub ↗

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