Skip to content
BENIBIX Learn

--restricted Flag

Also known as claude --restricted, Restricted mode

It starts a locked session for a shared box.

Think of it like

It is like a guest room. The guest may read, but may not cook or use the tools.

Example

Emma's team scores models on a shared server. Each run uses --restricted, so Claude cannot run commands or read anyone's settings on that box.

Why it matters

A shared machine stays safe even when the prompt asks for something it should not.

Definition

--restricted starts a locked-down session, for a test harness on a shared machine. It removes the tools that run commands or code, and WebFetch, unless you name each one in --tools. File tools stay inside the working folders. It reads only managed settings and --settings, and refuses bypass mode and cloud sessions. It needs Claude Code 2.1.248 or later.

Example code

bash
claude --restricted -p "Answer the question in task.md"
Run a test with no shell and no web fetch.
The right column shows what --restricted keeps and drops.

Common mistake

Adding --tools "default" to get the shell back. The default set does not count. Name each tool you want.

Key takeaways

  1. 1
    No shell, no code. Unless named.
  2. 2
    Working folders only. For files.
  3. 3
    No bypass, no cloud. Refused.

Compare

Learn it properly