Subagents
Learn how Bob uses subagents to handle focused, self-contained tasks in isolated contexts without polluting the main conversation.
What are subagents?
A subagent is an independent agent that Bob can spawn to handle a focused, self-contained task. It runs in its own isolated context window, executes its assigned work, and returns a summary of the results back to the main conversation.
Subagents are useful for work that would otherwise add large amounts of irrelevant content to the ongoing conversation—for example, deeply exploring a section of a codebase to gather specific information before Bob continues with the main task.
How subagents work
When Bob spawns a subagent:
- A new, independent agent is created with its own context window.
- Bob passes it a description of the focused task to perform.
- You are prompted to approve the spawn before it starts. Bob waits until you confirm.
- The subagent executes the task using its available tools.
- The subagent returns a summary of its findings back to Bob.
- Bob uses that summary to continue the main conversation.
The subagent runs separately from the main conversation. It does not share state, files, or tool results with Bob unless Bob explicitly passes them in the description.
Subagent types
There are two subagent types, each suited to different tasks:
| Type | Description | Best for |
|---|---|---|
explore | Read-only codebase exploration, runs on a lighter model | Searching and summarizing code, finding relevant files, understanding structure |
general | Full tool access, runs on the default model | Any self-contained task requiring reads, writes, or commands |
Context and conversation history
By default, a subagent does not see the parent conversation history. This keeps its context lean and focused on the task at hand.
When a subagent needs to understand prior decisions, constraints, or preferences expressed earlier in the conversation, Bob can set fork_context: true to pass the conversation history into the subagent.
Mode restrictions
The mode you are working in controls which subagent types Bob is permitted to spawn. Some modes allow all subagent types; others restrict spawning to specific types or disallow it entirely. If a subagent spawn is not permitted by the active mode, Bob will complete the work directly without spawning.
When Bob uses subagents
Bob uses subagents sparingly. The default is always to do the work directly without spawning a subagent. A subagent is only considered when all of the following are true:
- The task is clearly self-contained and only a summary is needed back.
- It would add significant irrelevant content to the main context.
- It cannot be accomplished with one or two direct tool calls.
Bob does not use subagents for:
- Simple file reads or quick searches.
- Single-tool operations.
- Tasks where the relevant context is already available.
Subagents vs. subtasks
Subagents and subtasks are related but distinct concepts:
| Subagent | Subtask | |
|---|---|---|
| Visibility | Runs silently in the background | Appears in the UI with its own breadcrumb and conversation |
| Interaction | Not interactive—returns only a summary | Fully interactive—you can follow progress and continue the conversation |
| Purpose | Gather information or complete isolated work without polluting main context | Handle work complex enough to benefit from dedicated tracking and a separate thread |
| Output | Summary returned to Bob | Independent conversation thread |
Use subagents for background information-gathering. Use subtasks for complex work that benefits from visibility and a dedicated conversation.
Related topics
- Subagent tools —
spawn_subagenttool reference - Subtask tools —
start_subtasktool reference
Modes
Modes are specialized personas that tailor Bob's behavior for your specific tasks. Each mode offers different capabilities and access levels to help you accomplish particular goals more efficiently.
Context mentions
Reference specific elements of your project directly in Bob conversations using @ mentions for precise, context-aware assistance.