Follow Discord
Sweep 25 Sep 2026 · 19:33Z Build v2.1.283 504 read Stable v2.1.274 Latest v2.1.283 Next v2.1.283 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.281 ·

--agents can now take a file path instead of inline JSON, but only in print mode

--agents now accepts a path to a file of subagent definitions, but only with --print (-p); interactive sessions still need inline JSON

Use it now Notable New Features
JSON All of v2.1.281
Use it nowTier: how much it should matter to you
4Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
AgentsArea: what it touches
New FeaturesKind: in v2.1.281,
What probably matters to youSection of the release
What

The --agents flag, which defines custom subagents (helper agents Claude can hand work to) when Claude Code starts, is now written --agents <json-or-file>. Until now it took only JSON typed straight onto the command line. If the value does not start with {, Claude Code now treats it as a path to a file and reads the definitions from that file.

Reading from a file only works with --print (-p), the mode that prints a reply and exits instead of opening an interactive session, or in another non-interactive run. In an interactive session, or with --bg, only inline JSON is accepted, and a file path stops Claude Code with this error: "--agents takes a JSON object, or a file path only with --print (-p)."

The file is checked as it is read. Each of these is an error:

  • the file is missing
  • the file is too large
  • the file changed while it was being read
  • the file has more than one hard link (more than one name pointing at the same data on disk)

When the definitions are invalid, the error message now names the file they came from.

Why

Long agent definitions are easier to keep in a file than to squeeze into one command-line argument, which helps scripts and automated runs. Interactive use is unchanged.

Read from
Names in the bundle--agents
What the documentation says
--agents Create custom subagents modified, high confidence The `--agents` flag accepts JSON with a `prompt` field plus these [frontmatter](#supported-frontmatter-fields) fields: `description`, `tools`, `disallowedTools`, `model`, `permissionMode`, `mcpServers`, `hooks`, `maxTurns`, `skills`, `init… see the edit
Since it was published

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 since A small documentation edit on CLI reference touched a line naming --agents after this was published. | `--agents` | Define custom subagents dynamically via JSON. Accepts the [fields listed for CLI-defined subagents](/docs/en/sub-agents#choose-the-subagent-scope). With `--print`, the value can instead be the path to a JSON file holding the… cli-reference see the edit
Confirmed since Anthropic's documentation has since written up --agents, on Deploy managed settings. | [`disableSideloadFlags`](/docs/en/settings-reference#disablesideloadflags) | Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` flags at startup. In cloud sessions, Claude Code drops the MCP servers the server deli… managed-settings see the edit
How sure we are
Two sources agreeTwo things we can check say the same as this entry.
Anthropic's documentation agrees--agents on Create custom subagents
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

See this entry in the whole of v2.1.281 →

Feedback