A subagent in Claude Code is a separate Claude instance that the main agent spawns to handle a focused task in its own context window. The subagent does the work, a search, some research, an isolated change, and returns only the result. Your main conversation stays clean, and several subagents can run at once.

Why use a subagent?

Two reasons, and they compound:

  • A clean main context. Exploring a large codebase or reading long files fills your context window with noise. A subagent absorbs that noise and hands back just the conclusion, so the main session keeps its focus.
  • Parallelism. Independent tasks do not have to wait in line. Several subagents can investigate different parts of a problem at the same time, then report back.

When should you reach for one?

Subagents shine when a task is self-contained and the details do not need to stay in the main conversation:

  • Searching for where something lives across many files.
  • Researching a question that needs reading a lot to answer a little.
  • Running independent changes that would otherwise conflict.
  • Getting a second, independent perspective before committing to an approach.

If a task is small or tightly coupled to what you are doing right now, do it inline. Subagents pay off when the work is bulky or parallel.

How do you launch one?

You ask Claude to delegate, and it spawns the subagent for you. For parallel work, launching several at once is faster than one after another. Each runs with its own context and returns a result you can act on.

Custom agents

Beyond ad hoc subagents, you can define custom agent types in .claude/agents/, each with its own instructions and tools, for roles you use often, like a code reviewer or a focused explorer. Then you dispatch that role by name.

The takeaway

Subagents let you throw more compute at a problem without drowning your main context. Delegate the bulky and the parallel, keep the main thread for decisions, and define custom agents for the roles you reach for again and again.


Subagents are one of the advanced moves that separate casual users from power users. The Harness Engineering course covers them, plus MCP, hooks and team workflows. The first module is free, no card needed.