claude-code - 💡(How to fix) Fix sandbox.enabled: false ignored at runtime; allowWrite emits doubled path prefix (2.1.116) [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#51704Fetched 2026-04-22 07:55:05
View on GitHub
Comments
3
Participants
2
Timeline
8
Reactions
0
Timeline (top)
commented ×3labeled ×3cross-referenced ×2

On 2.1.116, sandbox.enabled: false is accepted by the config parser but the runtime filesystem policy is still enforced, and a separate parser bug in sandbox.filesystem.allowWrite emits paths with a doubled prefix. Together these make it impossible to either opt out of the sandbox or configure a working allowlist.

Filing separately from #35986 because (a) this is a 2.1.116 reproduction with a minimal config, and (b) the allowWrite doubling (Symptom B below) is a distinct parser defect that blocks the workaround path #35986 implies.

Root Cause

Filing separately from #35986 because (a) this is a 2.1.116 reproduction with a minimal config, and (b) the allowWrite doubling (Symptom B below) is a distinct parser defect that blocks the workaround path #35986 implies.

Fix Action

Fix / Workaround

Filing separately from #35986 because (a) this is a 2.1.116 reproduction with a minimal config, and (b) the allowWrite doubling (Symptom B below) is a distinct parser defect that blocks the workaround path #35986 implies.

When a user configures an explicit allowlist as the workaround, runtime evidence shows the paths are emitted with the .claude segment doubled. Observable fingerprint in the runtime allowlist:

  • #35986 — sandbox.enabled: false ignored
  • #50781 — user-visible EROFS symptom
  • #18631 — last-known-good version (2.1.1)
  • #40133 — managed-settings workaround
  • #17727 — bwrap flag handling

Code Example

{ "sandbox": { "enabled": false } }

---

$ touch ~/.claude/MEMORY/.probe
touch: cannot touch '/home/<USER>/.claude/MEMORY/.probe': Read-only file system

---

/home/<USER>/.claude/<somedir>           ← correct form
/home/<USER>/.claude/.claude/<somedir>   ← parser-mangled form, no such path on disk
RAW_BUFFERClick to expand / collapse

Summary

On 2.1.116, sandbox.enabled: false is accepted by the config parser but the runtime filesystem policy is still enforced, and a separate parser bug in sandbox.filesystem.allowWrite emits paths with a doubled prefix. Together these make it impossible to either opt out of the sandbox or configure a working allowlist.

Filing separately from #35986 because (a) this is a 2.1.116 reproduction with a minimal config, and (b) the allowWrite doubling (Symptom B below) is a distinct parser defect that blocks the workaround path #35986 implies.

Environment

  • Claude Code 2.1.116 (native-binary build)
  • Linux host
  • No MDM (/etc/claude-code/managed-settings.json not present)
  • No ANTHROPIC_* or sandbox-relevant CLAUDE_* env vars

Symptom A — sandbox.enabled: false does not disable the sandbox

Minimal config

Both ~/.claude/settings.json and ~/.claude/settings.local.json:

{ "sandbox": { "enabled": false } }

No filesystem sub-block. No other sandbox configuration anywhere.

Expected

Sandbox disabled; arbitrary filesystem writes within the user's own home succeed.

Actual

Runtime policy still carries a populated filesystem.write.allowOnly list, and writes to directories that are in that allowlist nevertheless fail EROFS. Example (directory is explicitly listed in the runtime allowlist):

$ touch ~/.claude/MEMORY/.probe
touch: cannot touch '/home/<USER>/.claude/MEMORY/.probe': Read-only file system

So two things fail together: the enabled: false flag does not short-circuit filesystem policy, and the policy itself does not honor its own allowlist entries.

Symptom B — allowWrite path parser doubles the prefix

When a user configures an explicit allowlist as the workaround, runtime evidence shows the paths are emitted with the .claude segment doubled. Observable fingerprint in the runtime allowlist:

/home/<USER>/.claude/<somedir>           ← correct form
/home/<USER>/.claude/.claude/<somedir>   ← parser-mangled form, no such path on disk

No user configuration contains the doubled form; it is introduced somewhere between config parse and runtime policy assembly.

Repro across versions

VersionSymptom ASymptom B
2.1.92Not fully testedDoubled path observed; allowWrite block dropped from runtime
2.1.116enabled: false ignoredDoubled path still present in runtime

Impact

Users hit a closed loop: allowWrite is unusable (Symptom B), and the enabled: false escape hatch doesn't actually escape (Symptom A). The only current options are to Docker-wrap Claude Code or roll back ~115 versions to 2.1.1 (the last-good version named in #18631).

Related

  • #35986 — sandbox.enabled: false ignored
  • #50781 — user-visible EROFS symptom
  • #18631 — last-known-good version (2.1.1)
  • #40133 — managed-settings workaround
  • #17727 — bwrap flag handling

Ask

  1. Confirm whether sandbox.enabled: false is intended to bypass the filesystem policy layer. If yes, this is a runtime-enforcement regression.
  2. Fix the allowWrite path-doubling parser so the documented workaround is usable in the interim.
  3. If neither is planned for the next release, publish a pinned version that users can target without rolling back 115 releases.

extent analysis

TL;DR

The most likely fix involves addressing the parser bug that doubles the prefix in sandbox.filesystem.allowWrite paths and ensuring sandbox.enabled: false correctly disables the sandbox.

Guidance

  • Verify the intention of sandbox.enabled: false regarding bypassing the filesystem policy layer to confirm if this is a regression.
  • Investigate and fix the allowWrite path-doubling parser issue to enable the documented workaround.
  • Consider publishing a pinned version that allows users to target a specific release without rolling back numerous versions.
  • Review related issues (#35986, #50781, #18631, #40133, #17727) for potential insights into the problems and possible solutions.

Example

No code snippet is provided due to the lack of specific code-related details in the issue.

Notes

The issue seems to involve two distinct problems: the sandbox.enabled: false flag not disabling the sandbox as expected and a parser bug that doubles the prefix in allowWrite paths. Addressing these issues may require changes to the configuration parser and the runtime policy enforcement.

Recommendation

Apply a workaround by configuring an explicit allowlist with the correct paths, taking into account the doubled prefix issue, until a fixed version is released. This approach may help mitigate the problem temporarily but does not address the root causes.

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…

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 sandbox.enabled: false ignored at runtime; allowWrite emits doubled path prefix (2.1.116) [3 comments, 2 participants]