Original URL: https://getagenttools.com/blog/copilot-cli-subagents/

# Copilot CLI subagents: custom agents in .github/agents/, a model per agent, and "custom agent not found"

13 Nov 2026Marek.

- copilot
- coding-agents
- agent-ops

Yes. GitHub Copilot CLI runs subagents. The main agent hands part of a task to a subagent with its own context window, through a tool called `task`. Seven agents ship built in. A custom agent is a Markdown file with YAML frontmatter, usually `*.agent.md`, in `.github/agents/` for a repository or `~/.copilot/agents/` for you. This post is for people who know subagents from Claude Code. I do not run Copilot CLI. The Copilot CLI facts here come from the GitHub docs and the CLI changelog up to 1.0.106, read on 6 November 2026.

 

```markdown
# .github/agents/reviewer.agent.md
---
name: reviewer
description: Reviews a diff for bugs and missing tests. Does not edit files.
tools: ["read", "search"]
model: claude-sonnet-4.6
include-custom-instructions: true
---
Review the current changes. List each finding with file and line.
```

  

- **Two words, two things.** Per the docs, a custom agent is "a definition of a specialist". A subagent is "an agent doing delegated work in a separate context window".
- **Where.** `~/.copilot/agents/` wins over `.github/agents/`. The repo's `.claude/agents/` loads after that.
- **How to call one.** `/agent`, `--agent`, the agent's name in a prompt. Or no name, and the main agent picks by `description`.
- **Model.** Usually `model` in the file, else the outer agent's model. A `subagents` override in settings beats the file, and under `Auto` subagents take the session model.
- **How I know.** Docs and changelog only. No session of my own.

 

How the same idea works on the Anthropic side, with my two agent files, is in [Claude Code subagents](https://getagenttools.com/blog/claude-code-subagents/). The Codex side is in [Codex subagents](https://getagenttools.com/blog/codex-subagents/), and opencode in [opencode subagents](https://getagenttools.com/blog/opencode-subagents/). Gemini CLI, with agent files in `.gemini/agents/`, is in [Gemini CLI subagents](https://getagenttools.com/blog/gemini-cli-subagents/).

 

## Does Copilot CLI have subagents?

 

Yes. Copilot CLI delegates work to subagents, each with [its own context window](https://getagenttools.com/blog/copilot-cli-context-window/). The [command reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference) lists four delegation tools. `task` runs subagents, `list_agents` lists them, `read_agent` checks a background agent and `write_agent` messages a running one. The model decides when to delegate. Per the docs, it "may equally choose to handle the work directly in the main agent".

 

The reference table has seven built-in agents, each with a default model. `explore` runs on `gpt-5.6-luna` and returns "focused answers under 300 words".

 

## How do I create custom subagents in Copilot CLI?

 

Write one Markdown file per agent and restart the CLI. Or type `/agent` in interactive mode and press N. The CLI asks for Project (`.github/agents/`) or User (`~/.copilot/agents/`) and can draft the file from your description. Only `description` is required. The how-to page ends with "Restart the CLI to load your new custom agent".

 

The ID comes from the path. Copilot CLI drops `.agent.md` or `.md` and turns folder separators into `--`. So `agents/security/security-auditor.agent.md` has the ID `security--security-auditor`. A duplicate ID loads once, from the highest source. The `name` field does not deduplicate.

 

For Claude Code users one row matters. Copilot CLI reads `.claude/agents/` in the repository, after `.github/agents/`. Per the changelog for 1.0.36 (24 April 2026), it no longer loads custom agents from `~/.claude/`.

 

## How do I use a custom agent in Copilot CLI?

 

Four ways, per the [how-to page](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli). Pick it from the `/agent` list. Name it in the prompt, as in "Use the security-auditor agent on all files in the /src/app directory". Write a prompt that matches its `description` and let Copilot infer it. Or run `copilot --agent security-auditor --prompt "..."`. A display name works too, in quotes.

 

`/agent` and `--agent` make it the session agent, which follows your repository instructions. Spawn that same agent as a subagent, though, and by default it won't get `copilot-instructions.md`, `AGENTS.md` or `CLAUDE.md`. You have to add `include-custom-instructions: true` to its file.

 

On the switch for auto-delegation, the docs don't agree with each other. The CLI reference has `infer`, default `true`. The [custom agents configuration](https://docs.github.com/en/copilot/reference/custom-agents-configuration) page, written for Copilot in the cloud, calls `infer` retired and points to `disable-model-invocation`. The changelog for 0.0.411 says custom agents use `disable-model-invocation` instead of `infer`, "backward compatible".

 

## How does subagent delegation work in Copilot CLI?

 

The main agent is the orchestrator here: it breaks your prompt into subtasks and, if it decides to, hands some or all of them to subagents, running whichever ones don't depend on each other in parallel. Use `/fleet` when you want that on purpose, or `copilot --fleet -p "..."` to get it without the TUI. You can also name a custom agent right in the prompt, per the [/fleet page](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli/speed-up-task-completion).

 

How many you get depends on your plan. Per the reference, that's 2 concurrent subagents on Free, 4 on Pro and Pro+, 8 on Max, 16 on Business and 32 on Enterprise, with a default depth of 6. Only usage-based billing can change them, with `subagents.maxConcurrency` and `subagents.maxDepth`. Then the same page lists `COPILOT_SUBAGENT_MAX_CONCURRENT` (default 32) and `COPILOT_SUBAGENT_MAX_DEPTH` (default 4). That doesn't add up, and the docs don't say which one wins.

 

## Which model does a Copilot CLI subagent use?

 

Usually the model in its agent file, or the outer agent's model when the file sets none, but not always. The reference gives the order, highest first. An explicit per-call value, then the `subagents` override in `~/.copilot/settings.json`, then the file's `model` or `models`, then the parent session. One exception. When the session model is `Auto`, subagents always inherit the resolved session model.

 

`/subagents`, also `/agents`, sets that override per agent. `models` takes a list in priority order. A model the CLI cannot honor falls back to the session model. With `modelPolicy: "required"` the dispatch is refused instead.

 

Spelling is the trap. The reference table writes `modelPolicy` and `reasoningEffort`. The how-to example and the changelog write `model-policy` and `reasoning-effort`. I could not tell which form the CLI reads. Since 1.0.106, `-p --agent` warns on stderr about frontmatter keys Copilot ignores.

 

## Why does Copilot CLI say "custom agent not found"?

 

The GitHub docs do not describe this message. The one mention I found is in the changelog for 1.0.106, released on 5 November 2026: "Fix intermittent `Custom agent not found` errors during overlapping custom-agent reloads". I read that as a bug that could hit a correct file. On an older version, update first.

 

The other causes are my reading of the location and ID rules, not a documented list.

 

**Not restarted.** A new agent file loads after a restart.

 

**Wrong ID.** A file in a subfolder gets the folder in its ID, joined with `--`.

 

**Wrong folder.** `~/.claude/agents/` is not read since 1.0.36. The repo's `.claude/agents/` is.

 

**Built-in name.** Since 1.0.106, a custom agent with a built-in agent's name is not offered as a second agent type. Delegating to that name runs the built-in one.

 

## Copilot CLI subagents vs Claude Code subagents

 

The file shape is close. Both use Markdown with YAML frontmatter, and both pick a subagent by `description`. The defaults differ. Copilot CLI requires only `description`, caps concurrency by plan and keeps repository instructions away from custom subagents unless the file opts in.

 

|  | Copilot CLI 1.0.106 | Claude Code |
| --- | --- | --- |
| Agent file | Markdown, `*.agent.md` or `*.md` | Markdown with YAML |
| Folders | `~/.copilot/agents/`, `.github/agents/`, `.claude/agents/` | `~/.claude/agents/`, `.claude/agents/` |
| Required fields | `description` | `name`, `description` |
| Manual call | `/agent`, `--agent`, name in the prompt | `@agent-<name>`, `claude --agent <name>` |
| Model fallback | The outer agent's model | Env variable, then the main model |
| Concurrent | By plan, 2 to 32 | 20 by default |
| Depth | 6 by default | 3 layers |
| Repo instructions | Off for custom subagents unless opted in | CLAUDE.md loads, except for Explore and Plan |

 

## Frequently asked questions

 

### Can Copilot CLI use my Claude Code agent files?

 

Partly. Copilot CLI loads `.claude/agents/` in the repository, after `.github/agents/`. It stopped loading custom agents from `~/.claude/` in 1.0.36.

 

### Can I turn off a built-in subagent?

 

Yes. The `/subagents` picker has an On/Off control per agent. It writes the names to `subagents.disabledSubagents`.

 

### Did you test this?

 

No. Copilot CLI is not installed on my machine. This post reads the GitHub Copilot docs and the CLI changelog up to 1.0.106 on 6 November 2026. The Claude Code column comes from my earlier post and the Claude Code docs.

 

## The verdict

 

Copilot CLI subagents look familiar from Claude Code. Put `include-custom-instructions: true` in any agent that edits code. Run it once with `-p --agent` and read stderr. On "custom agent not found", update to 1.0.106 before you debug the file, since that release fixed one cause per the changelog. I have not run any of this.

 

Sources, read on 6 November 2026: the GitHub Copilot [command reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference), [custom agents for Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/create-custom-agents-for-cli), [custom agents](https://docs.github.com/en/copilot/concepts/customizations/custom-agents), [custom agents configuration](https://docs.github.com/en/copilot/reference/custom-agents-configuration) and [/fleet](https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli/speed-up-task-completion) pages, and the [github/copilot-cli](https://github.com/github/copilot-cli) changelog. Claude Code: [Create custom subagents](https://code.claude.com/docs/en/sub-agents).

Put this into practice

[See the tool list](https://getagenttools.com/tools/)[Train your team](https://getagenttools.com/#training)
