docs/features/subagents.mdx
Subagents let Cline spawn focused research agents that run in parallel. Each subagent gets its own prompt and context window, explores the codebase independently, and returns a detailed report to the main agent. This keeps the main agent's context clean while gathering broad information fast.
<Tip> Subagents is an experimental feature. Behavior may change in future releases. </Tip>When Cline uses the use_subagents tool, it launches independent agents simultaneously. Each one:
Subagent costs (tokens and API spend) are tracked separately per subagent and rolled into the task's total cost. You can see per-subagent stats (tool calls, tokens, cost) in the chat UI as they run.
Subagents are enabled by default. Cline decides when parallel research is worth the overhead — you don't need to opt in or call them out in your prompt. To turn subagents off, disable the use_subagents tool in Settings → Features → Agent.
This setting applies across all editors (VS Code, JetBrains, CLI).
When subagents are enabled, Cline picks them up on its own when a task benefits from parallel exploration. You can also nudge it explicitly by asking for parallel research in your prompt.
Example prompts:
Each subagent prompt should describe a focused research question. Cline will run them in parallel and synthesize the results. You can also run only one subagent when the task is small enough that parallel discovery would be unnecessary overhead.
Subagents follow the Read project files auto-approve permission. If you have "Read project files" enabled in Auto Approve, subagent launches will be auto-approved.
If auto-approve is off, Cline will ask for your approval before launching subagents, showing you the prompts it plans to send.
Subagents are read-only research agents. Here is what they have access to:
| Tool | Purpose |
|---|---|
read_file | Read file contents |
list_files | List directory contents |
search_files | Regex search across files |
list_code_definition_names | List top-level classes, functions, and methods |
execute_command | Run read-only commands (ls, grep, git log, git diff, etc.) |
use_skill | Load and activate skills |
Subagents cannot write files, apply patches, use the browser, access MCP servers, or perform web searches. They also cannot spawn their own subagents.
<Note> Commands run by subagents execute in the background and are restricted to read-only operations. Subagents will not run commands that modify files or system state. Subagents also benefit from command pipelines and filters to narrow output quickly before reading files, for example `rg ... | sort | uniq`. </Note>Subagents work best when you need broad context from multiple areas of a codebase at once:
For small, focused tasks where you already know which files to look at, subagents add unnecessary overhead. Just ask Cline directly.