You'll noticeTier: how much it should matter to you
1Useful: my rating, 1 to 5
1Signal: worth watching, 1 to 5
PermissionsArea: what it touches
ImprovementsKind: in v2.1.281,
ImprovementsSection of the release
What
--agents is an option you can give when starting Claude Code, and it can point at a JSON file. When it does, Claude Code now records both the path you gave and the file's real location after following any shortcuts (symlinks). Any attempt to edit that file is then treated like an edit to a protected settings file.
When Claude Code works out where a settings .json file lives, it now also follows symlinks, including for files that do not exist yet.
Why
Claude cannot quietly rewrite the file that defines your --agents configuration during a session, just as it cannot freely rewrite your settings. Following symlinks means a shortcut pointing at the file does not get around that protection.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Added sinceA small documentation edit on Deploy managed settings touched a line naming --agents after this was published.| [`disableSideloadFlags`](/docs/en/settings-reference#disablesideloadflags) | Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` flags at startup. In cloud sessions, Claude Code instead starts the session and drops …managed-settingssee the edit
Confirmed sinceAnthropic's documentation has since written up --agents, on Error reference.The value you passed to `--agents` is invalid, so `claude` exits with code 1 instead of starting the session. When you pass `--safe-mode` or set [`CLAUDE_CODE_SAFE_MODE`](/docs/en/env-vars#variables), Claude Code ignores `--agents` entirel…errorssee the edit
How sure we are
Two sources agreeTwo things we can check say the same as this entry.
Anthropic's documentation agreesAnthropic's documentation has since written up --agents, on Error reference.
Anthropic's release notes agreeImproved --agents to accept the path to a JSON file (with -p) as well as inline JSON, and to allow an empty prompt