Bash tool dies (exit 1, no output) when a bound NFS/autofs mountpoint hangs — bubblewrap namespace setup blocks; poisoned until restart

Resolved 💬 2 comments Opened Jun 13, 2026 by AlexBugeac Closed Jun 16, 2026

Summary

On Linux, the Bash tool can suddenly start returning **exit code 1 with no stdout/stderr for every command — including trivial ones like true or echo — and stays broken for the rest of the session until the claude process is restarted. dangerouslyDisableSandbox / sandbox.enabled: false do not** restore it.

The trigger is a hung mountpoint (in my case NFS-over-Tailscale that wedged into uninterruptible D-state after a network blip). Because the Bash sandbox uses bubblewrap, which recursively binds the host root tree into a fresh mount namespace on every command, a single hung mountpoint anywhere under / makes namespace setup block/fail → all Bash commands die. The failure then persists in the session even after the underlying mount is recovered, until claude itself is restarted.

This appears to be the shared root cause behind several separately-reported issues:

  • #41124 (Arch/CachyOS: every command exits 1, no output; sandbox-disable + restart don't help)
  • #31588 (Bash hangs when cwd/home is on NFS)
  • #41983 ("all Bash commands hang, poisoned until process restart")

None of those names the bubblewrap-recursive-bind-over-hung-mount mechanism, so filing a focused one.

Reproduction (mechanism)

  1. Mount a network filesystem somewhere under / (NFS, sshfs, autofs, fuse) on the host running claude.
  2. Make its backing server unreachable so the mount wedges (processes stuck in D-state; ps -eo pid,stat,wchan shows D + e.g. folio_wait_bit_common).
  3. Run any Bash tool command. It returns exit 1 with empty output (commands may actually execute — proven via file redirection — but output capture / namespace setup fails).
  4. Recover the mount fully (D-state cleared, mount healthy). Bash tool still fails until claude is restarted.

Environment

  • OS: Arch Linux (kernel 6.19.x)
  • Mount: NFS v4.2 over Tailscale (soft,timeo=30,retrans=2), previously via x-systemd.automount
  • Bash sandbox: bubblewrap

Why current options don't help

  • dangerouslyDisableSandbox: true and sandbox.enabled: false are reported not to restore Bash on this path (#41124).
  • There is no documented setting to exclude a path/mount from the sandbox's mount namespace, and bubblewrap by default rec-binds the whole root, so a dead mount anywhere is swept in.

Feature request

Provide a way to keep a hung mountpoint from poisoning the Bash sandbox, e.g.:

  1. A sandbox.filesystem.excludeMounts (or --tmpfs/no-recursive-bind) option so specified paths (e.g. /mnt/nas) are not bound into the namespace.
  2. Make bubblewrap namespace construction tolerant of an unreachable mountpoint (bind only needed paths instead of rec-binding /), so one dead mount can't kill all Bash.
  3. Self-heal the Bash subsystem after a transient namespace-setup failure, rather than staying poisoned until process restart.

Workaround (for others hitting this)

  • Recover/unwedge the mount (server-side), then restart claude — the per-command namespace is rebuilt fresh but the poisoned state persists in the running process until restart.
  • Prevent it: mount network FS soft (not hard), avoid x-systemd.automount (autofs re-mount races leave half-wedged mountpoints), and keep claude's cwd/$HOME off the network FS.

View original on GitHub ↗

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