You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]:can subagent create subagent?my context is low and task is heavy #50539
You'd like subagents to be able to start their own subagents, so a heavy task can be split up without filling one context.
OpenCode v2 can already do this, but it's off by default: experimental.subagent_depth defaults to 1, so only the main agent can start subagents. To allow nesting, raise it in your opencode.json:
2 allows main → subagent → subagent. Higher values allow deeper chains. The subagent also needs permission to use the subagent tool. In v2 the setting has to go under experimental. The config docs currently show it at the top level, which v2 doesn't accept.
Thanks for the request! This is already possible: set experimental.subagent_depth above 1 in your config to let subagents start their own subagents. Closing this issue.
Activity
github-actions commentedon Sep 22, 2026
This issue might be a duplicate of existing issues. Please check:
Please review that issue and add a comment there if you have additional context or a different use case in mind.
opencodejr commentedon Oct 28, 2026
Thanks for the request, @Pressten!
You'd like subagents to be able to start their own subagents, so a heavy task can be split up without filling one context.
OpenCode v2 can already do this, but it's off by default:
experimental.subagent_depthdefaults to1, so only the main agent can start subagents. To allow nesting, raise it in youropencode.json:{ "$schema": "https://opencode.ai/config.json", "experimental": { "subagent_depth": 2 } }2allows main → subagent → subagent. Higher values allow deeper chains. The subagent also needs permission to use thesubagenttool. In v2 the setting has to go underexperimental. The config docs currently show it at the top level, which v2 doesn't accept.Related issues:
subagent_depthsubagenttool and fail when they use itIf this doesn't cover what you need, please reply with more detail. Maintainers will take that into account.
Tarquinen commentedon Nov 2, 2026
Thanks for the request! This is already possible: set
experimental.subagent_depthabove 1 in your config to let subagents start their own subagents. Closing this issue.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊