The Deska blog

Which Agents Can Spawn Subagents?

Explore which agents can spawn subagents, the architecture of hierarchical swarms, and how tools like Claude Code and Deska handle multi-agent orchestration.

· 10 min read

The shift from linear chat interfaces to autonomous workflows has raised a fundamental question for developers: which agents can spawn subagents? This capability, often referred to as hierarchical orchestration or agentic spawning, allows a primary agent to delegate specialized tasks to secondary processes. Instead of a single model attempting to solve a monolithic problem, a master agent breaks the task into chunks, initializes new instances with specific system prompts, and monitors their output. This pattern is essential for complex software engineering where one agent might focus on architectural changes while another handles unit testing.

The Architecture of Subagent Spawning

Spawning a subagent is not merely a recursive call to an LLM. It involves a sophisticated lifecycle management process. The parent agent must possess the capability to define a scope, provide a context window subset, and establish a termination condition for the child. This is typically achieved through tool calling where one of the available tools is a constructor for a new agent.

There are three primary ways this manifests in modern developer tools. First, there is the monolithic approach where the agent simulates a conversation with itself. Second, there is the swarm approach where multiple specialized agents exist in a flat hierarchy. Third, there is the true hierarchical approach where a coordinator spawns workers on demand. The latter is most effective for reducing context drift, as subagents only receive the specific data needed for their assigned task.

Leading Agents with Spawning Capabilities

Several tools have emerged as leaders in the autonomous agent space. Their approaches to subagent management vary based on their underlying architecture and intended use case.

Claude Code

Claude Code, developed by Anthropic, is a command line tool that demonstrates high levels of autonomy. While it operates primarily as a single powerful agent, its ability to execute complex, multi step plans mimics the behavior of a subagent coordinator. It can spin up background processes to run tests or research files while it continues to process the main task. It excels at maintaining a high density of context while performing discrete actions across a filesystem.

OpenCode and Research Agents

Open source implementations like OpenCode often utilize a worker pattern. In these systems, a controller agent analyzes a prompt and determines if a specialized subagent is required. For example, if a task involves heavy data processing, the controller might spawn a Python interpreter subagent. This modularity allows developers to swap out the underlying models for different subtasks, perhaps using a faster model for simple script execution and a larger model for architectural reasoning.

Codex CLI

The Codex CLI approach is centered on direct command execution. While it does not always spawn independent subagents in a formal hierarchy, it utilizes a chain of thought process that acts as a functional equivalent. It breaks down a user request into a sequence of executable steps, treating each step as a mini agent task with its own validation loop.

Orchestration in Deska

Deska provides a unique environment for observing and managing these agentic behaviors. Because it is a local-first desktop application with an infinite canvas, it allows developers to run different agents side by side. You can find more details on how these work together at agents.

In the Deska workspace, you can open Claude Code, Codex CLI, and OpenCode as separate panels. This setup allows you to manually orchestrate a multi agent workflow. For example, you might use one panel to run a global search while another performs a refactor. The Ask Deska assistant acts as a high level coordinator within this workspace. It can drive the environment by opening new terminals or editor panels based on your voice or chat commands.

The canvas layout is particularly useful when agents start spawning subtasks. Instead of losing the history in a single scrolling terminal, you can spread the outputs across the workspace. If an agent generates a long list of logs, you can move that panel to the side and continue working in the editor. This visual management prevents the cognitive overload that usually happens when an agent spawns multiple streams of information.

Comparing Agent Hierarchies

The following table compares how different systems handle the delegation of tasks and the spawning of child processes.

ToolSpawning LogicContext ManagementEnvironment
Claude CodeInternal task loopsDeep context windowTerminal/CLI
OpenCodeWorker subagentsTask specific snippetsModular CLI
DeskaSide by side panelsVisual canvas separationDesktop App
AutoGPTRecursive spawningVector memoryCLI/Web

Security and Local Execution

A major concern when allowing agents to spawn subagents is the potential for recursive loops or unauthorized file access. When an agent has the power to create another agent, the security perimeter can become blurry. This is why a local-first approach is vital.

By running these agents on your own machine, you ensure that any subagent spawned is subject to the same local permissions as the parent. Deska enforces this by keeping all code, files, and sessions on your hardware. If you are using the mobile app to monitor these agents, the communication happens through a secure relay that pairs your devices directly. No ports are exposed to the internet, which is a critical safeguard when running autonomous agents that can execute shell commands.

Frequently Asked Questions

Which agents can spawn subagents automatically?

Most autonomous agents like Claude Code or OpenCode use internal loops to simulate subagent behavior. True spawning, where a new independent process is created, is often found in agentic frameworks like LangGraph or CrewAI. These frameworks allow a primary agent to initialize a new instance with a distinct set of tools and a specific mission, effectively creating a hierarchy of workers.

How do I manage multiple agents at once?

Managing multiple agents requires a workspace that can handle concurrent outputs. Using a tool like Deska allows you to place different agent terminals side by side on an infinite canvas. You can zoom out to see the progress of all agents or zoom in on a specific panel to intervene. This prevents the logs of one agent from burying the important output of another.

Can subagents access my local files safely?

Safety depends on the environment where the agent runs. In a local-first setup, agents only have access to the directories you explicitly grant them. Using the docs/privacy guidelines, you can ensure that agents and their spawned children operate within a restricted scope. Always review the plan an agent generates before it starts spawning subtasks that modify your filesystem.

Building Your Multi Agent Workspace

The ability to spawn subagents is transforming how we write code. It moves the burden of coordination from the human to the AI, but it requires a robust interface to monitor the results. Whether you are using Claude Code for its deep integration or OpenCode for its flexibility, having a visual workspace is the key to maintaining control.

You can start building your own multi agent environment today. The Deska workspace is free and works on Mac, Windows, and Linux. It gives you the terminals, editors, and canvas you need to run these powerful tools together.

Download Deska

💡 Ideas+🐛 BugsSuggest a feature or report a bug