CLAUDE_CODE_SUBPROCESS_ENV_SCRUB silently overrides sandbox.enabled:false with no warning

Resolved 💬 2 comments Opened Apr 17, 2026 by dennisgregory-lab Closed Apr 17, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Setting CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 silently forces bubblewrap sandbox activation, overriding sandbox.enabled: false and sandbox.failIfUnavailable: false in settings.json. No warning, no log, and the error produced looks like a kernel capability issue — not a config conflict.

What Should Happen?

sandbox.enabled: false should disable the sandbox. If an env var overrides settings.json, Claude Code should warn the user or document this behavior.

Error Messages/Logs

bwrap: Creating new namespace failed, kernel doesn't support user namespaces: Operation not permitted

Steps to Reproduce

  1. Set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 in the environment (docker-compose environment block)
  2. Set sandbox.enabled: false and sandbox.failIfUnavailable: false in settings.json
  3. Attempt to run any Bash tool

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.x

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Root cause: CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 forces bubblewrap regardless of sandbox settings. Docker on kernels without user namespace support (Synology NAS, kernel 4.4) cannot use bubblewrap.

Fix: Remove CLAUDE_CODE_SUBPROCESS_ENV_SCRUB from the environment.

Footgun for Docker deployments — silent override + misleading error message + no documentation makes it extremely hard to diagnose.

View original on GitHub ↗

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