Skip to content
BENIBIX Learn

--agent Flag

Also known as claude --agent, agent setting

It runs the main session as one of your custom agents.

Think of it like

It is like a friend plays the coach. They play that part the whole game.

Example

Lucy has a reviewer agent with its own rules and only read tools. She starts claude --agent with its name. The whole chat then runs as that agent.

Why it matters

A role you set up once can be the whole session, not just a helper Claude calls.

Definition

--agent runs the main session as one of your custom agents. The session takes that agent's prompt, its tools and its model. Give it the agent's name. It wins over the agent setting, for this session only.

Example code

bash
claude --agent code-reviewer
Start a session as the code-reviewer agent.
--agent sets the main session on the left.

Common mistake

Mixing it up with --agents. --agent picks who the main session is. --agents defines helpers.

Key takeaways

  1. 1
    Main session. As that agent.
  2. 2
    Its prompt, tools, model. All of them.
  3. 3
    Beats the setting. This session.

Compare

Learn it properly