claude-code - 💡(How to fix) Fix [BUG] bwrap sandbox completely broken — "Can't create file at .zshrc: Read-only file system" kills ALL Bash tool calls [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#50781Fetched 2026-04-20 12:13:12
View on GitHub
Comments
3
Participants
2
Timeline
6
Reactions
0
Timeline (top)
commented ×3labeled ×3

Error Message

bwrap: Can't create file at /home/user/.claude/.zshrc: Read-only file system

Root Cause

  • #40133 — bwrap fails on symlinked .claude/skills directory (same root cause family)
  • #41863 — bwrap fails on Ubuntu 24.04 merged-/usr layout
  • #18631 — bwrap + symlink regression from 2.1.2+
  • #35986 — sandbox.enabled: false setting ignored, bwrap still wraps commands

Fix Action

Workaround

The only known workaround is manually editing settings to disable the sandbox entirely — which defeats the purpose of having one.

Code Example

bwrap: Can't create file at /home/user/.claude/.zshrc: Read-only file system
RAW_BUFFERClick to expand / collapse

Title: [BUG] bwrap sandbox completely broken — "Can't create file at .zshrc: Read-only file system" kills ALL Bash tool calls


This is a showstopper regression that makes Claude Code completely unusable.

Every single Bash tool call fails. Not some. Not edge cases. ALL of them. Including echo "test". Including dangerouslyDisableSandbox: true. The sandbox cannot even initialize itself.

Error

bwrap: Can't create file at /home/user/.claude/.zshrc: Read-only file system

What's happening

bwrap tries to create .zshrc inside the working directory (~/.claude/) during sandbox initialization. But Claude Code's own sandbox write restrictions mark .claude/ paths as read-only (via denyWithinAllow). The sandbox's setup violates the sandbox's own rules.

The result is a perfect deadlock:

  1. User runs any Bash command
  2. Claude Code invokes bwrap to sandbox it
  3. bwrap tries to write .zshrc into the working directory
  4. The sandbox filesystem policy blocks the write
  5. bwrap dies before bash ever starts
  6. dangerouslyDisableSandbox: true does NOT help — bwrap runs before the flag takes effect

Zero Bash commands can execute. The tool is completely non-functional.

Environment

  • OS: Linux 6.17.0-20-generic (Ubuntu)
  • Shell: bash (with zsh installed)
  • Working directory: ~/.claude/ (a git repo — this is the user's config/working directory)
  • bubblewrap: system package
  • Claude Code: latest (auto-updated overnight, breaking a working downgraded version)

The auto-update problem compounds this

I downgraded to a working version yesterday. Overnight, Claude Code auto-updated itself back to the broken version. There is no reliable way to pin a working version. CLAUDE_CODE_DISABLE_AUTO_UPDATE=1 is not well-documented and the update behavior is aggressive.

Users should not have to fight their own tooling to maintain a working state.

Related issues

  • #40133 — bwrap fails on symlinked .claude/skills directory (same root cause family)
  • #41863 — bwrap fails on Ubuntu 24.04 merged-/usr layout
  • #18631 — bwrap + symlink regression from 2.1.2+
  • #35986 — sandbox.enabled: false setting ignored, bwrap still wraps commands

These have been open for weeks to months. The sandbox on Linux is fundamentally broken across multiple configurations and nobody is fixing it.

Expected behavior

Bash tool calls should execute. At minimum, dangerouslyDisableSandbox: true should actually disable the sandbox.

Actual behavior

Nothing works. Claude Code is a $200/month subscription tool that cannot run echo "test".

Workaround

The only known workaround is manually editing settings to disable the sandbox entirely — which defeats the purpose of having one.

extent analysis

TL;DR

The most likely fix is to disable the sandbox entirely by manually editing settings, although this defeats the purpose of having a sandbox.

Guidance

  • The error occurs because bwrap tries to create a .zshrc file in the read-only ~/.claude/ directory, which is restricted by the sandbox's own rules.
  • To verify the issue, try running a simple Bash command like echo "test" and check if it fails with the same error message.
  • As a temporary workaround, users can try setting dangerouslyDisableSandbox: true in their settings, although this may not work due to the sandbox's setup violating its own rules.
  • Another possible workaround is to manually edit the settings to disable the sandbox entirely, but this is not a desirable solution.

Example

No code snippet is provided as the issue is more related to configuration and sandbox setup.

Notes

The issue seems to be a regression introduced in a recent update, and the auto-update feature compounds the problem by reverting any manual downgrades. The fact that dangerouslyDisableSandbox: true does not work as expected suggests a deeper issue with the sandbox implementation.

Recommendation

Apply workaround: disable the sandbox entirely by manually editing settings. This is not a desirable solution, but it may be the only way to get Claude Code working until the underlying issue is fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Bash tool calls should execute. At minimum, dangerouslyDisableSandbox: true should actually disable the sandbox.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] bwrap sandbox completely broken — "Can't create file at .zshrc: Read-only file system" kills ALL Bash tool calls [3 comments, 2 participants]