

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Agents
incomplete
2: Temperature
incomplete
3: Custom Agents
incomplete
4: Max Steps
incomplete
5: Subagents
incomplete
6: Task Permissions
incomplete
This lesson's interactive features are locked, please to keep using them
Subagents are specialized agents that your primary agent can spin off concurrently to tackle narrower jobs. OpenCode ships with two built-in subagents:
general: a general-purpose worker that can research and execute multi-step tasksexplore: a fast, read-only worker for codebase and web explorationThe big advantage is isolation.
When a primary agent invokes a subagent, that work happens in a child session instead of cluttering the context of the parent session with every search, command, and intermediate thought.
Subagents can also be cost-efficient because the isolated session can use a different model. For example, you might want your explore subagent to use a small, cheap model for searching around the codebase, then summarize its findings and inject them back into the parent session for your expensive model to analyze.
They can also be faster because subagents can run in parallel. When it launches a subagent in the background, your primary agent can keep working and receive the result when it's ready. Foreground calls wait for the subagent to finish.
Subagents are mostly called autonomously by your primary agent, just like any other tool. However, you can also invoke them manually with the @ symbol:
@explore go find all the files related to authentication and summarize their contents for me
I never call subagents explicitly (though my primary agent uses them invisibly, of course). Your mileage may vary.
Have a subagent find a gap in Sloperator's lexer tests.
Tell OpenCode to run and submit the CLI tests from the project root.