Describe the bug
The three repository-scoped customization sources are discovered using two
different base directories:
| Source |
Discovered at |
Base directory |
| Custom agents |
<git-root>/.github/agents/ |
git root |
| Skills |
<cwd>/.github/skills/ |
cwd |
| MCP servers |
<cwd>/.mcp.json |
cwd |
Because agents are bound to the git root while skills and MCP are bound to the
current working directory, it is impossible to keep all three together in a
subdirectory of a repository. In a monorepo (or any repo where you want to keep
Copilot config in a subfolder, e.g. agent/), you must either:
- put
.github/agents/ at the git root (so the agent loads) — but then skills
and .mcp.json must ALSO be at the git root, forcing you to run from the git
root and scattering config across the tree; or
- copy the agent into the user-level
~/.copilot/agents/ directory, which is
machine-global and not committed to the repo.
There is no cwd from which a subdirectory-local agent + skills + MCP all load
together.
Affected version
GitHub Copilot CLI 1.0.60-0 (Windows)
Steps to reproduce the behavior
- In a git repo, create a subdirectory
sub/ and place all three there:
sub/.github/agents/myagent.agent.md
sub/.github/skills/myskill/SKILL.md
sub/.mcp.json
cd sub and run copilot --agent myagent -p "...".
- Skills and MCP from
sub/ do load (cwd-relative).
- The agent does not load:
No such agent: myagent, available: (empty).
- Run the same command from the git root — the agent still does not load,
because <git-root>/.github/agents/ does not exist.
- Move
.github/ and .mcp.json up to the git root and run from the git root —
now all three load. This is the only working layout, and it forces config to
the git root.
A sharper probe: with an agent at <git-root>/.github/agents/A.agent.md AND a
different agent at <git-root>/sub/.github/agents/B.agent.md, running from
cwd=<git-root>/sub lists only A (the git-root one), never B. This shows the
loader goes straight to the git root rather than searching upward from cwd the
way skills do.
Expected behavior
Custom agents should be discoverable using the same base directory as skills and
MCP (cwd, ideally searching upward toward the git root), OR there should be a
configurable agentDirectories setting analogous to skillDirectories, so that
agents + skills + MCP can be co-located in a subdirectory and loaded together.
Additional context
Describe the bug
The three repository-scoped customization sources are discovered using two
different base directories:
<git-root>/.github/agents/<cwd>/.github/skills/<cwd>/.mcp.jsonBecause agents are bound to the git root while skills and MCP are bound to the
current working directory, it is impossible to keep all three together in a
subdirectory of a repository. In a monorepo (or any repo where you want to keep
Copilot config in a subfolder, e.g.
agent/), you must either:.github/agents/at the git root (so the agent loads) — but then skillsand
.mcp.jsonmust ALSO be at the git root, forcing you to run from the gitroot and scattering config across the tree; or
~/.copilot/agents/directory, which ismachine-global and not committed to the repo.
There is no cwd from which a subdirectory-local agent + skills + MCP all load
together.
Affected version
GitHub Copilot CLI 1.0.60-0 (Windows)
Steps to reproduce the behavior
sub/and place all three there:sub/.github/agents/myagent.agent.mdsub/.github/skills/myskill/SKILL.mdsub/.mcp.jsoncd suband runcopilot --agent myagent -p "...".sub/do load (cwd-relative).No such agent: myagent, available:(empty).because
<git-root>/.github/agents/does not exist..github/and.mcp.jsonup to the git root and run from the git root —now all three load. This is the only working layout, and it forces config to
the git root.
A sharper probe: with an agent at
<git-root>/.github/agents/A.agent.mdAND adifferent agent at
<git-root>/sub/.github/agents/B.agent.md, running fromcwd=<git-root>/sublists onlyA(the git-root one), neverB. This shows theloader goes straight to the git root rather than searching upward from cwd the
way skills do.
Expected behavior
Custom agents should be discoverable using the same base directory as skills and
MCP (cwd, ideally searching upward toward the git root), OR there should be a
configurable
agentDirectoriessetting analogous toskillDirectories, so thatagents + skills + MCP can be co-located in a subdirectory and loaded together.
Additional context
skillDirectories, agents do not) and Organization-level custom agents not visible in Copilot CLI when no GitHub-hosted repository is in the working directory #3572 (agent discovery tied to theworking directory's git remote). This report is specifically about the
git-root vs cwd base-directory inconsistency between agents and
skills/MCP, which neither of those covers directly.
agent/subfolder, which is what surfaced this.