All articles

Invoking Subagents Explicitly vs Automatically

There are three ways to get a subagent working, and each fits a different moment.

Explicit: name it yourself

Just tell Claude which agent to use: "use the code-reviewer subagent to check my changes." This is the most predictable route. You know exactly which helper runs, so reach for it when you want control or when you have an agent built for the task at hand.

Automatic: let Claude delegate

Claude can pick a subagent on its own, based on each agent's description field. This is why the description matters so much. Write it as a clear "when to use this" so Claude can match it to the right requests:

---
name: code-reviewer
description: Reviews changed code for bugs and style issues. Use after writing or editing code, before committing.
---

You review code changes and report the most important issues first.

With a description like that, asking "can you look over what I just changed?" can hand the work to this agent without you naming it.

Session-wide: start as an agent

You can launch a whole session as one agent from the command line:

claude --agent code-reviewer

The session then runs with that agent's instructions from the start. This suits a focused sitting where every prompt is the same kind of work.

Which to use

Use explicit invocation when you want certainty, automatic when you want convenience, and --agent when the entire session has one job. In all three, run /agents to see what is available and to manage your definitions.

Comments

Be the first to comment.