Claude Discovery

← All discoveries

Close-up of a smartphone wrapped in a chain with a padlock, symbolizing strong security.
Photo by Towfiqu barbhuiya on Pexels
tool

One Flag, No Bash, No Bypass: Claude Code 2.1.248's Lockdown Mode

2026-08-27 ยท source:

Claude Code 2.1.248 adds a --restricted flag that removes command and code execution tools and WebFetch, confines file tools to the working directory, refuses bypassPermissions, and ignores local settings files.

What it is

A new release of Claude Code, Anthropic's CLI coding agent, adding a `--restricted` flag (or `CLAUDE_CODE_RESTRICTED=1` env var) alongside other changes like per-agent prompt cache TTLs and a self-hosted-runner client label override.

What it does

With `--restricted` set, Claude Code strips out the built-in tools that run commands or code plus `WebFetch` (unless explicitly named in `--tools`), keeps file tools scoped to the working directory, refuses to honor `bypassPermissions`, and ignores user, project, and local settings files that might otherwise loosen those constraints.

Why it matters

It gives operators a single hard-to-override flag for running Claude Code in genuinely locked-down contexts, useful for CI, shared environments, or anywhere you don't trust the surrounding settings files to stay untampered.

How to use it

Pass `--restricted` on the command line or set `CLAUDE_CODE_RESTRICTED=1` before launching a session; add specific tools back explicitly via `--tools` if a restricted session still needs one of them.

Go to source →
claude-codesecuritycli