{"version":"2.1.281","anchor":"bg-rejects-agents-given-as-a-file","canonical_anchor":"bg-rejects-agents-given-as-a-file","heading":"--bg rejects --agents given as a file","tier":"use","area":"Sessions","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281\/e\/bg-rejects-agents-given-as-a-file","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281","markdown":"### --bg rejects --agents given as a file\n\nUsing --bg with --agents pointing at a file now fails; pass the agents as inline JSON instead\n\n**What**\n\n`--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:\n\n\"--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.\"\n\n**Why**\n\nThe 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.\n\n- Area: Sessions\n- Names: `--agents`\n- Tier: Use it now\n- Useful: 2\/5\n- Signal: 1\/5"}