Subagent feature added to Gemini CLI
Key point
Gemini CLI now officially supports specialized subagents.
Details
Gemini CLI has begun officially supporting a multi-agent architecture that delegates complex, repetitive tasks to specialized subagents.
Each subagent can have its own independent context window, custom system instructions, dedicated tool set, and separate MCP servers, reducing context pollution in the main session. The full execution result of a subtask is returned to the main agent as a single response, allowing the primary session to focus on overall goals and final decision-making.
Custom subagents are defined as Markdown files + YAML frontmatter.
- Placing them in
~/.gemini/agentsmakes them personal global agents - Committing them to
.gemini/agentsin a repository shares them at the project level - They can also be bundled by including them in the
agents/directory of Gemini CLI extensions
As an example, frontend-specialist is introduced. This agent is configured with the role of Senior Frontend Specialist / UI/UX Architect, and prioritizes modular architecture, Core Web Vitals optimization, and WCAG 2.1+ accessibility as its main criteria. However, its role is limited to analysis and improvement suggestions, and it does not directly modify code.
Default built-in subagents are also provided.
- generalist: for general-purpose tasks
- cli_help: for answering questions about Gemini CLI's own documentation/usage
- codebase_investigator: for codebase exploration, architecture mapping, and bug root-cause analysis
Explicit delegation is also possible using @agent syntax, and description-based automatic routing is supported. Multiple subagents can be run in parallel, which can reduce time for tasks like research or refactoring, but caution is needed since large-scale code edits carry a higher risk of conflicts and can hit usage limits more quickly.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.