Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial

--restricted

cli in the build documented JSON

A Claude Code CLI flag, read out of the shipped bundle. It has been in the build since v2.1.248, including the newest one read.

Start in restricted mode. Use it when an evaluation harness drives claude on a shared machine and Claude Code must not run commands or read that machine's user and project settings. Claude Code removes the built-in tools that run commands or code, and WebFetch, unless you name them individually in --tools, not through the default preset. It also confines the built-in file tools to the working directories, loads only managed settings and --settings, refuses bypassPermissions, and refuses to create cloud sessions. Requires Claude Code v2.1.248 or later

Anthropic's own wording. Read off CLI reference, captured 2026-09-26.

First seen v2.1.248 27 Aug 2026
Last seen v2.1.308 22 Oct 2026
Builds51 / 149on this box, as of v2.1.308
Written about v2.1.248 first named in a changelog, 27 Aug 2026
v2.1.248in the build not in the build never minedv2.1.308

In the changelogs

18

Releases whose published page names --restricted.

  1. v2.1.300
    Help for --restricted no longer lists REPL among the removed tools

    The help text for --restricted drops REPL from its list of code-running tools that restricted mode removes

    found in this entry's text, named in this entry

  2. v2.1.295
    New CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG mode restricts your own Claude Code files

    Setting CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG starts a session that restricts your own Claude Code files, alongside the other restricted modes

    found in this entry's text

  3. v2.1.292
    Attached files are checked again to be the exact path that was approved

    Under --restricted or the read block, an attached file must open at the same path that was approved, closing a gap through links swapped mid-read

    found in this entry's text, named in this entry

  4. v2.1.290
    Attachment error messages show the file path in a tidied form

    Errors about attachment paths now show a tidied version of the path instead of exactly what was typed

    found in this entry's text, named in this entry

  5. v2.1.290
    --safe-mode is now checked the same way as --restricted

    The --safe-mode flag now goes through the same check as --restricted and --strict-mcp-config, run when it is needed

    found in this entry's text, named in this entry

  6. v2.1.287
    plugin install --replace explains that it needs a full plugin id

    Running plugin install --replace without a name@marketplace id now says that id is needed and that nothing was installed

    found in this entry's text

  7. v2.1.281
    Background handoff carries added directories and extra dispatch args

    Sending a session to the background with the left arrow now carries your added directories and more launch arguments

    found in this entry's text

  8. v2.1.257
    New settings key to confine file reads to trusted working directories

    Reads outside your working directories can be made to fail closed, with a prompt option that persists the setting.

    found in this entry's text, named in this entry

  9. v2.1.248
    New --restricted session mode

    New --restricted flag starts a locked-down session with no shell tools and no settings files.

    named in this entry, found in this entry's text

  10. v2.1.248
    Restricted sessions drop implicit file allowances and cannot be talked out of a denial

    Restricted sessions drop implicit file allowances, and a denial can't be argued away.

    named in this entry, found in this entry's text

  11. v2.1.248
    Prewarmed and dispatched background sessions inherit restriction

    Background sessions spawned from a restricted session stay restricted.

    named in this entry, found in this entry's text

  12. v2.1.248
    Restricted sessions handled the same way whether set by flag or environment

    Setting CLAUDE_CODE_RESTRICTED now restricts a session exactly as --restricted does.

    named in this entry, found in this entry's text

  13. v2.1.248
    New sessions started from fleet view inherit --restricted

    New background sessions started from a restricted session inherit --restricted.

    named in this entry, found in this entry's text

  14. v2.1.248
    --restricted confines file tools to the working directory

    Restricted sessions block file paths outside the working directory with no approval offered.

    named in this entry, found in this entry's text

  15. v2.1.248
    Claude in Chrome is now also skipped in restricted sessions

    Restricted sessions skip Claude in Chrome browser wiring, same as safe mode.

    named in this entry, found in this entry's text

  16. v2.1.248
    Auto-memory is off in restricted sessions

    Restricted sessions never write auto-memory, regardless of your settings.

    named in this entry, found in this entry's text

  17. v2.1.248
    --restricted refuses attachments from outside the working directory

    In restricted mode, attachments from outside your working directory are rejected up front.

    named in this entry, found in this entry's text

  18. v2.1.248
    Restricted sessions deny out-of-directory file access outright

    Restricted sessions now deny out-of-directory reads and writes outright, with no prompt.

    named in this entry, found in this entry's text

First cited

9

The earliest release whose published evidence quoted --restricted was v2.1.248, 27 Aug 2026. That is the oldest release this project wrote about it, so it is a floor on the name's age and not the release that introduced it. It is not a presence reading: which builds carried the name is the table below.

ReleaseDateThe span that was quoted
v2.1.24827 Aug 2026--restricted confines the file tools to the working directory.
v2.1.24827 Aug 2026--restricted only sends files from inside it.
v2.1.24827 Aug 2026--restricted: path outside the working directory
v2.1.24827 Aug 2026...(n.restricted ? ["--restricted"] : []),
v2.1.24827 Aug 2026Cloud sessions cannot be created from a --restricted session: they would not enforce it.
v2.1.24827 Aug 2026[Claude in Chrome] Skipping chrome wiring: --safe-mode or --restricted

3 further spans in the ledger name it. The list above is the earliest first and stops at 6.

Presence across releases

1
BuildsHow manyDatesReading
v2.1.248 – v2.1.30851 builds27 Aug 2026 → 22 Oct 2026 ◆in the build

Build by build

51

One row per release since the first build this name was read out of. Absent means the build was read and the name was not in it, never mined means no bundle for that release was ever archived, and a declared type or a default is only ever what that release's own bundle stated.

BuildDateStateThe record behind it
v2.1.24827 Aug 2026·addedverdict: added
v2.1.25027 Aug 2026·presentverdict: present
v2.1.25128 Aug 2026·presentverdict: present
v2.1.25231 Aug 2026·presentverdict: present
v2.1.2571 Sep 2026·presentverdict: present
v2.1.2581 Sep 2026·presentverdict: present
v2.1.2592 Sep 2026·presentverdict: present
v2.1.2603 Sep 2026·presentverdict: present
v2.1.2614 Sep 2026·presentverdict: present
v2.1.2636 Sep 2026·presentverdict: present
v2.1.2658 Sep 2026·presentverdict: present
v2.1.2668 Sep 2026·presentverdict: present
v2.1.2679 Sep 2026·presentverdict: present
v2.1.26810 Sep 2026·presentverdict: present
v2.1.26911 Sep 2026·presentverdict: present
v2.1.27012 Sep 2026·presentverdict: present
v2.1.27114 Sep 2026·presentverdict: present
v2.1.27214 Sep 2026·presentverdict: present
v2.1.27315 Sep 2026·presentverdict: present
v2.1.27416 Sep 2026·presentverdict: present
v2.1.27517 Sep 2026·presentverdict: present
v2.1.27618 Sep 2026·presentverdict: present
v2.1.27718 Sep 2026·presentverdict: present
v2.1.27819 Sep 2026·presentverdict: present
v2.1.28022 Sep 2026·presentverdict: present
v2.1.28123 Sep 2026·presentverdict: present
v2.1.28224 Sep 2026·presentverdict: present
v2.1.28325 Sep 2026·presentverdict: present
v2.1.28428 Sep 2026·presentverdict: present
v2.1.28529 Sep 2026·presentverdict: present
v2.1.28630 Sep 2026·presentverdict: present
v2.1.2871 Oct 2026·presentverdict: present
v2.1.2882 Oct 2026·presentverdict: present
v2.1.2893 Oct 2026·presentverdict: present
v2.1.2905 Oct 2026·presentverdict: present
v2.1.2916 Oct 2026·presentverdict: present
v2.1.2926 Oct 2026·presentverdict: present
v2.1.2937 Oct 2026·presentverdict: present
v2.1.2948 Oct 2026·presentverdict: present
v2.1.2958 Oct 2026·presentverdict: present
v2.1.2969 Oct 2026·presentverdict: present
v2.1.29914 Oct 2026·presentverdict: present
v2.1.30014 Oct 2026·presentverdict: present
v2.1.30115 Oct 2026·presentverdict: present
v2.1.30216 Oct 2026·presentverdict: present
v2.1.30318 Oct 2026·presentverdict: present
v2.1.30419 Oct 2026·presentverdict: present
v2.1.30520 Oct 2026·presentverdict: present
v2.1.30621 Oct 2026·presentverdict: present
v2.1.30721 Oct 2026·presentverdict: present
v2.1.30822 Oct 2026·presentverdict: present

Read out of the published npm bundle release by release, and out of Anthropic's own documentation as this site captured it. Nothing on this page is a description anybody here wrote about what the CLI flag does. All CLI flags.

Feedback