Back to Learn

    Claude Code Subagents: The Config, Two We Run, and What 161 Public Agents Show

    A Claude Code subagent is a separate conversation with its own context window, system prompt, tools and model, which the main session delegates a task to and gets a report back from. This guide takes the mechanics from the documentation, lists every frontmatter field, shows the two subagents checked into this site's repository with what their first run found and cost, measures the largest public collection against the docs' own limit, and says when a subagent is the wrong tool.

    Updated

    Claude Code subagents hero: the guide title beside an editor card showing a .claude/agents/source-checker.md file with name, description, tools and model frontmatter and the start of its system prompt

    What is a Claude Code subagent, and which ones are built in?

    The subagents documentation, read on 26 September 2026, defines them in one line: “Subagents are specialized AI assistants that handle specific types of tasks.” The sentence that matters for cost and behaviour follows: “Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. It also sends its own requests, which count toward the same usage limits as your main conversation.” Two consequences fall out of that. Whatever the subagent reads never enters your conversation, only its report does. And the tokens it burns are yours.

    Six subagents ship with the CLI. The docs describe them as follows, and the two you will see most are the read-only pair:

    Built-in Claude Code subagents as described in the documentation on 26 September 2026
     ToolsWhat the docs use it for
    ExploreRead-only; Write and Edit deniedSearching and analysing a codebase without changes; skips CLAUDE.md and the git snapshot at startup.
    PlanRead-only; Write and Edit deniedGathering context during plan mode before a plan is presented.
    general-purposeEvery tool available to subagentsComplex multi-step tasks that need exploration and action.
    claudeEvery tool available to subagentsThe catch-all when a task fits no specialised agent; default for dispatched background sessions.
    statusline-setupNot specifiedRuns when you type /statusline.
    claude-code-guideNot specifiedAnswers questions about Claude Code features.

    Delegation happens four ways per the docs: Claude picks a subagent from its description automatically, you @-mention one, you name it in plain language (“use the test-runner subagent to fix failing tests”), or you start a whole session as one with claude --agent name. The description field is therefore doing two jobs, which the measurement section comes back to.

    How do you define a subagent?

    One markdown file. The frontmatter configures it; the body becomes its system prompt. The docs' own example, verbatim:

    Example from code.claude.com/docs/en/sub-agents
    ---
    name: code-improver
    description: Scans files and suggests improvements for readability, performance, and best practices. Use after writing or modifying code.
    tools: Read, Grep, Glob
    model: sonnet
    ---
    
    You are a code improvement specialist. For each issue you find, explain
    the problem, show the current code, and provide an improved version.

    Where the file lives sets its scope, and the docs list five locations in priority order, highest first: managed settings for an organisation, the --agents CLI flag for one session, .claude/agents/ in the project, ~/.claude/agents/ for all your projects, and a plugin's agents directory. The docs' advice on the project folder: “Check them into version control so your team can use and improve them collaboratively.” Files added on disk load at the next session start; ones created through /agents take effect immediately.

    Two fields are required and sixteen are optional. The full list from the docs, grouped by what each one controls:

    Every subagent frontmatter field in Claude Code's documentation on 26 September 2026
     FieldsWhat they control
    Identity (required)name, descriptionThe unique name, and when Claude should delegate to it.
    Toolstools, disallowedTools, mcpServers, skillsWhat it may call; a deny list on top of the inherited set; MCP servers it sees; skills preloaded into its context.
    Model and effortmodel, effortsonnet, opus, haiku, fable, a full model ID, or inherit; effort from low to max.
    PermissionspermissionMode, maxTurnsdefault, acceptEdits, auto, dontAsk, bypassPermissions, plan or manual; and a turn cap.
    Memory and contextmemory, omitClaudeMdPersistent notes scoped to user, project or local; whether to skip CLAUDE.md files.
    Executionbackground, isolation, hooks, initialPromptKeep it in the background; run in a git worktree; lifecycle hooks; a first turn when it is the main agent.
    Display and experimentscolor, experimentalA colour in the UI; experimental options such as a cache TTL.
    What a non-fork subagent receives at startup
    1Its systemprompt2The task messagewritten by Claude3CLAUDE.md filesunless omitted4Preloaded skillsfrom the skills field5Nothing elseno history, no read files
    1. Its system prompt: the file body
    2. The task message: written by Claude
    3. CLAUDE.md files: unless omitted
    4. Preloaded skills: from the skills field
    5. Nothing else: no history, no read files

    From the "what loads at startup" list on Claude Code's subagents page, read on 26 September 2026.

    The last box is the one to design around. The docs list what does not reach a subagent: your conversation history, skills already invoked, files Claude has already read, and the main session's auto memory. A subagent knows only what its file and its task message tell it. If it needs the schema, the task message names the file. If it needs a house rule, the rule is in the body. Our Claude Code commands guide covers the skills that can be preloaded through the skills field.

    What do 161 public subagents actually look like?

    The largest public collection is VoltAgent/awesome-claude-code-subagents, 25,335 stars, last pushed 2026-09-21, which ships an install script that copies its agents into your folder. We cloned it on 26 September 2026 and measured every definition with frontmatter: 161 files in ten categories.

    161 public Claude Code subagents by category
    Language specialists30Quality and security17Business and product17Infrastructure16Developer experience16Specialized domains16Core development13Data and AI13Meta orchestration12Research and analysis11
    161 public Claude Code subagents by category
    Categorysubagents
    Language specialists30
    Quality and security17
    Business and product17
    Infrastructure16
    Developer experience16
    Specialized domains16
    Core development13
    Data and AI13
    Meta orchestration12
    Research and analysis11

    Every definition under categories/ in VoltAgent/awesome-claude-code-subagents, measured 26 September 2026.

    Frontmatter and length across 161 public subagent definitions
     MeasuredRead against the docs
    Set a tools list161 of 161, median 6 toolsEvery one restricts tools, which the docs recommend for read-only research agents.
    Set a model153: sonnet 109, inherit 25, haiku 19Unset falls through to CLAUDE_CODE_SUBAGENT_MODEL, then the main conversation's model.
    Description lengthmedian 198 characters, longest 404Loaded for every subagent at startup so Claude can decide when to delegate.
    All descriptions together34,041 characters, about 8,510 tokens at 4 characters per token57% of the 15,000-token warning threshold if you installed all of them.
    System prompt lengthmedian 281 linesLoads only when the subagent runs, so length here is free at startup.
    Model field across 161 public subagents
    sonnet109inherit25haiku19not set8
    Model field across 161 public subagents
    Categorysubagents
    sonnet109
    inherit25
    haiku19
    not set8

    The model frontmatter value of every definition in VoltAgent/awesome-claude-code-subagents, measured 26 September 2026.

    The collection gets the tool restriction right and the description budget mostly right: installing all 161 would spend about 57% of the threshold the docs warn at, on every session start, before you type anything. The docs' fix is the one to apply before installing anything from a collection: “Trim the description fields of your subagents, and move detail into each subagent's system prompt, which only loads when that subagent runs.” The body lengths, a median of 281 lines with almost no variance, point to a generated template; read one before trusting it with edit permissions.

    Which subagents do we run, and what did the first run find?

    Two, both checked into this site's repository under .claude/agents/ on 26 September 2026, both read-only, both built for the guide workflow this page came out of. They exist because the work they do floods a conversation with output nobody needs to read twice: a list of HTTP statuses and a list of rule violations.

    The two subagents in the lovable-prompts.com repository
     JobToolsModel
    source-checkerFetches every external URL cited on one guide and reports status and final URL.Bash, Read, Grepsonnet
    guide-reviewerReviews one guide against the house content rules and reports violations by line.Read, Grep, Bashsonnet
    .claude/agents/source-checker.md
    ---
    name: source-checker
    description: Fetches every external URL cited on one /learn guide and reports HTTP status and the final URL after redirects. Use before publishing or refreshing a guide.
    tools: Bash, Read, Grep
    model: sonnet
    ---
    You check citations for lovable-prompts.com guides. You are given one page file under src/app/learn/.
    
    1. Read the file and collect every external href (http or https, not lovable-prompts.com), including URLs held in constants.
    2. Fetch each once with `curl -sL -o /dev/null -m 20 -w "%{http_code} %{url_effective}"`.
    3. Report one table: URL, status, final URL, note. Flag anything that is not 200 and anything whose final URL has a different path from the cited one.
    4. Do not edit files. Keep the report under 40 lines.

    We ran the source-checker prompt against the Cursor rules guide, published an hour earlier, on 26 September 2026. Because a file added on disk only loads at the next session start, the run used a general-purpose subagent on the same model with the file body as its task. The harness reported the cost; the subagent timed itself with date +%s at start and end.

    One measured run of the source-checker prompt on /learn/cursor-rules, 26 September 2026
     Measured
    URLs checked8
    Tool calls5 (of which 3 Bash)
    Wall time31 s (harness); 17 s between the subagent's own timestamps
    Tokens consumed112,045
    Non-200 responses0
    Findings1: cursor.com/docs/context/rules now redirects to cursor.com/docs/rules

    The finding was correct and we had missed it: Cursor moved its rules page and the citation we published pointed at the old path. The guide now cites the new one. That is the whole case for this class of subagent in 112,045 tokens: a check we would not have run by hand on a page we had just finished, with a report short enough to act on. The tokens are not small. The same eight curl calls in the main session would have cost a fraction of that, in exchange for eight blocks of output in the conversation and no summary. The trade is context for tokens.

    .claude/agents/guide-reviewer.md
    ---
    name: guide-reviewer
    description: Reviews one /learn guide against the house content rules and reports violations with line numbers. Use after drafting a guide and before the build gates.
    tools: Read, Grep, Bash
    model: sonnet
    ---
    You review guides for lovable-prompts.com. You are given one page file under src/app/learn/.
    
    Check, and report each finding as `line: rule: quote`:
    - Banned words anywhere in prose: em dash, land, lands, landed, real (except real-time), delve, leverage, robust, unlock, navigate, elevate.
    - Every number in prose has a source named in the same or the previous sentence, or comes from an imported data file.
    - Every external quotation is inside quotation marks and names its source page.
    - Every H2 is a question, and the first sentence under it answers it.
    - No affiliate URL pasted as a literal; Lovable CTAs go through lovableAffiliateUrl().
    - Dates: any "checked on" or "read on" date is today's date or earlier.
    
    Do not edit the file. End with a count of findings by rule.

    The reviewer encodes the rules every guide on this site is held to, including the banned-word list and the one-question-per-heading structure. It is the same list as the grep gate in the build, with judgement added for the rules grep cannot check, such as whether a number has a source in the same sentence.

    When should a task be a subagent, a skill, or the main session?

    Anthropic's own guidance is in How and when to use subagents in Claude Code on the Claude blog (7 April 2026), and it gives a threshold: “When a task requires exploring ten or more files, or involves three or more independent pieces of work, that's a strong signal to delegate Claude toward subagents.” The same post names the counter-case: “When step two needs the full output of step one, and step three needs both, a single session handling the chain is usually cleaner than a relay of subagents passing state through files.”

    Choosing between the main session, a skill and a subagent
     Main sessionSkillSubagent
    ContextEverything stays in the conversationRuns inside the conversationOwn window; only the report returns
    CostOne request streamOne request streamIts own requests, on your limits
    Best forSequential work where each step needs the lastRepeatable procedures you want to watchResearch summaries, parallel independent edits, unbiased review
    Worst forTen-file explorations that bury the threadOutput-heavy checksChains that pass state through files
    Defined inNothing.claude/skills/<name>/SKILL.md.claude/agents/<name>.md

    The three reasons the blog gives for delegating are research (“a subagent can explore the codebase and return a summary rather than dumping dozens of files into the conversation”), parallel independent work, and a fresh perspective for review because a subagent “doesn't inherit the assumptions, context, or blind spots from the primary conversation”. Our two subagents are the first and third kind. A migration written in three files where each depends on the previous one is the second case and stays in the main session, as does anything you want to watch happen, which is what the advanced prompting guide covers on the Lovable side with Plan mode and chains.

    Does Lovable have subagents?

    Yes, inside Plan mode, and they are the reason a plan is not a flat one credit. Lovable's Plan mode documentation says: “For larger or open-ended requests, Lovable can start subagents to research your project before it writes the plan”, and “A Plan mode message costs one credit, plus the cost of any subagents Lovable starts to research your project while planning, so a message that needs deep research costs more than one credit.” You cannot define them, restrict their tools or pick their model; the docs' one lever is “Keep planning requests specific and point them at particular files, features, or areas. Broad requests are more likely to need subagent research.”

    The design is the same as Claude Code's Explore agent with the configuration removed: research runs outside the main thread and only the plan comes back. What differs is the bill. Claude Code counts a subagent's requests against your usage limits; Lovable meters it in credits on top of the message. The Lovable credits guide has the measured burn per prompt type, and the Lovable vs Cursor page covers what an export gains when it moves to a tool where the agents are yours to configure.

    Sources

    All checked on 26 September 2026. Corpus numbers and the run log are in src/data/claudeCodeSubagents.ts in the site repository; the two subagent files are in .claude/agents/.

    Frequently asked

    What is a Claude Code subagent?↓
    In the words of Claude Code's documentation, subagents are specialized AI assistants that handle specific types of tasks, and each runs in its own context window with a custom system prompt, specific tool access and independent permissions. It sends its own requests, which count toward the same usage limits as the main conversation. You define one as a markdown file with frontmatter in .claude/agents/ (project) or ~/.claude/agents/ (personal).
    How is a subagent different from a skill or a custom command?↓
    A skill is instructions that run inside the current conversation; its output stays in your context. A subagent is a separate conversation with its own context, tools and model, and only its final report returns. The docs draw the line the same way: rules and skills load into the main session, a subagent is delegated to. Use a skill when you want the work in front of you, a subagent when you want the result without the noise.
    Which subagents are built in?↓
    Per the documentation on 26 September 2026: Explore (read-only, for searching a codebase), Plan (read-only, used in plan mode), general-purpose (every tool, for multi-step work), claude (the catch-all), plus statusline-setup and claude-code-guide for their two narrow jobs. Explore and Plan skip CLAUDE.md and the git status snapshot at startup, which is part of why they are fast.
    Can a subagent spawn subagents?↓
    Yes. The docs say a subagent can spawn subagents of its own, up to three layers below the main conversation, and that when 20 subagents are running in a session, spawning another fails with a concurrent-limit error. Both limits are environment variables you can lower. Nesting is rarely what you want; a flat fan-out from the main session is easier to reason about and to stop.
    How many subagents is too many?↓
    The docs give one hard number: a startup warning when the combined descriptions of your custom subagents exceed 15,000 tokens, because every description is loaded so Claude can decide when to delegate. The largest public collection would use roughly 8,500 of those on descriptions alone if you installed all 161, by our estimate at four characters per token. Keep descriptions short and put the detail in the body, which loads only when the subagent runs.
    Does Lovable have subagents?↓
    In Plan mode, yes, and you pay for them. Lovable's documentation says a Plan mode message costs one credit plus the cost of any subagents Lovable starts to research your project while planning, and that broad requests are more likely to need that research. You do not define or name them; Lovable decides. The lever you have is specificity: point the planning request at particular files or features.

    Related reading

    Written by

    Marco Kohns

    Marco Kohns

    Founder of ProtoBites - Venture Growth Studio

    Growth PM at a Silicon Valley scale-up (a16z and General Catalyst backed), ex-Techstars where he consulted 13 early-stage startups, Reforge-trained. Every prompt on this site comes out of shipping ProtoBites' own portfolio products.