# sandbox.excludedCommands

> A list of commands that run outside the sandbox.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** excludedCommands

## Think of it like

It is like a pass that lets one big kid out of the pen. The pen is too small for them.

## Definition

sandbox.excludedCommands is a settings key that names commands to run with no fence, such as tools that break in the sandbox. Each entry is written like a Bash rule: an exact command, or a start such as docker *. An entry must match each command in a call. Commands that start with sudo, eval or xargs stay fenced.

## Example

Jack's docker builds fail inside the sandbox. He adds docker * here, and docker runs outside while the rest stays fenced.

## Example code

```json
{
  "sandbox": {
    "enabled": true,
    "excludedCommands": ["docker *"]
  }
}
```

Run docker commands outside the sandbox.

## Why it matters

Some tools cannot work in a sandbox. This lets you keep it on for all the rest.

## Common mistake

Expecting docker * to free npm ci && docker build. Every command in the call has to match.

## Three principles

- **Runs outside.** Named commands.
- **Like Bash rules.** Prefix with *.
- **Whole call must match.** Every part.

## Related terms

- [sandbox.allowUnsandboxedCommands](https://learn.benibix.com/term/ai/allow-unsandboxed-commands-setting)
- [Bash Permission Rule](https://learn.benibix.com/term/ai/bash-permission-rule)
- [sandbox.enabled](https://learn.benibix.com/term/ai/sandbox-enabled-setting)

## Told apart from

- [excludedCommands vs allowUnsandboxedCommands](https://learn.benibix.com/compare/excluded-commands-setting-vs-allow-unsandboxed-commands-setting): People think both keys let commands out of the sandbox in the same way. excludedCommands is a fixed list you write, and those commands always run with no fence. The other key decides if Claude may ask to rerun a blocked command with no fence. A strict setup turns the second key off and keeps the list short.
- [excludedCommands vs Bash Permission Rule](https://learn.benibix.com/compare/excluded-commands-setting-vs-bash-permission-rule): People think putting a command in excludedCommands lets it run without asking. It does not. The list only takes a command out of the sandbox, so it runs with your full access. It still goes through your rules and your mode. In Manual mode, it still needs a Bash allow rule to skip the prompt.

---

Source: https://learn.benibix.com/term/ai/excluded-commands-setting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
