Subagents and background tasks

Agents can hand part of a job to a subagent, or start a command that keeps running in the background. IZ Code shows both the same way for every agent: subagents get their own block and chat, background work stays visible and stoppable, and the Agent map shows the whole tree.

Subagents#

A subagent is a second agent session that works on one part of a task and reports back. Some agents start subagents on their own: Claude's Agent tool, Codex's subagents and similar features of other agents. Any agent can also call IZ Code's sessionSpawnSubAgent tool, which can start a subagent of a different agent, for example a Claude chat that asks Codex to review a file.

A subagent works on its part, asks you through the main chat, and reports back
sequenceDiagram
  participant You
  participant Main as Main agent
  participant Sub as Subagent
  You->>Main: Task
  Main->>Sub: Start with a part of the task
  Sub->>You: Permission request, in the main chat
  You-->>Sub: Allow or Deny
  Sub-->>Main: Result
  Main-->>You: Answer

In the chat, a subagent appears as a block inside the answer:

  • The block shows the subagent's title and status while it works, and the tool calls it makes are nested inside it.
  • Open Subagent opens the subagent's own chat in a tab. It is read-only: you watch what it did, but you talk to the main chat.
  • If the subagent needs permission for something, the request appears in the main chat and in the subagent's tab. Answer it in either place.

Starting a subagent never asks for permission (unless your Permission Policy is Deny all). The subagent itself still asks for each edit or command, under the same rules as the main chat.

Cross-agent subagents#

sessionSpawnSubAgent takes the agent to start and the task for it:

  • With wait on (the default), the calling agent waits for the result. If the subagent takes longer than about 45 seconds, the call returns a result id and the agent asks for the result later with sessionGetSubAgentStatus.
  • With wait off, it returns at once and the agent checks back later.
  • Subagents can start their own subagents, up to four levels deep.

Background work#

When an agent runs a long command in the background (a dev server, a watcher, a long test run), IZ Code keeps it as background work of the chat:

  • The agent starts it with runCommand and background: true, reads its output with commandOutput and stops it with commandStop.
  • Claude's own background shell commands go through these tools, so they are tracked too.
  • A subagent still running when the main turn ends also becomes background work.

Stopping a background command stops the whole process tree, including child processes it started.

The Agent map#

  1. Open it Click Agent Map in the chat header, or run Agent Map from the Command Palette.
  2. Read the tree The chat's agent is at the top, with every subagent below it. Each node shows its status (Running, Waiting for you, Done, Failed, Cancelled), how long it ran, and its tokens or tool calls.
  3. Open a subagent Click a node to open that subagent's chat. Back to the chat returns to the main conversation.
  4. Stop background work The list of background tasks shows shell commands and subagents still running. Click Stop to end one.

How each agent reports subagents#

AgentSubagentsBackground commands
ClaudeIts Agent / Task tool, with a full child chatTracked through IZ Code's command tools
CodexIts subagents, with a full child chat and token countsCodex's own command tool, shown as a tool call
Google AntigravityIts subagents; tool calls go to the child chatShown as a running tool call
Kimi CodeIts Agent tool; the child chat shows the prompt and final resultKimi's own shell
Any agentsessionSpawnSubAgentrunCommand with background: true

Settings#

Subagents and background work have no switches of their own. They follow your permission settings:

SettingValuesDefault
izcode.agent.permissionModedefault, ask, autoAllow, denydefault
izcode.agent.chatModeControlsApprovalstrue, falsetrue
Last updated: December 1, 2026Was this page helpful?