VS Code extension ignores sandbox settings.json / /sandbox unavailable (approval-fatigue fix unreachable in IDE)
What happened
When using Claude Code via the VS Code extension (v2.1.156), the Bash sandbox configured in settings.json is never activated:
- A valid
sandboxblock in.claude/settings.local.json(or~/.claude/settings.json) with"enabled": trueand"autoAllowBashIfSandboxed": trueis silently ignored — Bash commands continue to go through the normal permission flow and prompt as if no sandbox were configured. - The
/sandboxslash command does not exist in the extension — typing it returns "No matching commands".
The docs (https://code.claude.com/docs/en/sandboxing) describe /sandbox and sandbox.enabled as the way to turn this on, with no mention that the IDE extension is excluded. The same config works as expected when running claude --sandbox from a terminal.
Why this matters (approval fatigue)
The sandbox is the documented remedy for permission-prompt approval fatigue (Anthropic cites ~84% fewer prompts). Allowlists structurally cannot cover the long tail of harmless commands — command substitution $(...), compound a && b gated by the least-privileged segment, and one-off novel commands all still prompt no matter how complete the allowlist is. For extension users that long tail is currently unfixable, because the one mechanism that would fix it can't be turned on.
Background
This was previously reported and closed-as-duplicate, with the chain ending in issues that are now closed and locked, and were macOS-flavored:
- #32814 → duplicate of #32416 (both CLOSED, locked)
The auto-close bot's message on those explicitly says "please file a new issue." I could not find any open issue tracking specifically "the IDE extension does not pass --sandbox / does not activate the sandbox from settings.json", so filing fresh.
Expected behavior
The VS Code (and Cursor/JetBrains) extension should honor sandbox.enabled from settings.json — i.e. spawn the underlying Claude Code process with sandboxing active (equivalent to --sandbox) — so that autoAllowBashIfSandboxed works and /sandbox (or an equivalent settings-driven activation) is available in the IDE, matching the terminal CLI and the documentation.
Environment
- Claude Code: 2.1.156
- Surface: VS Code native extension
- OS: Linux (Arch), kernel 7.0.x
- Sandbox deps present:
bubblewrap0.11.2,socat; no AppArmor unprivileged-userns restriction claude --sandboxfrom a terminal works correctly with the samesettings.json
Repro
- In the VS Code extension, add a valid
sandboxblock with"enabled": trueto.claude/settings.local.json. - Restart the extension / reload the window.
- Ask Claude to run a non-allowlisted Bash command (e.g. something using
$(...)). - Observe: it still prompts for permission;
/sandboxreturns "No matching commands".
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗