v2.1.98 regression: rw bind mounts inside ~/.claude shadowed by parent ro mount
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
- Update to v2.1.98
- In a Claude Code session, run any write to
~/.claude/MEMORY/:
``bash``
mkdir -p ~/.claude/MEMORY/WORK/test/
# or
touch ~/.claude/MEMORY/WORK/testfile
- 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/Edittools work (they bypass the mount namespace)- All
Bashtool writes to~/.claude/MEMORY/,~/.claude/skills/, etc. fail with EROFS dangerouslyDisableSandbox: truedoes 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.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗