You might need to sign out of GitHub Copilot in VS Code when the extension stops responding, shows authentication errors, or you switch GitHub accounts. Authentication tokens can expire or become corrupted after a VS Code update or a password change. This article explains the exact steps to sign out and then re-authenticate GitHub Copilot, restoring its code completion and chat features.
Key Takeaways: Sign Out and Re-Authenticate GitHub Copilot in VS Code
- VS Code Accounts menu (bottom-left gear icon > Accounts): Lists all signed-in GitHub accounts and lets you sign out of Copilot.
- GitHub Copilot status icon (bottom-right of VS Code window): Indicates authentication state and provides a shortcut to re-authenticate.
- Command Palette > GitHub Copilot: Sign Out: Directly signs out the Copilot extension without affecting other GitHub integrations.
Why You Need to Sign Out and Re-Authenticate GitHub Copilot
GitHub Copilot relies on an OAuth token stored locally in VS Code. This token expires after a set period, usually 8 hours for the free tier or 30 days for paid plans. When the token expires, Copilot stops providing suggestions and the status icon turns yellow or red. Other reasons include switching between a personal and a work GitHub account, or a recent VS Code update that invalidates the cached token. Signing out clears the old token, and re-authenticating generates a fresh one.
Steps to Sign Out of GitHub Copilot in VS Code
Follow these steps to sign out of GitHub Copilot. Choose the method that matches your current setup.
Method 1: Using the VS Code Accounts Menu
- Open the Accounts menu
In the bottom-left corner of the VS Code window, click the gear icon (gear icon). In the dropdown menu, select Accounts. - Find your GitHub account
In the Accounts pane that opens on the left sidebar, locate the GitHub account currently signed in. You will see the account avatar and email. - Sign out of the account
Hover over the account entry. Click the Sign Out button that appears. A confirmation dialog may appear. Click Yes. - Verify sign-out
The account entry disappears from the Accounts pane. The GitHub Copilot status icon in the bottom-right corner turns gray or shows a warning sign.
Method 2: Using the Command Palette
- Open the Command Palette
Press Ctrl+Shift+P on Windows or Cmd+Shift+P on macOS. - Run the sign-out command
Type GitHub Copilot: Sign Out and press Enter. VS Code immediately signs out the extension without affecting other GitHub sign-ins like GitHub Pull Requests. - Check the status icon
Look at the bottom-right corner of VS Code. The Copilot icon changes from a green checkmark to a gray circle or a yellow warning triangle.
Steps to Re-Authenticate GitHub Copilot in VS Code
After signing out, you must re-authenticate to restore Copilot functionality.
- Trigger re-authentication
Click the GitHub Copilot status icon in the bottom-right corner of VS Code. In the popup menu, select Sign in to GitHub Copilot. Alternatively, open the Command Palette with Ctrl+Shift+P or Cmd+Shift+P, type GitHub Copilot: Sign In, and press Enter. - Complete the browser-based sign-in
A browser window opens to the GitHub authorization page. If you are not already signed into GitHub in the browser, enter your credentials. Click Authorize Visual Studio Code when prompted. - Confirm in VS Code
After authorization, the browser shows a success message. Return to VS Code. The Copilot status icon turns green with a checkmark. A notification may appear: GitHub Copilot is now active. - Test the connection
Open a supported file type like .py, .js, or .ts. Start typing a few lines of code. Copilot should begin suggesting completions in gray text.
If Copilot Still Has Issues After Re-Authentication
Copilot status icon shows yellow warning after re-authentication
A yellow warning triangle means Copilot is signed in but cannot reach the GitHub server. Check your internet connection. If you are behind a corporate proxy or VPN, ensure that api.github.com and copilot-proxy.githubusercontent.com are allowed. In VS Code, open Settings with Ctrl+, or Cmd+,, search for Http: Proxy, and set the proxy URL if required.
Copilot suggests code but not in the current file
Copilot works only in certain file types. Verify that the file extension is one of the supported languages, such as Python, JavaScript, TypeScript, Ruby, Go, or C#. If the language is supported but suggestions still do not appear, open the Command Palette, run Developer: Reload Window, and try again.
Multiple GitHub accounts signed in
If you have two GitHub accounts signed in through the Accounts menu, Copilot uses the account that was authorized first. To switch accounts, sign out of both accounts using the Accounts menu, then sign in only with the desired account using the steps above.
Signing Out via Accounts Menu vs Command Palette: Key Differences
| Item | Accounts Menu | Command Palette |
|---|---|---|
| Scope | Signs out the entire GitHub account from VS Code, affecting all GitHub extensions | Signs out only the GitHub Copilot extension |
| Steps required | 3 clicks plus confirmation | 1 command plus Enter |
| Best for | Switching GitHub accounts completely | Quickly resetting Copilot without affecting other tools |
After signing out and re-authenticating GitHub Copilot in VS Code, you now have a fresh authentication token and should see code suggestions again. If you encounter repeated token expirations, check your GitHub Copilot subscription status at github.com/settings/copilot to ensure your plan is active. For persistent issues, try clearing the VS Code authentication cache by deleting the AuthService folder in %APPDATA%\Code\User\globalStorage\ on Windows or ~/Library/Application Support/Code/User/globalStorage/ on macOS.