Answer: You create a custom subagent by defining it as a Markdown file (`.md`) with YAML frontmatter, placed either at the project level in `.gemini/agents/*.md` or at the user level in `~/.gemini/agents/*.md`. The file must start with YAML frontmatter enclosed in triple-dashes `---`, and the body of the markdown file becomes the agent's System Prompt. Status: Confirmed Entry: tool/gemini-cli/agents-and-automation/create-custom-subagent Revision: 1 Digest: sha256:89e130e4a1323237 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:18:17Z Last changed: 2026-11-13T03:18:17Z Last verified: 2026-11-20T12:52:32Z Next check: 2026-11-21T12:52:32Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of file format | Markdown files (`.md`) with YAML frontmatter | [1] | 2026-11-20 project-level location | .gemini/agents/*.md | [1] | 2026-11-20 user-level location | ~/.gemini/agents/*.md | [1] | 2026-11-20 frontmatter requirement | triple-dashes `---` | [1] | 2026-11-20 body role | System Prompt | [1] | 2026-11-20 Sources: [1] Google. "Subagents". https://geminicli.com/docs/core/subagents.md Role: primary. Accessed: 2026-11-20T12:52:32Z Quote: "Custom agents are defined as Markdown files (`.md`) with YAML frontmatter." (Supports: file format) Quote: "**Project-level:** `.gemini/agents/*.md` (Shared with your team)" (Supports: project-level location) Quote: "**User-level:** `~/.gemini/agents/*.md` (Personal agents)" (Supports: user-level location) Quote: "The file **MUST** start with YAML frontmatter enclosed in triple-dashes `---`." (Supports: frontmatter requirement) Quote: "The body of the markdown file becomes the agent's **System Prompt**." (Supports: body role) Published: 2026-10-16T02:36:07Z Snapshot SHA-256: 4b9baa88628b0a2bdaea87dc6b9a5c5dd2d998274ba9a93cc6ed23c53b8ee2db (captured 2026-11-13T03:18:17Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:18:17Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:52:32Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:52:32Z Last attempt: 2026-11-20T12:52:32Z Notes and limitations: Extracted automatically from a single official source (section "Creating custom subagents"). Related: https://latestn.com/tool/gemini-cli/agents-and-automation/create-hook-script How do I create a hook script for Gemini CLI? https://latestn.com/tool/gemini-cli/agents-and-automation/create-skill-with-prompt How do I create a new Agent Skill in Gemini CLI using a prompt? https://latestn.com/tool/gemini-cli/agents-and-automation/define-remote-subagent How do I define a remote subagent in Gemini CLI? https://latestn.com/tool/gemini-cli/agents-and-automation/automated-issue-triage What automated triage happens when I open an issue in Gemini CLI? https://latestn.com/tool/gemini-cli/agents-and-automation/contributor-workflow-acceptance What is the contributor workflow and acceptance criteria for adding behavioral evaluations to Gemini CLI? https://latestn.com/tool/gemini-cli/agents-and-automation/create-custom-agent-skill How do I create a custom Agent Skill in Gemini CLI? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:18:17Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/gemini-cli/agents-and-automation/create-custom-subagent/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/gemini-cli/agents-and-automation/create-custom-subagent POST: https://latestn.com/dispute/tool/gemini-cli/agents-and-automation/create-custom-subagent with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/gemini-cli/agents-and-automation/create-custom-subagent?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I create a custom subagent in Gemini CLI? Revision 1, last verified 2026-11-20T12:52:32Z. https://latestn.com/tool/gemini-cli/agents-and-automation/create-custom-subagent (accessed 2026-11-21T09:58:10Z). @misc{LatestN_tool_gemini_cli_agents_and_automation_create_custom_subagent_r1, title = {How do I create a custom subagent in Gemini CLI?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/gemini-cli/agents-and-automation/create-custom-subagent}}, note = {Revision 1; digest sha256:89e130e4a1323237; last verified 2026-11-20T12:52:32Z; accessed 2026-11-21T09:58:10Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/gemini-cli/agents-and-automation/create-custom-subagent