⌨️--agents Flag
Also known as claude --agents, CLI-defined subagents
It sets up helper agents for one session.
Think of it like
It is like you write a list of helpers for today. It says what each one is good at.
Example
Jack's CI script needs a test-writer helper only in CI. It passes the helper with --agents, so no agent file has to live in the repo.
Why it matters
A script can bring its own helpers, and nothing is left behind after it ends.
Definition
Example code
bash
claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You review code for bugs."}}'Common mistake
Key takeaways
- 1JSON. Name, description, prompt.
- 2This session only. No file saved.
- 3Checked at start. Bad JSON stops it.