Copilot Configuration Basics
Learn how to configure GitHub Copilot at user, workspace, and repository levels to optimize your AI-assisted development experience.
Front matter
title: 'Copilot Configuration Basics'
description: 'Learn how to configure GitHub Copilot at user, workspace, and repository levels to optimize your AI-assisted development experience.'
authors:
- GitHub Copilot Learning Hub Team
lastUpdated: 2026-09-22
estimatedReadingTime: '10 minutes'
tags:
- configuration
- setup
- fundamentals
relatedArticles:
- ./what-are-agents-skills-instructions.md
- ./understanding-copilot-context.md
prerequisites:
- Basic familiarity with GitHub CopilotGitHub Copilot offers extensive configuration options that let you tailor its behavior to your personal preferences, project requirements, and team standards. Understanding these configuration layers helps you maximize productivity while maintaining consistency across teams. This article explains the configuration hierarchy, key settings, and how to set up repository-level customizations that benefit your entire team.
Configuration Levels
GitHub Copilot uses a hierarchical configuration system where settings at different levels can override each other. Understanding this hierarchy helps you apply the right configuration at the right level.
User Settings
User settings apply globally across all your projects and represent your personal preferences. These are stored in your IDE's user configuration and travel with your IDE profile.
Common user-level settings:
- Enable/disable inline suggestions globally
- Commit message style preferences
- Default language preferences
When to use: For personal preferences that should apply everywhere you work, like keyboard shortcuts or whether you prefer inline suggestions vs chat.
Repository Settings
Repository settings live in your codebase (typically in .github/ although some editors allow customising the paths that Copilot will use) and are shared with everyone working on the project. These provide the highest level of customization and override both user and workspace settings.
Common repository-level customizations:
- Custom instructions for coding conventions
- Reusable skills for common tasks
- Specialized agents for project workflows
- Custom agents for domain expertise
When to use: For repository-wide standards, project-specific best practices, and reusable customizations that should be version-controlled and shared.
Organisation Settings (GitHub.com only)
Organisation settings allow administrators to enforce Copilot policies across all repositories within an organization. These settings can include defining custom agents, creating globally applied instructions, enabling or disabling Copilot, managing billing, and setting usage limits. These policies may not be enforced in the IDE, depending on the IDE's support for organization-level settings, but will apply to Copilot usage on GitHub.com.
When to use: For enforcing organization-wide policies, ensuring compliance, and providing shared resources across multiple repositories.
Configuration Precedence
When multiple configuration levels define the same setting, GitHub Copilot applies them in this order (highest precedence first):
- Organisation settings (if applicable)
- Repository settings (
.github/) - User settings (IDE global preferences)
Example: If your user settings disable Copilot for .test.ts files, but repository settings enable custom instructions for test files, the repository settings take precedence and Copilot remains active with the custom instructions applied.
Key Configuration Options
These settings control GitHub Copilot's core behavior across all IDEs:
Inline Suggestions
Control whether Copilot automatically suggests code completions as you type.
VS Code example:
{
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": false
}
}Why it matters: Some developers prefer to invoke Copilot explicitly rather than seeing automatic suggestions. You can also enable it only for specific languages.
Chat Availability
Control access to GitHub Copilot Chat in your IDE.
VS Code example:
{
"github.copilot.chat.enabled": true
}Why it matters: Chat provides a conversational interface for asking questions and getting explanations, complementing inline suggestions.
Suggestion Trigger Behavior
Configure how and when Copilot generates suggestions.
VS Code example:
{
"editor.inlineSuggest.enabled": true,
"github.copilot.editor.enableAutoCompletions": true
}Why it matters: Control whether suggestions appear automatically or only when explicitly requested, balancing helpfulness with potential distraction.
Language-Specific Settings
Enable or disable Copilot for specific programming languages.
VS Code example:
{
"github.copilot.enable": {
"typescript": true,
"javascript": true,
"python": true,
"markdown": false
}
}Why it matters: You may want Copilot active for code files but not for documentation or configuration files.
Excluded Files and Directories
Prevent Copilot from accessing specific files or directories.
VS Code example:
{
"github.copilot.advanced": {
"debug.filterLogCategories": [],
"excludedFiles": [
"**/secrets/**",
"**/*.env",
"**/node_modules/**"
]
}
}Why it matters: Exclude sensitive files, generated code, or dependencies from Copilot's context to improve suggestion relevance and protect confidential information.
Repository-Level Configuration
The .github/ directory in your repository enables team-wide customizations that are version-controlled and shared across all contributors.
Directory Structure
A well-organized Copilot configuration directory looks like this:
.github/
├── agents/
│ ├── terraform-expert.agent.md
│ └── api-reviewer.agent.md
├── skills/
│ ├── generate-tests/
│ │ └── SKILL.md
│ └── refactor-component/
│ └── SKILL.md
└── instructions/
├── typescript-conventions.instructions.md
└── api-design.instructions.mdMonorepo Support
In monorepos with multiple packages or services, GitHub Copilot CLI discovers customizations at every directory level from your working directory up to the git repository root. This means each package or service can have its own .github/ folder with specialized agents, instructions, skills, and MCP servers, while still inheriting configuration from parent directories.
my-monorepo/
├── .github/
│ └── instructions/
│ └── shared-conventions.instructions.md ← applies everywhere
├── packages/
│ ├── api/
│ │ └── .github/
│ │ └── agents/
│ │ └── api-expert.agent.md ← applies in packages/api/
│ └── web/
│ └── .github/
│ └── instructions/
│ └── react-conventions.instructions.md ← applies in packages/web/When you work inside packages/api/, Copilot loads configuration from packages/api/.github/, then packages/.github/ (if it exists), then the root .github/. This layered discovery ensures the right context is active no matter where in the repository you're working.
Personal Skills Directory
In addition to repository-level skills, GitHub Copilot CLI supports personal skills directories at ~/.copilot/skills/ and ~/.agents/skills/. Skills you place in either location are discovered automatically across all your projects, making them ideal for personal workflows and reusable utilities that are not project-specific.
~/.agents/
└── skills/
├── my-review-style/
│ └── SKILL.md ← available in all sessions
└── cleanup-todos/
└── SKILL.mdThe ~/.agents/skills/ path aligns with the VS Code GitHub Copilot for Azure extension's default skill discovery path, while ~/.copilot/skills/ matches the Copilot CLI configuration directory. Both are supported for personal skills.
Pinning Model and Effort via .github/copilot/settings.json
A trusted repository can pin the model, reasoning effort level, and context tier for all sessions working in that repository by adding a .github/copilot/settings.json file. This is a team governance feature that ensures everyone uses a consistent model configuration without relying on individual user settings:
{
"model": "claude-sonnet-4",
"effortLevel": "high",
"contextTier": "full"
}Supported fields:
| Field | Description | Example values |
|---|---|---|
model | The AI model to use for this repository | "claude-sonnet-4", "gpt-4.1", "claude-sonnet-5" |
effortLevel | Reasoning effort level | "low", "medium", "high" |
contextTier | How much context to include | "default", "full" |
In addition to model and effort settings, this file can also extend the URL, MCP server, and skill deny lists, allowing organizations to enforce access restrictions at the repository level.
Why use this: Pin a model when your team has agreed on the right cost/quality tradeoff for a project. Pin a high effort level for codebases where mistakes are expensive. Deny lists let you block specific MCP servers or URLs that aren't appropriate for a given project's security posture.
Trust requirement: The repository must be explicitly trusted by the user for these settings to take effect. This prevents untrusted repositories from changing your model or access restrictions without your knowledge.
Custom Agents
Agents are specialized assistants for specific workflows. Place agent definition files in .github/agents/.
Example agent (terraform-expert.agent.md):
---
description: 'Terraform infrastructure-as-code specialist'
tools: ['filesystem', 'terminal']
name: 'Terraform Expert'
---
You are an expert in Terraform and cloud infrastructure.
Guide users through creating, reviewing, and deploying infrastructure code.When to use: Create agents for domain-specific tasks like infrastructure management, API design, or security reviews.
Reusable Skills
Skills are self-contained folders that package reusable capabilities. Store them in .github/skills/.
Example skill (generate-tests/SKILL.md):
---
name: generate-tests
description: 'Generate comprehensive unit tests for a component, covering happy path, edge cases, and error conditions'
---
# generate-tests
Generate unit tests for the selected code that:
- Cover all public methods and edge cases
- Use our testing conventions from @testing-utils.ts
- Include descriptive test names
See [references/test-patterns.md](references/test-patterns.md) for standard patterns.Skills can also bundle reference files, templates, and scripts in their folder, giving the AI richer context than a single file can provide. Unlike the older prompt format, skills can be discovered and invoked by agents automatically.
Dynamic skill retrieval: By default, Copilot CLI uses embeddings-based retrieval to automatically surface the most relevant skills for each prompt. You can toggle this behavior with the --dynamic-retrieval flag or the dynamicRetrieval config setting. To disable embeddings-based retrieval (for example, to force all configured skills to always be loaded):
copilot --dynamic-retrieval skills=offThis setting persists across sessions once saved to your config.
When to use: For repetitive tasks your team performs regularly, like generating tests, creating documentation, or refactoring patterns.
Instructions Files
Instructions provide persistent context that applies automatically when working in specific files or directories. Store them in .github/instructions/.
Example instruction (typescript-conventions.instructions.md):
---
description: 'TypeScript coding conventions for this project'
applyTo: '**.ts, **.tsx'
---
When writing TypeScript code:
- Use strict type checking
- Prefer interfaces over type aliases for object types
- Always handle null/undefined with optional chaining
- Use async/await instead of raw promisesWhen to use: For project-wide coding standards, architectural patterns, or technology-specific conventions that should influence all suggestions.
Setting Up Team Configuration
Follow these steps to establish effective team-wide Copilot configuration:
1. Create the Configuration Structure
Start by creating the .github/ directory in your repository root:
mkdir -p .github/{agents,skills,instructions}2. Document Your Conventions
Create instructions that capture your team's coding standards:
<!-- .github/instructions/team-conventions.instructions.md -->
---
description: 'Team coding conventions and best practices'
applyTo: '**'
---
Our team follows these practices:
- Write self-documenting code with clear names
- Add comments only for complex logic
- Prefer composition over inheritance
- Keep functions small and focused3. Build Reusable Skills
Identify repetitive tasks and create skills for them:
<!-- .github/skills/add-error-handling/SKILL.md -->
---
name: add-error-handling
description: 'Add comprehensive error handling to existing code following team patterns'
---
# add-error-handling
Add error handling to the selected code:
- Catch and handle potential errors
- Log errors with context
- Provide meaningful error messages
- Follow our error handling patterns from @error-utils.ts4. Version Control Best Practices
- Commit all
.github/files to your repository - Use descriptive commit messages when adding or updating customizations
- Review changes to ensure they align with team standards
- Document each customization with clear descriptions and examples
5. Onboard New Team Members
Make Copilot configuration part of your onboarding process:
- Point new members to your
.github/directory - Explain which agents and skills exist and when to use them
- Encourage exploration and contributions
- Include example usage in your project README
IDE-Specific Configuration
While repository-level customizations work across all IDEs, you may also need IDE-specific settings:
VS Code
Settings file: .vscode/settings.json or global user settings
{
"github.copilot.enable": {
"*": true
},
"github.copilot.chat.enabled": true,
"editor.inlineSuggest.enabled": true
}Visual Studio
Settings: Tools → Options → GitHub Copilot
- Configure inline suggestions
- Set keyboard shortcuts
- Manage language-specific enablement
JetBrains IDEs
Settings: File → Settings → Tools → GitHub Copilot
- Enable/disable for specific file types
- Configure suggestion behavior
- Customize keyboard shortcuts
GitHub Copilot CLI
Configuration file: ~/.copilot-cli/config.json
{
"editor": "vim",
"suggestions": true
}CLI settings use camelCase naming. Key settings added in recent releases:
| Setting | Description |
|---|---|
includeCoAuthoredBy | Include Co-authored-by trailer in commits |
effortLevel | Default reasoning effort level (low, medium, high) |
autoUpdatesChannel | Update channel (stable, preview) |
statusLine | Show status line in the terminal UI |
include_gitignored | Include gitignored files in @ file search |
extension_mode | Control extensibility (agent tools and plugins) |
continueOnAutoMode | Automatically switch to the auto model on rate limit instead of pausing |
proxy | HTTP(S) proxy URL for all outbound CLI requests (e.g., http://proxy.example.com:8080) |
sessionLimits | Restrict credit or turn usage for a session; limits apply across the current conversation and reset on /clear |
stayInAutopilot | Keep the CLI in autopilot mode after an autopilot task completes, instead of returning to interactive mode |
defaultMode | Startup mode for new interactive sessions (e.g., interactive, autopilot, plan) |
defaultPermissionMode | Default approval behaviour for new interactive sessions, independent from defaultMode |
Note: Older snake_case names (e.g.,include_gitignored,auto_updates_channel) are still accepted for backward compatibility, but camelCase is now the preferred format.
If the CLI is interrupted unexpectedly — a crash or a machine restart — startup offers to restore any sessions that were still open, so you don't have to reopen each terminal by hand.
Use copilot login --with-token to read an authentication token from stdin instead of going through the interactive browser or device-code flow — useful for scripted or containerized setups where a token is already available in the environment.
In addition to the main config file, GitHub Copilot CLI reads two optional per-project files for repository-specific overrides:
.claude/settings.json— committed project settings.claude/settings.local.json— local overrides (add to.gitignorefor personal adjustments)
These files follow the same format as config.json and are loaded after the global config, so they can tailor CLI behaviour—including hook definitions—per repository without touching .github/.
Note: Custom agents, skills, and commands placed in~/.claude/(the Claude Code user directory) are not loaded by GitHub Copilot CLI. Only~/.claude/settings.jsonis read for configuration. Store personal agents and skills in the supported locations instead:~/.copilot/agents/for user-level agents,~/.copilot/skills/or~/.agents/skills/for personal skills, or.github/agents/and.github/skills/in your repositories for project-level customizations. See [Compatibility and Migration Notes](#compatibility-and-migration-notes) if you previously relied on~/.claude/being loaded.
Model Picker
The model picker opens in a full-screen view with inline reasoning effort adjustment. Use the ← / → arrow keys to change the reasoning effort level (low, medium, high) directly from the picker without leaving the session. The current reasoning effort level is also displayed in the model header (e.g., claude-sonnet-4.6 (high)) so you always know which level is active. Models are grouped into Recent, Recommended, New, and other sections instead of a single flat list, making it faster to find the model you want — press Shift+Tab to switch between grouping views.
/model changes the model for the current session only by default. Use /config model to set the default model for future sessions.
Auto mode and server-side model routing: When you select Auto as your model, the CLI uses server-side model routing for real-time model selection. Instead of locking in a single model at session start, Auto mode evaluates each request and routes it to the most appropriate model dynamically. This means straightforward questions can be handled by a faster model while complex reasoning tasks are automatically escalated — without you needing to switch models manually.
Model family aliases: Instead of typing a full model name, you can use short family aliases in the model setting: opus, sonnet, haiku (Anthropic), and gpt, gemini (Google/OpenAI). The CLI resolves the alias to the latest available model in that family. This is especially useful in scripts or configuration files where you want to track the best model in a family without hardcoding a version string. Current models include Claude Opus 5 and Claude Fable 5.1 (Anthropic), Grok 4.5 and Grok 4.6 (xAI, with xhigh reasoning effort support), Gemini 3.7 Flash (Google), and GPT-6 Astra (OpenAI). The model picker also periodically retires older models no longer worth recommending, so don't be surprised if a model you previously pinned disappears from the list — check [Compatibility and Migration Notes](#compatibility-and-migration-notes) if that happens.
Model fallback lists: Custom agents can set model to a list of several models instead of a single name. Copilot tries each one in order until it finds one available to your account — useful when your preferred model is temporarily rate-limited or not enrolled. Pair this with model-policy: required to keep the agent restricted to that list even if you try to switch models mid-session. See [Building Custom Agents](../building-custom-agents/) for the frontmatter syntax.
Plan mode model: When using plan mode (which blocks file mutations and keeps changes in a planning phase), you can assign a separate model specifically for planning — different from your regular session model. This lets you use a fast, cost-effective model for plan drafting while keeping a more capable model on standby for the implementation phase:
/model plan # open the picker to choose a model for plan mode
/model --plan claude-haiku # set a specific model for plan mode
/model --plan off # clear the plan-mode model (revert to session model)When you leave plan mode, the CLI automatically reverts to your session model. This pairing works well with repository model pinning — you can enforce a high-quality model for implementation while allowing a lighter model during exploration and planning.
CLI Session Commands
The /settings command opens an interactive dialog to browse and edit all user settings in one place. Use it to discover available settings, toggle options, and update values without manually editing your config file:
/settingsThe settings dashboard supports global search across settings and local resources — type to filter by name. Changes take effect immediately.
To open the current session in VS Code, use /code.
The /settings command and the /model command both support --repo and --local flags for explicitly scoping which layer of settings you want to view or edit:
/settings --repo # view/edit repository-scoped settings
/settings --local # view/edit local (user-level) settings
/model --repo # view/edit the model pinned for this repository
/model --local # view/edit your personal model preferenceThese flags mirror the Repo and Repo (local) scope tabs available in the /settings dashboard, giving you a unified place to see which settings are applied at each layer without ambiguity.
GitHub Copilot CLI has two commands for managing session state, with distinct behaviours:
| Command | Behaviour |
|---|---|
/new [prompt] | Starts a fresh conversation while keeping the current session backgrounded. You can switch back to backgrounded sessions. |
/clear [prompt] | Abandons the current session entirely and starts a new one. Backgrounded sessions are not affected. MCP servers configured in your project are preserved in the new session. |
Both commands accept an optional prompt argument to seed the new session with an opening message, for example /new Add error handling to the login flow.
The /session rename command renames the current session. When called without a name argument, it automatically generates a session name based on the conversation history:
/session rename # auto-generate a name from conversation history
/session rename "My feature" # set a specific nameAuto-generated names help you find sessions quickly when switching between multiple backgrounded sessions.
You can also name a session at startup with the --name flag, and resume it by name later:
copilot --name "auth-refactor" # start a session with a given name
copilot --resume="auth-refactor" # resume that session by nameThe /session delete command removes sessions you no longer need:
/session delete # delete the current session
/session delete <id> # delete a session by ID
/session delete-all # delete all sessionsYou can also press x on a highlighted session in the session picker (--resume) to delete it directly from the list.
In the session picker, press s to cycle the sort order: relevance, last used, created, or name. The picker also shows the branch name and idle/in-use status for each session.
Sessions Sidebar and Tab: The Sessions Sidebar is a persistent panel for managing multiple concurrent sessions — switch between them, spawn new ones, and see their status at a glance, all without leaving your current session. It is available by default alongside a dedicated Sessions tab. Enable or customize it in /settings:
/settings sidebarWith the sidebar open, you can see all running and backgrounded sessions in a split-view panel alongside your active conversation. Sessions are listed with their name, working directory, and running status. Click or keyboard-navigate (arrow keys, n to spawn, x twice to close) to switch sessions instantly. Use this when you regularly juggle several parallel workstreams and want a persistent view of all your sessions rather than accessing them through the /resume picker.
Sidebar sort order: The split Sessions sidebar supports Recent, Created, Name, and classic None sorting so you can order the list the way that fits your workflow. Your chosen order is remembered across CLI restarts.
Windows 11 taskbar status: On Windows 11, running Copilot CLI sessions appear in the taskbar with live hover status cards, so you can check on a background session's progress without switching back to its terminal window.
The /rewind command opens a timeline picker that lets you roll back the conversation to any earlier point in history. You can also trigger it by pressing double-Esc:
/rewindWhen you select a point to roll back to, /rewind presents a choice: roll back the conversation only (leaving your files as-is) or roll back both the conversation and file changes (restoring files to the state they were in at that point). /rewind does not require git — it restores only the files Copilot changed, skipping any file whose contents no longer match what Copilot last wrote.
Use /rewind when you want to branch off from a different point in the conversation, rather than just undoing the most recent turn.
The /undo command reverts the last turn—including any file changes the agent made—letting you course-correct without manually undoing edits:
/undoUse /undo when the agent's last response went in an unwanted direction and you want to try a different approach from that point.
The /fork command copies the current session into a new independent session that starts from the same conversation state. The original session continues unchanged — you can switch back to it at any time. This is useful when you want to explore two different approaches to a problem simultaneously. /branch is available as an alias for /fork (matching Claude Code's command naming):
/fork # fork with an auto-generated name
/fork "my-experiment" # fork with a custom name
/branch # alias for /forkAfter forking, the new session is immediately active. Both sessions share the same history up to the fork point but accumulate changes independently from that moment forward. Use /fork to experiment with a risky refactor without abandoning your current working session. Forked sessions display their origin session name in the sessions dialog, making it easy to trace which session a fork came from.
The /cd command changes the working directory for the current session. The working directory persists when you resume a session — if you restart the CLI and resume, you return to the same directory automatically. Changing directory also triggers discovery of custom agents in the new location, so switching to a different project loads its agents without a restart:
/cd ~/projects/my-other-repoThis is useful when you have multiple backgrounded sessions each focused on a different project directory.
The /worktree command (also aliased /move) creates a new git worktree and switches into it, moving any uncommitted changes along. This lets you start working on a parallel branch without leaving your current terminal session:
/worktree my-feature-branchYou can also pass a task description to /worktree to name the branch from the task and immediately run the task as the first prompt in the new worktree — all in one step:
/worktree fix the login redirectThis creates a branch named from your task description and begins working on it immediately, making it easy to spin up parallel work without stopping to think of a branch name.
After the command runs, the session is inside the new worktree. Use this when you want to work on a second task in parallel without stashing changes or opening a new terminal. You can also use the experimental --worktree flag at startup (copilot -w [name]) to create or reuse a worktree under <repo>.worktrees/ before the session begins.
The /new-worktree command (experimental) creates a new worktree and starts a fresh conversation in it — without inheriting the current session's history. This is useful when you want a completely clean slate for a new task in a parallel branch:
/new-worktree my-feature-branchUnlike /worktree (which keeps the current conversation), /new-worktree is the equivalent of opening a new terminal, switching to a worktree, and starting fresh — all in one step. The same behaviour is also available as a subcommand shorthand:
/worktree new my-feature-branchThe /every command (also available as /loop) schedules a recurring prompt to run automatically at a specified interval. The companion /after command runs a prompt once after a specified delay. Both are useful for self-paced automation — polling for results, periodically summarizing progress, or triggering other slash commands on a timer:
/every 5m Check if there are any new test failures and summarize them
/loop 30s Check if the build is done
/after 2h /compact # compact the session after 2 hours
/every 1d /chronicle standup # daily standup report via /chronicleThe text continues at the source. Read the rest.
Author: github, GitHub awesome-copilot. License: MIT.
Shown here with formatting for the web. Keep the author and license notice when you reuse it.
Related entries
There are more like this in the members library
The GitHub Copilot library holds 3,059 entries. Members can search all of them by meaning and read every one in full.