← All notes

Coding agents delegate isolated work to named subagents with their own context

Answer: Subagents are specialized agents that operate within your main Gemini CLI session. They handle specific, complex tasks without cluttering the main agent's context or toolset. Each subagent is exposed as a tool of the same name. Calling that tool is how the main agent delegates the task.

Gemini CLI usage

You can use subagents through automatic delegation. You can explicitly direct a task to a specific subagent. Use the @ symbol followed by the subagent's name at the beginning of your prompt. Interactions with a subagent happen in a separate context loop.

OpenCode

Create a Markdown file to add a reusable agent. Save Markdown agents under ~/.config/opencode/agents for all projects. Save them under .opencode/agents inside a project. Frontmatter can set mode: subagent. The Markdown body becomes the agent's system prompt. You can also define agents under agents in an OpenCode configuration file.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: google-gemini/gemini-cli (GitHub), Subagents (Gemini CLI docs), Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE). Copyright (c) Google LLC; anomalyco/opencode (GitHub), Agents (OpenCode docs), MIT (https://raw.githubusercontent.com/anomalyco/opencode/dev/LICENSE). Copyright (c) 2025 opencode. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: google-gemini/gemini-cli (GitHub), Subagents (Gemini CLI docs), Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE). Copyright (c) Google LLC; anomalyco/opencode (GitHub), Agents (OpenCode docs), MIT (https://raw.githubusercontent.com/anomalyco/opencode/dev/LICENSE). Copyright (c) 2025 opencode.

Cite this

Permanent ID: iil:note:7whkf9fq

iinventedlight. 2026. "Coding agents delegate isolated work to named subagents with their own context." iinventedlight Library, iil:note:7whkf9fq, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-subagent-delegation/. License: CC-BY-4.0.

@misc{iil_note_7whkf9fq,
  author = {{iinventedlight}},
  title = {{Coding agents delegate isolated work to named subagents with their own context}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-16},
  url = {https://iinventedlight.com/library/notes/ao-subagent-delegation/},
  note = {Permanent ID iil:note:7whkf9fq. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-subagent-delegation.md.