v2.1.98 regression: rw bind mounts inside ~/.claude shadowed by parent ro mount

Resolved 💬 6 comments Opened Apr 17, 2026 by christauff Closed May 29, 2026

Summary

After auto-updating from v2.1.97 to v2.1.98, all Bash writes to ~/.claude/MEMORY/ fail with EROFS (Read-only file system), despite the mount being declared rw in /proc/self/mountinfo. This is a regression — v2.1.97 worked correctly.

Environment

  • OS: Ubuntu Linux 6.17.0-20-generic
  • Claude Code: v2.1.98 (auto-updated 2026-04-17 18:48 ET)
  • Previous working version: v2.1.97 (installed 2026-04-16)

Reproduction

  1. Update to v2.1.98
  2. In a Claude Code session, run any write to ~/.claude/MEMORY/:

``bash
mkdir -p ~/.claude/MEMORY/WORK/test/
# or
touch ~/.claude/MEMORY/WORK/testfile
``

  1. Both fail: Read-only file system

Root Cause Analysis

The sandbox mount namespace has a mount ordering bug. From /proc/self/mountinfo:

# MEMORY rw mount (ID 2853) — mounted first
2853 2851 8:2 /home/user/.claude/MEMORY /home/user/.claude/MEMORY rw,nosuid,nodev,relatime

# Parent .claude ro mount (ID 2874) — mounted AFTER, shadows the rw submount
2874 2851 8:2 /home/user/.claude /home/user/.claude ro,nosuid,nodev,relatime

Both mounts share parent ID 2851 (/home/user). The .claude ro mount (ID 2874) is applied after the MEMORY rw mount (ID 2853). In Linux VFS, when two bind mounts target overlapping paths under the same parent, the later mount wins. The ro parent shadows the rw child.

Expected: The rw submounts (MEMORY, skills, debug) should be mounted after the ro parent .claude mount, so they overlay it correctly.

Actual: The rw submounts are mounted before the ro parent, so they get hidden.

Impact

  • Write/Edit tools work (they bypass the mount namespace)
  • All Bash tool writes to ~/.claude/MEMORY/, ~/.claude/skills/, etc. fail with EROFS
  • dangerouslyDisableSandbox: true does NOT help — the mount namespace is set up before the sandbox layer
  • This also affects ~/.local/bin (ro), preventing in-session version rollback

Workaround

Roll back to v2.1.97 from an external terminal:

ln -sf ~/.local/share/claude/versions/2.1.97 ~/.local/bin/claude

Then restart Claude Code.

Additional Context

The same physical device (/dev/sda2) backs all mounts. The filesystem has 71GB free. User owns all files. This is purely a mount ordering issue in the sandbox namespace setup, not a filesystem or permissions problem.

View original on GitHub ↗

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