You may need to disable GitHub Copilot for one specific project while keeping it active in all others. This is common when working with confidential code, proprietary algorithms, or projects where AI suggestions are not permitted by company policy. Visual Studio Code allows per-workspace settings that override the global configuration. This article shows you how to disable Copilot for a single workspace using the settings.json file and the VS Code command palette.
Key Takeaways: Disabling GitHub Copilot in One Workspace
- Workspace settings.json: Add
"github.copilot.enable": falseto disable Copilot for the current project only. - Command Palette > Developer: Reload Window: Apply the setting change without restarting VS Code.
- Status bar icon: Click the Copilot status bar icon and select “Disable for Workspace” for a quick toggle.
How VS Code Workspace Settings Work for Extensions
VS Code separates settings into three levels: user, workspace, and folder. User settings apply to all projects. Workspace settings apply only to the current project folder. When both exist, the workspace setting overrides the user setting for that project. This hierarchy lets you disable an extension like GitHub Copilot in one workspace without affecting others.
The setting that controls Copilot is github.copilot.enable. It accepts a boolean value: true enables Copilot, false disables it. By placing this setting in the workspace-level settings.json file, you restrict the change to that specific project.
Before you start, ensure you have the GitHub Copilot extension installed and signed in. The workspace must be open in VS Code. You do not need administrator rights on your machine to change workspace settings.
Steps to Disable GitHub Copilot for a Single Workspace
There are two methods to disable Copilot per workspace. Use the settings editor for a visual approach or the command palette for a faster workflow.
Method 1: Using the Settings Editor
- Open the Command Palette
Press Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on macOS. - Open Workspace Settings
Type Preferences: Open Workspace Settings (JSON) and select it. This opens the workspace-specific settings.json file. - Add the Copilot Disable Setting
Insert the following line inside the JSON object:"github.copilot.enable": false
If the file is empty, wrap it in curly braces:{ "github.copilot.enable": false } - Save the File
Press Ctrl+S or Cmd+S to save. VS Code applies the setting immediately. - Reload the Window
Open the Command Palette again, type Developer: Reload Window, and press Enter. This ensures the extension rereads the settings.
Method 2: Using the Status Bar Icon
- Locate the Copilot Status Bar Icon
Look at the bottom-right corner of the VS Code window. The Copilot icon appears as a small chat bubble or the Copilot logo. - Click the Icon
A menu appears with options for enabling or disabling Copilot. - Select Disable for Workspace
Click Disable for Workspace. VS Code adds thegithub.copilot.enablesetting to the workspace settings.json file automatically. - Reload the Window
Open the Command Palette with Ctrl+Shift+P or Cmd+Shift+P, type Developer: Reload Window, and press Enter.
Common Issues When Disabling Copilot Per Workspace
Copilot Still Appears in the Workspace After Disabling
If Copilot suggestions still appear, the workspace setting may not have been saved correctly. Open the workspace settings.json file again and verify the line "github.copilot.enable": false exists. Also check that there is no conflicting user setting. Go to File > Preferences > Settings, search for github.copilot.enable, and ensure the user-level setting is not forcing it to true. The workspace setting should override it, but a bug in older VS Code versions can cause conflicts. Update VS Code to the latest version if this occurs.
Copilot Disabled for All Workspaces Instead of One
This happens when you accidentally edit the global user settings.json file instead of the workspace settings.json file. To confirm you are in the right file, check the tab title in VS Code. It should say settings.json (Workspace) not settings.json (User). If you see the user file, close it and reopen the workspace settings using the method described above.
The Settings.json File Does Not Exist for the Workspace
VS Code creates the workspace settings.json file the first time you use the workspace settings editor. If you open the file and it is empty or missing, use the Command Palette method to open Preferences: Open Workspace Settings (JSON). This forces VS Code to create the file in the .vscode folder at the root of your project.
Workspace Disable vs Extension Disable: What Changes
| Item | Disable for Workspace | Disable Extension Globally |
|---|---|---|
| Effect | Copilot turns off in one project only | Copilot turns off in all projects |
| Method | Add setting to workspace settings.json | Disable extension in Extensions pane |
| Re-enable | Remove the setting or change to true | Enable extension in Extensions pane |
| Team impact | Setting can be committed to .vscode folder | Only affects your local user config |
Disabling Copilot for a workspace does not uninstall the extension. It only stops the extension from providing suggestions and completions. All other Copilot features, such as the Copilot Chat panel, also stop working in that workspace. The extension remains active in the background but does not execute any code analysis or suggestion logic.
You can now disable GitHub Copilot for a single VS Code workspace using either the settings JSON file or the status bar icon. The change persists across VS Code sessions until you remove the setting. For teams, consider adding the workspace setting to your project’s .vscode folder and committing it to version control so all contributors use the same configuration. A concrete next step is to test the disable by opening a file in the workspace and typing code to confirm no ghost text suggestions appear.