Answer: To create a custom subagent, ask Claude to write it for you or write the Markdown file yourself with YAML frontmatter; the walkthrough creates a user-level subagent saved in ~/.claude/agents/. Status: Confirmed Entry: tool/claude-code/agents-and-automation/create-custom-subagent Revision: 4 Digest: sha256:77f33bd36c108c7c (changes whenever the content changes) Timeline: Created: 2026-11-13T03:05:57Z Last changed: 2026-11-20T12:25:47Z (example file path: — → ~/.claude/agents/code-improver.md) Last verified: 2026-11-20T12:25:47Z Next check: 2026-11-21T12:25:47Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of file format | Markdown files with YAML frontmatter | [1] | 2026-11-20 user-level directory | ~/.claude/agents/ | [1] | 2026-11-20 project-level directory | .claude/agents/ | [1] | 2026-11-20 example file path | ~/.claude/agents/code-improver.md | [1] | 2026-11-20 frontmatter fields | a `name`, a `description`, a `tools` list, a `model`, and a system prompt | [1] | 2026-11-20 Sources: [1] Anthropic. "Create custom subagents". https://code.claude.com/docs/en/sub-agents.md Role: primary. Accessed: 2026-11-20T12:25:47Z Quote: "Subagents are Markdown files with YAML frontmatter." (Supports: file format) Quote: "Create a personal code-improver subagent in ~/.claude/agents/ that scans" (Supports: user-level directory) Quote: "move it to that project's `.claude/agents/` directory" (Supports: project-level directory) Quote: "Open `~/.claude/agents/code-improver.md` and confirm the frontmatter matches what you asked for." (Supports: example file path) Quote: "Claude writes the file with a `name`, a `description`, a `tools` list, a `model`, and a system prompt." (Supports: frontmatter fields) Published: 2026-11-20T02:51:46Z Snapshot SHA-256: 554874b443a109e88a2c58273dd3ccdd8e74cf6ed0536238fb704dbe0a254b43 (captured 2026-11-20T12:25:44Z) 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]. Cross-check: not-available at 2026-11-20T12:25:47Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:25:47Z Last attempt: 2026-11-20T12:25:47Z Notes and limitations: Extracted automatically from a single official source (section "Quickstart: create your first subagent"). Related: https://latestn.com/tool/claude-code/agents-and-automation/create-custom-tool How do I create a custom tool for Claude Code using the Agent SDK? https://latestn.com/tool/claude-code/agents-and-automation/create-scheduled-task How do I create a scheduled task in Claude Code Desktop? https://latestn.com/tool/claude-code/agents-and-automation/create-scheduled-task-cli How do I create a scheduled task in Claude Code from the CLI? https://latestn.com/tool/claude-code/agents-and-automation/configure-tool-search How do I configure tool search in Claude Code? https://latestn.com/tool/claude-code/agents-and-automation/continue-conversations How do I continue a conversation when running Claude Code programmatically? https://latestn.com/tool/claude-code/agents-and-automation/control-turns-and-budget How do I control how many turns or budget a Claude Code agent loop runs? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:25:47Z | changed | example file path: — → ~/.claude/agents/code-improver.md | [1] 2026-11-20T12:25:47Z | changed | creation methods: ask Claude to write it for you, or [write the file yourself](#write-subagent-files) → — | [1] 2026-11-19T12:20:55Z | changed | creation methods: — → ask Claude to write it for you, or [write the file yourself](#write-subagent-files) | [1] 2026-11-19T12:20:55Z | changed | example file path: ~/.claude/agents/code-improver.md → — | [1] 2026-11-15T12:26:06Z | changed | frontmatter fields: name → a `name`, a `description`, a `tools` list, a `model`, and a system prompt | [1] 2026-11-13T03:05:57Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/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/claude-code/agents-and-automation/create-custom-subagent POST: https://latestn.com/dispute/tool/claude-code/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/claude-code/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 Claude Code? Revision 4, last verified 2026-11-20T12:25:47Z. https://latestn.com/tool/claude-code/agents-and-automation/create-custom-subagent (accessed 2026-11-21T09:57:29Z). @misc{LatestN_tool_claude_code_agents_and_automation_create_custom_subagent_r4, title = {How do I create a custom subagent in Claude Code?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/create-custom-subagent}}, note = {Revision 4; digest sha256:77f33bd36c108c7c; last verified 2026-11-20T12:25:47Z; accessed 2026-11-21T09:57:29Z} } 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/claude-code/agents-and-automation/create-custom-subagent