# How to teach GitHub Copilot CLI your knowledge

Teach GitHub Copilot CLI [your knowledge](https://www.knowman.io/guides/personal-knowledge-base) with custom instruction files, referenced project files, prompt files, or specialized agents. For [saved articles](https://www.knowman.io/guides/how-to-save-articles) and questions about your reading, connect KnowMan through its hosted MCP server or local [stdio server](https://www.knowman.io/guides/what-is-an-mcp-server), then name KnowMan in the prompt when you want it to search.

## Choose the right way to share knowledge

Use [custom instructions](https://www.knowman.io/guides/give-your-ai-context) for standing guidance, prompt files for task-specific context that you choose in chat, and specialized agents for defined roles. Copilot CLI also supports [MCP servers](https://www.knowman.io/guides/mcp-server-knowledge-base), and naming a relevant server in a prompt can help it deliver the requested result. See [GitHub's Copilot CLI overview](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli) and [response customization guide](https://docs.github.com/en/copilot/concepts/prompting/response-customization).

## Add user-level instructions

Put broad instructions in `$HOME/.copilot/copilot-instructions.md` to apply them across repositories. For modular guidance, use `*.instructions.md` files under `$HOME/.copilot/instructions/`. You can also set `COPILOT_HOME` to change the base directory used for both user-level locations. See [GitHub's custom instructions documentation](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions).

## Add repository and path-specific instructions

Use `.github/copilot-instructions.md` for repository-wide guidance. A `*.instructions.md` file with an `applyTo` value applies only when its pattern matches the file Copilot CLI is working with. Copilot CLI combines applicable user-level and repository instructions, but the documentation defines no general precedence order between them. See GitHub's custom instructions documentation.

## Reference project files and agent instructions

In `.github/copilot-instructions.md`, `AGENTS.md`, or `CLAUDE.md`, use `@` followed by a relative path to include another file. Referenced files may point to further files, but references must remain inside the repository or local custom instructions directory. Copilot CLI also recognizes `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `.claude/CLAUDE.md`. See GitHub's custom instructions documentation.

## Use prompt files and specialized agents

Prompt files provide task-specific instructions and context that you choose when using them in chat. Specialized agent definitions live under `.github/agents` and are separate from agent instruction files. Keep standing custom instructions short and self-contained, since Copilot may not follow them identically on every use. See GitHub's response customization guide.

## Connect KnowMan as an MCP server

KnowMan can run as a hosted Streamable HTTP MCP server at `https://api.knowman.io/mcp`. Sign in with OAuth or send a key as `Authorization: Bearer <key>`. It can also run locally through `npx -y @knowman/mcp` over stdio, using Node 22 or newer. See the [KnowMan MCP repository](https://github.com/Essatt/knowman-mcp).

## Search and ask your saved reading

KnowMan MCP exposes `kb_search` and `kb_ask` for searching [saved reading](https://www.knowman.io/guides/ai-article-saver) and asking questions about it. In a Copilot CLI prompt, name KnowMan and describe the source or task, such as asking it to search your KnowMan for saved material on a topic. The KnowMan MCP repository lists the available tools.

## Where KnowMan fits

Copilot instruction files are best for guidance and context that should stay with a user, repository, or file. KnowMan fits when the knowledge lives in saved articles and links and you want Copilot CLI to search that library or [ask questions](https://www.knowman.io/guides/ai-knowledge-base) with citations. Learn more in [Connect any AI to your notes](https://www.knowman.io/guides/connect-any-ai-to-your-notes) and [MCP server knowledge bases](https://www.knowman.io/guides/mcp-server-knowledge-base).

## Questions

### What is the simplest way to teach GitHub Copilot CLI project knowledge?

Add standing guidance to `.github/copilot-instructions.md`, or use `*.instructions.md` with `applyTo` when the guidance should match specific files. See GitHub's custom instructions documentation.

### Can Copilot CLI include local files in its instructions?

Use `@` followed by a relative path in `.github/copilot-instructions.md`, `AGENTS.md`, or `CLAUDE.md`. References must stay within the repository or local custom instructions directory. See GitHub's custom instructions documentation.

### How can Copilot CLI use my saved reading?

Add KnowMan as an MCP server, then name KnowMan in the prompt when you want it to search saved items or answer a question about them. The KnowMan MCP repository documents `kb_search` and `kb_ask`.

### Do instruction changes apply immediately?

No. See GitHub's custom instructions documentation.

## Related guides

- [Connect your knowledge base through KnowMan's MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base)

- [How Do You Connect AI to Your Notes?](https://www.knowman.io/guides/connect-any-ai-to-your-notes)

- [How to Give Your AI Context from What You Read](https://www.knowman.io/guides/give-your-ai-context)

- [What Is a Knowledge Base for AI Agents?](https://www.knowman.io/guides/knowledge-base-for-ai-agents)

- [What is a personal knowledge base, and how do you build one?](https://www.knowman.io/guides/personal-knowledge-base)

## More in this topic

- [How to teach GitHub Copilot your knowledge](https://www.knowman.io/guides/teach-github-copilot-your-knowledge)
- [How to teach LibreChat your knowledge](https://www.knowman.io/guides/teach-librechat-your-knowledge)
- [How to teach Jan your knowledge](https://www.knowman.io/guides/teach-jan-your-knowledge)

## More for GitHub Copilot CLI

- [KnowMan MCP server for GitHub Copilot CLI](https://www.knowman.io/integrations/github-copilot-cli)
- [How to give GitHub Copilot CLI better memory](https://www.knowman.io/guides/github-copilot-cli-memory)

## Let Copilot CLI search your reading

Try KnowMan Pro for 14 days with no credit card. [Create your account](https://app.knowman.io/signup)

[Start free](https://app.knowman.io/signup)

Every new account starts with 14 days of Pro. No credit card.

Source: https://www.knowman.io/guides/teach-github-copilot-cli-your-knowledge
