Home › Rules › GitHub Copilot subagents
GitHub Copilot subagents: turning them on, picking models, /fleet, limits and cost
Short answer: a subagent is a helper the main Copilot agent sends off to do one job in its own context window; only its answer comes back to your chat. In VS Code (Copilot harness) and Copilot CLI you just ask for one, for example "use a subagent to find where login is handled." In JetBrains, Eclipse and Xcode it's a preview you switch on in Copilot's settings, and it needs a custom agent. Visual Studio and Copilot on GitHub.com don't have it. Helpers make their own model calls, so they can cost more, and the CLI caps how many run at once by plan.
Writing the agent files themselves (where .agent.md goes, every header field, tool aliases) is on GitHub Copilot custom agents. This page is about the delegating part: switching it on, asking for it, choosing the model, running many at once, watching them, and keeping the bill down.
Where subagents work, and how to switch them on
GitHub's customization cheat sheet marks subagents as available (✓), in preview (P) or missing (✗). The "how" column comes from GitHub's "Using subagents in your IDE" page and VS Code's own subagent page:
| Where | Status | How to turn it on |
|---|---|---|
| VS Code, Copilot harness | ✓ | Nothing to turn on. Copilot delegates with its built-in task tool when you ask, or on its own |
| VS Code, Local harness (deprecated, going away by February 2027) | ✓ | Chat view: pick Local and Agent, open Configure Tools, select Run Subagent (agent/runSubagent) |
| JetBrains IDEs (IntelliJ and the rest) | P | Tools > GitHub Copilot > Edit Settings > Chat > tick Enable Subagent. Needs a custom agent first |
| Eclipse | P | The Copilot status bar icon > Edit Preferences > Chat > tick Enable sub-agent. Needs a custom agent first |
| Xcode | P | Editor > GitHub Copilot > Open GitHub Copilot for Xcode Settings > Advanced > Enable Subagents. Needs a custom agent first |
| Copilot CLI | ✓ | On already. /subagents turns single helpers on or off |
| Visual Studio | ✗ | "Not currently available," per GitHub |
| Copilot on GitHub.com | ✗ | Not listed. GitHub's comparison page does list the separate GitHub Copilot app as supported |
In the three preview IDEs, GitHub says you must have custom agents configured before subagents work. How to make one is on the custom agents page; the Test Runner below is a good first one.
Asking for a subagent
There are three ways, and they're the same in every editor that has the feature:
- Let Copilot decide. It reads your request, the
descriptionof each custom agent, and the tools it has, and may hand the job off by itself. It may also just do the work in the main chat. - Ask by name. "Use the Test Runner subagent to..." names a custom agent; "use a subagent to..." gets a general helper.
- Call the tool (Local harness only): put
#runSubagentin the prompt.
VS Code's guide says to spell out four things when you delegate: the goal, the files or context that matter, whether the helper may edit anything, and what it should hand back. The helper doesn't see your chat history (it gets the task and what the harness passes along), so anything it needs has to be in the request. Then check that a subagent actually ran, and didn't just get described. Two prompts we'd start with:
Use the Test Runner subagent to run the tests for src/cart/.
Report the failures in this chat. Don't fix anything yet.
Use two subagents to look at my current changes without editing files.
One checks for bugs and missing error handling, the other checks which
changes have no test. Merge both lists, drop duplicates, worst first.
Free rules starter pack for Cursor, Claude Code, Codex and Antigravity
One shared AGENTS.md that works across Cursor, Claude Code, Codex, Copilot and Antigravity, plus database and test rules in each tool's format. Unzip it into your project and fill in two sections. I'll email you the link.
Free. No spam. Unsubscribe anytime. See our privacy note.
The second one is the "two reviewers" pattern from VS Code's guide. Use parallel helpers only for jobs that don't need each other's results.
Copilot CLI's seven built-in helpers
You get these without writing anything. GitHub's CLI reference also says which ones read your repo's instruction files (copilot-instructions.md, AGENTS.md, CLAUDE.md):
| Helper | What it's for | Reads repo instructions? |
|---|---|---|
explore | Quick look around the code; answers come back in under 300 words. Fine to run several at once | No |
task | Runs commands like tests, builds and lints. Short summary if it passes, full output if it fails | No |
general-purpose | Bigger multi-step jobs in a separate context window | Yes |
code-review | Reviews diffs for bugs, security problems and logic errors. Won't change code | No |
security-review | Security-only review; flags an issue only when it's over 80% sure it can be exploited. Won't change code | Not listed |
research | Searches GitHub repositories, fetches files, checks claims and cites what it found | Not listed |
rubber-duck | A second opinion on a plan, design, code or tests, from a different model than the main one | Not listed |
Your own custom agent, when it's run as a helper, skips your repo instructions unless its file says include-custom-instructions: true. Starting the CLI with --no-custom-instructions beats that line every time. Two more rules from the reference: helpers get the same permissions as the main session and can't raise them, and only the main agent can save or vote on memories (helpers can still read them).
Rubber duck on autopilot: type /rubber-duck with a question any time. To let Copilot call it on its own, open /subagents, pick rubber-duck, press Enter and toggle Proactive invocation. GitHub says it then checks in at moments like right after planning a non-trivial change, and usually skips it for small changes.
Making your own helper
Any custom agent can be a helper. Two header fields decide who can use it, and they're easy to mix up:
user-invocable: falsehides it from your agent picker. Other agents can still call it.disable-model-invocation: truestops other agents from calling it. Leave it out for a helper.
The description is what the main agent reads when it decides whether to hand off, so spell out what the helper is for and which kinds of request should go to it. And limit the tools list: VS Code's docs warn that a "don't edit files" sentence in the instructions doesn't stop edits. Only the tool list does. Here's a helper that can read, search and run commands but has no edit tool. Save it as .github/agents/test-runner.agent.md; it works in VS Code's Copilot harness and in Copilot CLI:
---
name: Test Runner
description: Runs this project's tests, or one test file, and reports what failed and why. Use when asked to run tests, check a fix, or find failing tests. Never edits files.
user-invocable: false
tools: ['read', 'search', 'execute']
---
You run tests and report results. You never change files.
1. Look up the test command this project already uses (an npm script,
a Makefile target, pytest settings or similar). Don't invent one.
2. Run only what you were asked to run. If no file was named, run the
whole suite once.
3. For every failing test, report its name, where it lives (file:line),
the error in one sentence, and the likely cause.
End with one line: how many passed, how many failed, and the exact
command you ran.
In VS Code you can also make it from Chat: Open Customizations > Agents > New Agent, then check it shows up there with no file errors. Moving a coordinator over from the Local harness? Its agents list of allowed helpers and any runSubagent wording are Local-only; the Copilot harness doesn't accept the list and delegates with task. VS Code suggests plain wording such as "delegate this review to the reviewer agent" so the same file works in both.
Picking a model for a subagent
A cheaper model for narrow jobs is the usual reason to bother. Here's who wins when several settings ask for different models:
| Where | Order (first one set wins) | Watch out for |
|---|---|---|
| Copilot CLI | 1. a model named for that one call, 2. the subagents entry in ~/.copilot/settings.json (what /subagents saves), 3. the agent file's model or models, 4. the parent session's model | Session on Auto: every helper uses the session's resolved model. modelPolicy: "required" in the agent file blocks overrides and refuses to run rather than swap models |
| VS Code, Copilot harness | The agent file's model (pick it from the completions in the file) | VS Code doesn't forward model-policy when it converts agent files for the Copilot runtime, so don't count on it to lock a helper's model |
| VS Code, Local harness | 1. a model given to runSubagent, 2. the agent's model, 3. the calling chat's model | A model above the main model's cost tier, or not available, fails with suggestions. There's no automatic fallback |
| JetBrains, Eclipse, Xcode | GitHub's page says helpers use the same model and tools as the main session | No per-helper model setting is documented |
In the CLI, /subagents (also /agents) is the menu for this: a model per helper, on/off per helper, and the rubber-duck toggle. It writes to your settings file, so you can also edit it by hand. Each entry under agents can set model, modelPolicy, effortLevel and contextTier, and "inherit" means "use the parent session's value." This one makes code reviews use the session's model, lets rubber duck chip in on its own, and switches the research helper off:
{
"subagents": {
"agents": {
"code-review": { "model": "inherit" },
"rubber-duck": { "autoInvoke": true }
},
"disabledSubagents": ["research"]
}
}
/fleet: many helpers on one plan
/fleet works in Copilot CLI and the GitHub Copilot app. Copilot splits your request into pieces, works out which depend on which, and runs the independent ones as parallel helpers while it coordinates. GitHub's suggested flow:
- Press Shift+Tab for plan mode and work out a plan with Copilot.
- Pick Accept plan and continue in Autopilot execution mode + /fleet to let it finish on its own, or exit to interactive mode and type
/fleet implement the planif you want to answer questions along the way. - Name a custom agent for part of the job if you have one:
/fleet Implement the plan. Have @test-runner check every new test.
From the command line, --fleet does the same and needs a prompt from -p (runs and exits), -i (starts interactive) or piped input, for example copilot --fleet -p "Update the docs for every package" --allow-tool write. It can't be combined with --acp. GitHub's own caution: if the job is one step after another, /fleet may not help at all.
Watching what a helper is doing
- VS Code chat view: click the subagent marker in the reply, or Open Subagent, to see its conversation. The Sessions view lists nested chats but not helpers, so follow them from the chat that started them.
- VS Code Agents window: helper chats are also in the Chats dropdown (hidden from the tab strip, and they survive a window reload). Alt+click one to open it beside the parent.
- Read-only: you can't type into a helper's chat in VS Code; send follow-ups through the main chat. If the helper was allowed to edit, check the real file changes, not only its summary.
- Copilot CLI
/tasks: Enter opens a helper's own view, where you can send it a steering message;ashows every nesting level,fshows finished ones, X kills one, R removes a finished one, B sends a running foreground one to the background.
How many at once, and how deep
Copilot CLI has two limits. Concurrency is how many helpers run at the same moment across the whole session; past it, new requests are turned down until one finishes. Depth is how many helpers can be stacked inside each other. The reference gives concurrency by plan:
| Copilot plan | Helpers at once (CLI) |
|---|---|
| Free / Education | 2 |
| Pro / Pro+ | 4 |
| Max | 8 |
| Business | 16 |
| Enterprise | 32 |
| Usage-based billing | 32 |
Only usage-based billing can change these, with subagents.maxConcurrency (capped at 32) and subagents.maxDepth; on other plans both settings are ignored. The default depth is where GitHub's pages don't agree: see below.
In VS Code's Local harness, a helper can't start its own helpers unless you turn on chat.subagents.allowInvocationsFromSubagents, and then only five levels deep. VS Code says that setting does nothing for the other harnesses, and it gives no concurrency number.
Cost, and the "slow" question
- Every helper is its own model call. VS Code's docs: a smaller main context "doesn't necessarily mean lower total usage or cost." GitHub:
/fleet"may therefore cause more GitHub AI Credits to be consumed." - Give helpers a lighter model. GitHub's usage tutorial suggests it, since a helper's job is narrow and changing its model doesn't touch the main chat's cache. VS Code's version: plan with a strong model, hand the steps to helpers on a cheaper model, and let the main agent check the results.
- Keep small jobs in the main chat. Delegating has its own overhead, so VS Code says not to bother when isolation plus a cheaper model wouldn't make up for it.
- See it per helper. In VS Code,
chat.subagents.showCreditUsage(off by default) adds AI credit use to each subagent marker. In the CLI, a--max-ai-creditscap counts helpers too (since 1.0.112), and--usage-output-filegroups helper use by name.
{
"chat.subagents.showCreditUsage": true,
"github.copilot.chat.skillTool.enabled": true
}
The second line is for the next section. On speed: "copilot subagents slow" is a common search, but neither GitHub nor VS Code gives timing numbers. What they do say is that parallel helpers finish sooner only when the pieces are independent, and that coordinating costs something.
For what AI credits cost on each plan and model, see GitHub Copilot AI credits explained.
Skills that run as a subagent (VS Code)
Normally a skill's instructions land in the main agent's context. In VS Code you can set context: fork in a SKILL.md header so the skill runs in its own helper and only the result comes back. It needs the experimental github.copilot.chat.skillTool.enabled setting turned on (second line of the settings box above). VS Code suggests it for skills that read lots of files and return something short. Save this as .github/skills/dependency-audit/SKILL.md; the folder name matches name:
---
name: dependency-audit
description: Lists outdated or unused dependencies in this project and what each upgrade would touch. Use when asked to check, audit or clean up dependencies.
context: fork
---
Check this project's dependencies. Do not install, upgrade or remove anything.
1. Read the dependency files (package.json, requirements.txt, go.mod or
similar) and the lock file.
2. List packages that look unused: never imported anywhere in the code.
3. List packages with a newer major version, and the files that import
each one.
Return two short tables (unused, outdated) and nothing else.
GitHub's docs don't mention context: fork for Copilot CLI, so treat it as a VS Code feature. More on skill files: GitHub Copilot skills.
Hooks for helpers (Copilot CLI)
Two hook events fire for helpers. subagentStart runs before a helper starts; it can't stop it, but any additionalContext it prints is put in front of the helper's first message, and a matcher regex picks which helpers by name (it has to match the whole name). subagentStop runs when one finishes; it can block (make the helper keep going) or replace the answer the parent gets with modifiedResponse. The built-in general-purpose helper fires neither one. Files go in .github/hooks/ in your repo:
{
"version": 1,
"hooks": {
"subagentStart": [
{
"type": "command",
"matcher": "code-review|security-review",
"bash": "echo '{\"additionalContext\": \"Tests live in tests/. Flag any change under src/payments/ that has no test.\"}'",
"timeoutSec": 10
}
]
}
}
This hands both review helpers the same two facts about your project every time they start, without adding them to the main chat.
How subagents changed
Dates are from the Copilot CLI changelog (version in brackets) and the VS Code docs history:
| Date (2026) | Change |
|---|---|
| Jan 2 | Built-in helpers for exploring and for running tasks (CLI 0.0.374) |
| Feb 17 | Autopilot and /fleet open to all users (0.0.411); two days later /fleet checks its helpers' work and runs more at once (0.0.412) |
| Apr 9 | Depth and concurrency limits added "to prevent runaway agent spawning" (1.0.22) |
| Jun 30 | Limits adjustable in /settings, usage-based billing only (1.0.66) |
| Jul 16 | Default nesting depth lowered from 6 to 4 (1.0.71) |
| Nov 5 | Higher default concurrency for plans without usage-based billing (1.0.106) |
| Nov 12 | Agents with user-invocable: false show up in /subagents so you can set their model or switch them off (1.0.110) |
| Nov 13 | Helpers count toward --max-ai-credits (1.0.112) |
| Nov 19 | VS Code refreshes its subagents page (docs commit "Refresh Subagents") |
| Nov 23 | CLI help now says the limit settings are ignored without usage-based billing (1.0.115) |
When a subagent doesn't do what you expect
- The main agent does the job itself: ask for a subagent outright, with a clear task and what to return, then look at the tool activity to confirm one ran.
- Your helper is never picked: check the harness, the folder, file errors, and that it doesn't set
disable-model-invocation: true.user-invocable: falseonly hides it from you. - No subagent option in IntelliJ, Eclipse or Xcode: tick the setting from the table above and set up a custom agent first.
- Local coordinator stopped delegating after you switched to the Copilot harness: it's still asking for
runSubagent. Reword it to name the helper agent instead. - Helper used tools you didn't expect: tool names differ by harness. Fix the
toolslist; a line in the instructions won't hold it back. - The model you asked for didn't run: make sure that model is offered in your harness. In the CLI, a session set to Auto overrides it.
- Helper ignored your repo rules (CLI): add
include-custom-instructions: trueto its file. - New helpers refused in the CLI: you're at your plan's concurrency limit. Wait for one to finish or kill one in
/tasks. - The answer is too broad: narrow the task, name the files, say what to return, and send the follow-up through the main chat.
What the docs don't cover
We looked and couldn't find these in GitHub's or VS Code's docs on Nov 25, 2026, so we're not guessing:
- Any concurrency or depth limit for VS Code's Copilot harness, JetBrains, Eclipse or Xcode.
- How many AI credits a typical subagent or
/fleetrun uses. There's no per-helper price, only the warning that it can add up. - Speed: no timings for helpers in any editor.
- When Visual Studio or GitHub.com will get subagents. JetBrains has no subagent page of its own, and the newest Copilot plugin notes don't mention them.
Where GitHub's and VS Code's pages disagree
- Can a helper start its own helpers? GitHub's IDE page: "they cannot create other subagents." VS Code: yes in the Local harness with a setting, up to five levels. GitHub's CLI reference: yes, nested helpers show as a tree in
/tasks. - CLI default depth. The "Subagent limits" table and the settings reference say 6 (maximum 256). The same reference's
COPILOT_SUBAGENT_MAX_DEPTHrow says 4 (range 1 to 128), and changelog 1.0.71 lowered the default from 6 to 4. Our custom agents page quotes the 6. - CLI default concurrency. Plan-based (2 to 32) in the limits table; "default 32, range 1 to 256" in the
COPILOT_SUBAGENT_MAX_CONCURRENTrow. - Which model a helper uses. GitHub's IDE page: "the same tools and AI model as the main session." VS Code's docs and the CLI reference: a custom agent's
modelcan pick a different one. - Switching it on in VS Code. GitHub's VS Code tab says to enable the
runSubagenttool. VS Code says that's the Local harness way; the Copilot harness usestaskand needs no switch.
Where they disagree, go by the page for the tool you're in, and check the number in your own /subagents or /settings screen.
FAQ
What is a subagent in GitHub Copilot?
It's a helper agent the main Copilot agent hands one job to, like researching how a feature works or running the tests. The helper works in its own context window and sends back only its result, so the files it read never crowd your main chat. You don't have to write a custom agent to get one: you can just ask for a subagent in your prompt.
How do I turn on subagents in VS Code?
With the Copilot harness (the default going forward), there's nothing to switch on: VS Code's docs say Copilot delegates with its own task tool, so you just ask for a subagent in chat. In the older Local harness, open Configure Tools and select Run Subagent (agent/runSubagent). GitHub's own VS Code instructions still describe that Local-style step.
Do Copilot subagents work in IntelliJ and other JetBrains IDEs?
Yes, in preview. GitHub's docs say to go to Tools > GitHub Copilot > Edit Settings, open Chat and tick Enable Subagent, and that you need at least one custom agent set up first. Eclipse and Xcode have their own checkbox or toggle. Visual Studio doesn't have subagents yet.
Can a Copilot subagent use a different model?
In Copilot CLI and the VS Code Copilot harness, yes: set model in the custom agent's file, or in the CLI use /subagents (saved in ~/.copilot/settings.json). If your session model is Auto, CLI subagents use the session's model instead. GitHub's IDE page says subagents use the same model as the main session, so in JetBrains, Eclipse and Xcode expect the session model.
Do subagents cost more AI credits?
They can. Each subagent makes its own model requests, so VS Code's docs say a smaller main chat doesn't mean lower total use, and GitHub says /fleet may use more AI credits. GitHub suggests running subagents on cheaper models. In the CLI, subagents also count toward a --max-ai-credits limit.
How many Copilot subagents can run at once?
In Copilot CLI it depends on your plan: 2 on Free and Education, 4 on Pro and Pro+, 8 on Max, 16 on Business and 32 on Enterprise or usage-based billing. Only usage-based billing can change it (subagents.maxConcurrency, up to 32). VS Code and the other IDEs don't publish a number.
Related setups
Other tools do the same thing under other names: Claude Code subagents (whose .claude/agents/ files Copilot CLI also reads), Antigravity subagents and Kiro custom agents. For the rules every helper should follow, see copilot-instructions.md examples.
Next step for GitHub Copilot: Agent Skills
Skills are folders your AI coding agent loads only when the job comes up, and Claude Code, Cursor and OpenAI Codex all read the same SKILL.md format. The Vibe Coder Skills Pack ($9) is 6 ready-to-copy SKILL.md skills (fix-one-bug, stop-the-loop, leak-check, ship-check, explain-project, builder-handoff) for Claude Code, Cursor and OpenAI Codex. Also included in the 6-kit bundle.
Get the Skills Pack for $9 on Gumroad → See what's inside
One .zip of skill folders plus one markdown file. 7-day refund, no questions asked.
Best value
All 6 kits for $29 — or $20.30 with code WELCOME30 (through Nov 30)
Subagents split up the work. The kits tell your AI what the work is, step by step: a small game, a Discord bot, an email-triage agent, an MVP, or a cleanup of messy code.
Get all 6 kits for $29 → See what's in each kit
$29 instead of $48 for the six kits bought separately; WELCOME30 takes 30% off that at checkout ($20.30). Instant download from Gumroad. 7-day refund, no questions asked.
Related
- GitHub Copilot custom agents and prompt files (.agent.md, .prompt.md, examples)
- GitHub Copilot skills (folder, SKILL.md, gh skill, examples)
- GitHub Copilot AI credits explained (what they cost and how to save)
- copilot-instructions.md examples (7 copy-paste instruction files)
- GitHub Copilot vs Cursor vs Claude Code (prices side by side)
- Claude Code subagents examples (7 copy-paste subagents)
- Google Antigravity subagents
- Plan mode guide (6 tools + 6 plan prompts)
- Free rules file generator
Sources
- VS Code docs: Use subagents
- VS Code docs: Custom agent file reference
- VS Code docs: Create and manage custom agents
- VS Code docs: Migrate customizations to the Copilot harness
- VS Code docs: Agent skills (run a skill in a forked context)
- VS Code docs: AI settings reference
- VS Code docs: Optimize AI credit usage
- VS Code docs: Agent harnesses
- GitHub Docs: Using subagents in your IDE
- GitHub Docs: Delegating and parallelizing work with agents
- GitHub Docs: Speeding up task completion with the /fleet command
- GitHub Docs: Copilot CLI command reference (custom agents, subagent limits)
- GitHub Docs: Copilot CLI configuration directory (subagents settings)
- GitHub Docs: Getting a second opinion with the rubber duck agent
- GitHub Docs: Copilot hooks reference
- GitHub Docs: Copilot customization cheat sheet
- GitHub Docs: Comparing Copilot customization features
- GitHub Docs: Optimizing your AI usage
- GitHub Copilot CLI changelog
Every menu path, setting, command, limit and date here was checked Nov 25, 2026 against the VS Code docs, GitHub's Copilot docs and the Copilot CLI changelog. Subagent features change almost every week, so check the linked page if a menu or number looks different. If something here no longer matches, tell us at [email protected].