VS Code extension ignores sandbox settings.json / /sandbox unavailable (approval-fatigue fix unreachable in IDE)

Open 💬 4 comments Opened May 30, 2026 by enomado

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 sandbox block in .claude/settings.local.json (or ~/.claude/settings.json) with "enabled": true and "autoAllowBashIfSandboxed": true is silently ignored — Bash commands continue to go through the normal permission flow and prompt as if no sandbox were configured.
  • The /sandbox slash 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: bubblewrap 0.11.2, socat; no AppArmor unprivileged-userns restriction
  • claude --sandbox from a terminal works correctly with the same settings.json

Repro

  1. In the VS Code extension, add a valid sandbox block with "enabled": true to .claude/settings.local.json.
  2. Restart the extension / reload the window.
  3. Ask Claude to run a non-allowlisted Bash command (e.g. something using $(...)).
  4. Observe: it still prompts for permission; /sandbox returns "No matching commands".

View original on GitHub ↗

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