--bg
A Claude Code CLI flag, read out of the shipped bundle. No mined inventory carries it: everything below comes from what this site has written about it.
What it is
Start the session as a [background agent](/docs/en/agent-view) and return immediately. Prints the session ID and management commands. Combine with --exec to run a shell command as a background job instead of a Claude session, or with --agent to run a specific subagent. Cannot be combined with -p/--print; see the [error reference](/docs/en/errors#command-line-errors)
Anthropic's own wording. Read off CLI reference, captured 2026-08-28.
Presence across releases
The miner has never read a build containing this name. It is here because a changelog entry of ours names it, which is evidence that it existed and not evidence of which releases carried it. The inventory starts at v2.1.138 and everything older than that was never mined.
Changelog entries naming it
-
v2.1.224Clearer error when
--bgand--environmentare combinedCombining --bg and --environment now explains they are different backends and shows the right command.
named in this entry
Documentation pages
- CLI reference reference table Claude Code CLI
- Set up Claude Code for your organization mentions it Claude Code CLI
- Manage multiple agents with agent view mentions it Claude Code CLI
- Claude Code changelog mentions it Claude Code CLI
- Environment variables mentions it Claude Code CLI
- Error reference mentions it Claude Code CLI
- Run Claude Code programmatically mentions it Claude Code CLI
- Enterprise network configuration mentions it Claude Code CLI
- Choose a permission mode mentions it Claude Code CLI
- Claude Code settings mentions it Claude Code CLI
- Week 22 · May 25–29, 2026 mentions it Claude Code CLI
A reference table page is one whose own table defines this name, and it is where the description above came from. A page that mentions it carries the name somewhere in its text and may say nothing about it at all. Every page carrying it.
Read out of the published npm bundle release by release, and out of Anthropic's own documentation as this site captured it. Nothing on this page is a description anybody here wrote about what the CLI flag does. All CLI flags.