How to sandbox Claude Code remote-control sessions with a setting
To run shell commands in the sandbox for sessions that a claude remote-control server starts, use a settings file. The --sandbox and --no-sandbox flags never had any effect, and from v2.1.300 passing either exits with an error.
Turn on sandbox.enabled in a settings file.
// ~/.claude/settings.json
{
"sandbox": {
"enabled": true
}
}
The Remote Control server doesn't carry flags over to the sessions it creates. It lets a flag through only when dropping it doesn't change what those sessions can do, such as --verbose or --model; for any other flag, such as --settings, it refuses to start and names the flag to remove. That's why session behavior like sandboxing belongs in settings.
The sandbox is off by default. In an interactive session you can also turn it on with /sandbox.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.