Start free
Guide Teach your agent your knowledge

How to teach VS Code your knowledge

Updated 2 min read

The short answer

Teach VS Code reusable project knowledge by storing guidance in Markdown instruction files and attaching reference material to a request when needed. Choose the instruction file offered for your selected agent harness, then test the guidance in a new chat.

On this page8 sections
  1. Choose what VS Code should reuse
  2. Create the right project instruction file
  3. Keep instructions concise and project-specific
  4. Scope rules to relevant files
  5. Attach reference material when needed
  6. Share project instructions through source control
  7. Know your instruction limits
  8. Questions people ask

Choose what VS Code should reuse

VS Code custom instructions give an agent reusable guidance about a project, such as where to add code, which libraries to use, and which tests to run. Store this guidance in Markdown files instead of repeating it in every prompt. See VS Code custom instructions.

Create the right project instruction file

Open the Agent Customizations editor, select + next to Workspace, and choose the project instruction file offered for your harness. The selected harness determines which instruction files VS Code reads. VS Code documents .github/copilot-instructions.md or AGENTS.md for Copilot, AGENTS.md for OpenAI Codex, and CLAUDE.md for Anthropic Claude. See VS Code custom instructions.

Keep instructions concise and project-specific

Write a short statement for each requirement and explain non-obvious constraints. Do not duplicate formatter or linter rules. For one-time guidance, put it in the prompt instead of creating a shared rule. Instructions guide the model, but they do not guarantee compliance or replace tests, code review, or security controls. See VS Code custom instructions.

Scope rules to relevant files

Targeted .instructions.md files can use applyTo patterns, while Claude rules files can use paths patterns. Codex uses directory locations instead. Codex loads nested instructions along the path from the repository root to the session working directory. See VS Code custom instructions.

Attach reference material when needed

Use Add Context in the chat input to attach an existing instruction file to one request. A Markdown link to supporting documentation does not guarantee that the document contents reach the model, so attach the relevant file when the agent needs it. See VS Code custom instructions.

Share project instructions through source control

VS Code says project instructions can be shared through source control. If a repository already has a project instruction file, open it instead of creating a competing copy. See VS Code custom instructions.

Know your instruction limits

Custom instructions do not apply to inline suggestions as you type. An instruction file such as AGENTS.md gives guidance to an existing agent, but does not define a custom agent. See VS Code custom instructions.

Questions people ask

Where should I put VS Code project instructions?

Use the project instruction file offered for your selected harness. VS Code documents .github/copilot-instructions.md or AGENTS.md for Copilot, AGENTS.md for Codex, and CLAUDE.md for Claude. See VS Code custom instructions.

Can VS Code read my KnowMan articles?

The available documentation does not show how to connect KnowMan to VS Code or how VS Code agents can read saved KnowMan articles. KnowMan does document local MCP configurations for Claude Desktop, Claude Code, and Cursor in its MCP server guide.

Do I need to repeat project instructions in every prompt?

No. Store reusable guidance in Markdown instruction files instead of repeating it in every prompt. For one-time requirements, put the guidance in the prompt. See VS Code custom instructions.

How do I check that my instructions work?

Start a new chat using the same harness and repository, without repeating the rules in the prompt. This avoids relying on guidance left in the earlier conversation. See VS Code custom instructions.

Save knowledge for your AI workflow

Try KnowMan Pro for 14 days with no credit card. Create your account

Start free

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