Gemini CLI adds subagents for faster parallel AI coding

Google has just rolled out subagents in Gemini CLI, letting developers delegate frontend, tests, and docs to specialized helpers running in parallel. Each subagent gets its own tools and context, while the main session stays focused and coordinated.

Gemini CLI adds subagents for faster parallel AI coding

TL;DR

  • Subagents in Gemini CLI: Split larger jobs across specialized agents running in parallel within one main session
  • Role-based delegation: Subagents have separate instructions, tools, and context; main agent aggregates outputs
  • Concurrency + isolation: Parallel execution in separate workspaces to reduce context overload and task collisions
  • Multiple instances: Same subagent can run concurrently across packages, each analyzing different codebase areas
  • Built-in subagents: generalist, CLI-focused, codebase-focused for architecture, dependencies, and debugging
  • Custom + routing controls: Define subagents via Markdown YAML; auto-routing; explicit @agent targeting; list via /agents

Google has added a new “subagents” feature to Gemini CLI, aiming to remove a common bottleneck in AI coding workflows: agents that can only tackle one task at a time. With subagents, Gemini CLI can split larger jobs across multiple specialized agents that run in parallel, while still operating under a single main session.

Subagents are defined with their own instructions, tools, and context. The main agent delegates portions of a broader assignment to these specialists, collects their outputs, and keeps the overall workflow moving without piling everything into one long conversational thread.

One example outlined for Gemini CLI: once a backend analytics API is finished, the main agent can be asked to update the frontend, tests, and documentation—then spin up a frontend specialist, a unit test agent, and a docs writer to work concurrently.

Delegating work inside the CLI

The idea is straightforward: reduce overload on a single agent session by creating role-based helpers for repeatable tasks such as code review, testing, or documentation. Because each subagent runs with its own context, the main agent can offload scoped work and get back results without dragging every intermediate detail along in the primary thread.

The approach isn’t entirely new. Anthropic’s Claude Code has supported subagents with a similar model of delegation.

Parallel execution and context separation

A key capability here is concurrency. Gemini CLI subagents can run at the same time, so separate parts of a task—like updating UI components while tests are generated—can progress in parallel rather than in sequence.

Subagents also operate in separate working spaces, keeping instructions and outputs isolated. That separation is meant to reduce the chance of tasks colliding with each other during longer sessions.

Gemini CLI also supports running multiple instances of the same subagent at once—such as launching a frontend-focused agent across multiple packages, with each instance analyzing a different part of a codebase simultaneously.

Gemini CLI’s design keeps coordination inside a single session: subagents spin up for delegated parts of a task, then return control to the main agent. Claude Code, meanwhile, also offers “agent teams” that coordinate across multiple sessions, trading simplicity for a setup that can support longer-running work (with more overhead in defining and managing those agents).

How subagents work in Gemini CLI

Gemini CLI includes built-in subagents, including:

  • a “generalist” agent for a broad range of coding and command-line tasks
  • a CLI-focused agent for questions about how the tool works
  • a codebase-focused agent for exploring architecture, dependencies, and debugging

Custom subagents can also be created in a Markdown file using YAML frontmatter followed by plain-text instructions describing the agent’s role and behavior. These definitions can live locally or be stored alongside a project for sharing across a team.

Gemini CLI can automatically route tasks to subagents when it determines a better fit, but direct assignment is also supported: tasks can be explicitly targeted using @ followed by the agent name. Available subagents can be listed at any time with the /agents command.

Source: Tessl

Continue the conversation on Slack

Did this article spark your interest? Join our community of experts and enthusiasts to dive deeper, ask questions, and share your ideas.

Join our community