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 ·

--bg rejects --agents given as a file

Using --bg with --agents pointing at a file now fails; pass the agents as inline JSON instead

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

--bg starts a session as a background agent. --agents defines custom subagents (helper agents Claude can hand work to), either as JSON typed directly on the command line or as a file. If you combine --bg with the file form, Claude Code now stops with this error:

"--bg can't read --agents from a file: a background session is interactive, and the file form works only with --print. Pass the agents as inline JSON."

Why

The file form of --agents only works with --print, the non-interactive mode. If you start background sessions with custom subagents, write them out as inline JSON.

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