Feature hasn't been suggested before.
Describe the enhancement you want to request
As we explore more and more subagents usage, I think what I'm proposing is a pretty natural evolution. Let me start with what we have now.
Now
Currently each opencode session is very much sequential, only designed to work on one prompt at a time. People achieve parallelization by creating multiple instances in different terminals. This works for now, but it has many issues:
- It's wasteful - there are a lot of waits in-between queries
- It's hard to track sessions - when it blocked, when it is waiting for input, none of the states are properly documented and based on my experiments it's pretty hard to derive session state from the agent storage.
- It's hard to do inter agent communication - well, this is basically a green field area, everyone does whatever.
Proposal - fork by default
Coordinator agent
The main agent should only act as a coordinator. The goal is to avoid queueing messages as much as possible.
When the user submits the prompt, first it should understand the ask, get more context (if needed), and fork the session and run it in a subagent.
I believe it should decide by itself whether to send follow up to any given subagent - this could be a tool, and the user can specify more info to find the subagent. The coordinator agent should have tools to list the running agents, read their state and read their output or changed files.
Subagents
Any session can be a subagent - It could be either a planning session, code editing, or just an ask. Each session should have a human-readable slug - Claude Code already started doing that, and it's would be easy for the user and the agent to lookup these subagents.
There is an elephant in the room regarding context - not all agents need the entire previous session after fork. Frankly this is not a new problem - Unix has the same progress flow: first it runs fork(), and creates a copy of the parent process, and then it runs exec() and replaces the whole process with a new one. This approach can be reused with subagents - it can check if the parent context is relevant, and discard it if the task is completely new.
Eventually this can be something similar to the system process model, but entirely built on agentic level of abstraction.
Communication
Agent to agent communication is out of scope of this proposal. The only communication flow that should happen is when subagent finishes - the parent agent should see summary of work, whether the agent completed or not and it can decide to retry or launch with different params.
Feature hasn't been suggested before.
Describe the enhancement you want to request
As we explore more and more subagents usage, I think what I'm proposing is a pretty natural evolution. Let me start with what we have now.
Now
Currently each opencode session is very much sequential, only designed to work on one prompt at a time. People achieve parallelization by creating multiple instances in different terminals. This works for now, but it has many issues:
Proposal - fork by default
Coordinator agent
The main agent should only act as a coordinator. The goal is to avoid queueing messages as much as possible.
When the user submits the prompt, first it should understand the ask, get more context (if needed), and fork the session and run it in a subagent.
I believe it should decide by itself whether to send follow up to any given subagent - this could be a tool, and the user can specify more info to find the subagent. The coordinator agent should have tools to list the running agents, read their state and read their output or changed files.
Subagents
Any session can be a subagent - It could be either a planning session, code editing, or just an ask. Each session should have a human-readable slug - Claude Code already started doing that, and it's would be easy for the user and the agent to lookup these subagents.
There is an elephant in the room regarding context - not all agents need the entire previous session after fork. Frankly this is not a new problem - Unix has the same progress flow: first it runs fork(), and creates a copy of the parent process, and then it runs exec() and replaces the whole process with a new one. This approach can be reused with subagents - it can check if the parent context is relevant, and discard it if the task is completely new.
Eventually this can be something similar to the system process model, but entirely built on agentic level of abstraction.
Communication
Agent to agent communication is out of scope of this proposal. The only communication flow that should happen is when subagent finishes - the parent agent should see summary of work, whether the agent completed or not and it can decide to retry or launch with different params.