NEW: Claude Code Security — research preview

Customization

Custom instructions, agents, prompt files, MCP servers, and hooks

Read time: 5 min

title: "Customization" description: "Custom instructions, agents, prompt files, MCP servers, and hooks" section: "Copilot" readTime: "5 min"

Customize AI in VS Code

Teach the AI about your codebase, coding standards, and workflows so it generates code that fits from the start.

Open the Chat Customizations Editor

Select the Configure Chat (gear icon) in the Chat view, or run Chat: Open Chat Customizations from the Command Palette (Ctrl+Shift+P).

Five Customization Scenarios

1. Define Coding Standards

Use custom instructions (copilot-instructions.md or *.instructions.md) to share project-wide rules. Always-on instructions apply to every request; file-based instructions target specific file types or folders.

2. Automate Repetitive Tasks

Create prompt files (.prompt.md) for tasks you run often — scaffolding a component, preparing a PR, running a code review. Use agent skills (.skill.md) for multi-step workflows involving scripts and external tools.

3. Specialize the AI

Create custom agents (.agent.md) that adopt specific personas — security reviewer, database admin, planner. Each defines behavior, available tools, and model preferences.

4. Connect External Tools

Add MCP servers via mcp.json to give the AI access to databases, APIs, and services. Use hooks to run shell commands at lifecycle events (e.g., run formatter after every file edit, enforce security policies).

5. Install Plugins

Install agent plugins (Preview) to add pre-packaged bundles: slash commands, skills, custom agents, hooks, and MCP servers in one install.

Getting Started (Incremental)

  1. /init in chat → generates copilot-instructions.md tailored to your codebase
  2. Add *.instructions.md files for language/framework-specific rules (with applyTo patterns)
  3. Create prompt files for common workflows; add MCP servers for external services
  4. Build custom agents for specialized roles
  5. Use /create-prompt, /create-instruction, /create-skill, /create-agent, /create-hook in chat to generate files with AI assistance

Monorepo Support

Enable chat.useCustomizationsInParentRepositories to discover customization files from parent repositories when you open a subfolder. VS Code walks up the tree to the .git root and collects all instruction files, prompt files, and agents.

Troubleshooting

If customizations are not applied: Chat view ... menu → Show Agent Debug Logs to inspect which files were discovered and loaded.