Answer: You can use custom agents in three ways: by using the /agent slash command in the CLI's interactive interface to select from available custom agents, by calling out to the custom agent directly in a prompt, or by specifying the agent with the command-line option (for example, copilot --agent=refactor-agent --prompt "Refactor this code block"). Status: Confirmed Entry: tool/github-copilot/agents-and-automation/use-custom-agents-cli Revision: 3 Digest: sha256:c0f1aecb87e99d96 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:24:44Z Last changed: 2026-11-19T12:57:09Z (repository-level location: — → .github/agents) Last verified: 2026-11-20T13:03:22Z Next check: 2026-11-21T13:03:22Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of slash command | /agent | [1] | 2026-11-20 prompt example | Use the refactoring agent to refactor this code block | [1] | 2026-11-20 command-line option example | copilot --agent=refactor-agent --prompt "Refactor this code block" | [1] | 2026-11-20 user-level location | ~/.copilot/agents | [1] | 2026-11-20 repository-level location | .github/agents | [1] | 2026-11-20 Sources: [1] GitHub. "Invoking custom agents - GitHub Docs". https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli/invoke-custom-agents Role: primary. Accessed: 2026-11-20T13:03:22Z Quote: "Using the slash command in the CLI's interactive interface to select from the list of available custom agents: /agent" (Supports: slash command) Quote: "Calling out to the custom agent directly in a prompt: Use the refactoring agent to refactor this code block" (Supports: prompt example) Quote: "copilot --agent=refactor-agent --prompt "Refactor this code block"" (Supports: command-line option example) Quote: "User-level custom agent local ~/.copilot/agents directory" (Supports: user-level location) Quote: "Repository-level custom agent .github/agents directory in your local and remote repositories" (Supports: repository-level location) Snapshot SHA-256: 49e88da3763f92344d7dc1e8c2325fcfa6b32aa15a01cfaef6df592f30bf4a07 (captured 2026-11-18T12:57: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]. On this check the text of [1] was unchanged since 2026-11-18T12:57:44Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:03:22Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:03:22Z Last attempt: 2026-11-20T13:03:22Z Notes and limitations: Extracted automatically from a single official source (section "Use custom agents"). Related: https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-in-ide How do I create and use custom agents in GitHub Copilot in my IDE? https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-in-ide-2 How do I use custom agents in GitHub Copilot in my IDE? https://latestn.com/tool/github-copilot/agents-and-automation/use-hooks-with-copilot-sdk How do I use hooks with the GitHub Copilot SDK? https://latestn.com/tool/github-copilot/agents-and-automation/use-copilot-chat-agent-mode How do I use GitHub Copilot Chat in agent mode for a task? https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agent-cli How do I use a custom agent in GitHub Copilot CLI? https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents How do I use custom agents with GitHub Copilot cloud agent? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T12:57:09Z | changed | repository-level location: — → .github/agents | [1] 2026-11-19T12:57:09Z | changed | user-level location: — → ~/.copilot/agents | [1] 2026-11-19T12:57:09Z | changed | command-line option example: — → copilot --agent=refactor-agent --prompt "Refactor this code block" | [1] 2026-11-19T12:57:09Z | changed | prompt example: — → Use the refactoring agent to refactor this code block | [1] 2026-11-19T12:57:09Z | changed | slash command: — → /agent | [1] 2026-11-19T12:57:09Z | changed | Repository-level custom agent location: .github/agents → — | [1] 2026-11-19T12:57:09Z | changed | User-level custom agent location: ~/.copilot/agents → — | [1] 2026-11-19T12:57:09Z | changed | Command-line option example: copilot --agent=refactor-agent --prompt "Refactor this code block" → — | [1] 2026-11-19T12:57:09Z | changed | Prompt method: Use the refactoring agent to refactor this code block → — | [1] 2026-11-19T12:57:09Z | changed | Slash command method: /agent → — | [1] 2026-11-17T13:19:49Z | changed | Repository-level custom agent location: — → .github/agents | [1] 2026-11-17T13:19:49Z | changed | User-level custom agent location: — → ~/.copilot/agents | [1] 2026-11-17T13:19:49Z | changed | Command-line option example: — → copilot --agent=refactor-agent --prompt "Refactor this code block" | [1] 2026-11-17T13:19:49Z | changed | Prompt method: — → Use the refactoring agent to refactor this code block | [1] 2026-11-17T13:19:49Z | changed | Slash command method: — → /agent | [1] 2026-11-17T13:19:49Z | changed | repository-level location: .github/agents → — | [1] 2026-11-17T13:19:49Z | changed | user-level location: ~/.copilot/agents → — | [1] 2026-11-17T13:19:49Z | changed | command-line option example: copilot --agent=refactor-agent --prompt "Refactor this code block" → — | [1] 2026-11-17T13:19:49Z | changed | prompt method: Use the refactoring agent to refactor this code block → — | [1] 2026-11-17T13:19:49Z | changed | slash command method: /agent → — | [1] 2026-11-13T03:24:44Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-cli/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/github-copilot/agents-and-automation/use-custom-agents-cli POST: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/use-custom-agents-cli with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/github-copilot/agents-and-automation/use-custom-agents-cli?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I use custom agents in GitHub Copilot CLI? Revision 3, last verified 2026-11-20T13:03:22Z. https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-cli (accessed 2026-11-21T09:59:42Z). @misc{LatestN_tool_github_copilot_agents_and_automation_use_custom_agents_cli_r3, title = {How do I use custom agents in GitHub Copilot CLI?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/github-copilot/agents-and-automation/use-custom-agents-cli}}, note = {Revision 3; digest sha256:c0f1aecb87e99d96; last verified 2026-11-20T13:03:22Z; accessed 2026-11-21T09:59:42Z} } 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/github-copilot/agents-and-automation/use-custom-agents-cli