claude-code - 💡(How to fix) Fix VS Code extension ignores sandbox settings.json / /sandbox unavailable (approval-fatigue fix unreachable in IDE)

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…

Root Cause

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.

RAW_BUFFERClick to expand / collapse

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".

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

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.

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 VS Code extension ignores sandbox settings.json / /sandbox unavailable (approval-fatigue fix unreachable in IDE)