VS Code Copilot Not Working? Here’s How to Fix It

GitHub Copilot is the AI-powered coding assistant that’s been transforming how developers write code inside Visual Studio Code. However, when it fails — especially with authentication errors like the dreaded 401 Copilot token error — productivity grinds to a halt. In this detailed guide, we break down exactly how to fix GitHub Copilot when it’s not working in VS Code, with tested solutions that work across platforms.

What Happens When Copilot Stops Working

You may notice Copilot isn’t suggesting code anymore, or you might see logs like:

[auth] Failed to get copilot token due to 401 status. Please sign out and try again.

This means Copilot can’t authenticate with GitHub, often due to expired tokens, account mismatches, or corrupted credentials.

Confirm Your Copilot Is Enabled and Licensed

  1. Visit: https://github.com/settings/copilot
  2. Ensure your GitHub account has an active Copilot subscription.
  3. Verify that you’re signed in with the same account in Visual Studio Code.
  4. If you’re using an organisation or enterprise account, confirm your admin has enabled Copilot access.

Clear Old Authentication Cache (Most Effective Fix)

This is the most reliable method to fix Copilot token issues, especially 401 errors.

Follow these exact steps:

  1. Click your account icon in the bottom-left corner of VS Code.

  2. Click Sign Out for both GitHub and Copilot.

  3. Open the Command Palette (Ctrl + Shift + P) and run: Developer: Open Settings (JSON)

  4. Find and delete any lines that include:

    • github.token
    • copilot.token
  5. For deeper cleanup:

    • Windows: Open Credential Manager → delete all entries containing GitHub or Copilot.

    • macOS/Linux: Open terminal and run:

      git credential-reject
      

After cleanup, restart VS Code and sign in again. This method resets all corrupt or expired authentication sessions.

Sign Out and Sign In the Proper Way

If cache clearing didn’t help, try the full sign-in reset:

  1. Run from Command Palette:

    • Copilot: Sign out
    • GitHub: Sign out
  2. Restart VS Code.

  3. Run:

    • GitHub: Sign in
    • Copilot: Sign in
  4. Follow the browser prompts carefully and do not close the tab until confirmation appears.

Remove OAuth Access from GitHub Settings

Sometimes the issue is on GitHub’s end. You can revoke VS Code’s permission and reauthorise from scratch.

  1. Go to: https://github.com/settings/applications
  2. Under Authorized OAuth Apps, find Visual Studio Code.
  3. Click Revoke Access.
  4. Reopen VS Code and sign in again.

Update VS Code and Copilot Extension

Outdated extensions or software often cause bugs.

  • Go to Help > Check for Updates in VS Code.
  • Open Extensions (Ctrl+Shift+X)
  • Search for GitHub Copilot, click Update if available.
  • If issues persist, uninstall and reinstall the extension.

Disable VPN, Firewall, or Proxy

Authentication with GitHub requires uninterrupted access to:

  • https://github.com
  • https://vscode-auth.github.com
  • https://copilot-proxy.githubusercontent.com

Disable your VPN or proxy and retry authentication. Add these domains to your firewall allowlist if necessary.

Configure Git Credential Helper

If your credentials aren’t stored correctly, VS Code won’t be able to authenticate GitHub sessions.

Run this in terminal:

git config --global credential.helper manager-core

This command ensures GitHub credentials are stored and fetched properly on future requests.

Use Developer Tools to Trace Copilot Issues

  1. Run: Developer: Toggle Developer Tools from Command Palette

  2. Go to the Console tab.

  3. Look for errors related to:

    • copilot
    • 401
    • authentication
  4. These logs often point directly to the root cause, such as permission issues, token expiry, or misconfigured scopes.

Set GitHub Enterprise Domain (If Applicable)

If you’re using GitHub Enterprise, you must set your enterprise domain manually.

  1. Run from Command Palette: GitHub: Set GitHub Enterprise Domain
  2. Enter your organisation’s GitHub domain (e.g., https://github.company.com)
  3. Authenticate as usual after this setup.

Change Default Browser Temporarily

VS Code opens the sign-in window in your default system browser. Some browsers may block necessary redirects or cookies.

  1. Set your default browser to Chrome or Firefox.
  2. Retry the GitHub: Sign in and Copilot: Sign in process.

Copilot Still Silent? Check Language Support and File Types

Ensure the file you’re working on is supported. Copilot works best in:

  • JavaScript / TypeScript
  • Python
  • HTML / CSS
  • Go, Java, C++, Ruby

Not all languages or file types are supported equally. Also check that suggestions haven’t been disabled in VS Code settings.

Copilot Icon Missing From Status Bar

If the Copilot icon vanishes:

  1. Open the Command Palette
  2. Run: Copilot: Enable
  3. If no response, uninstall and reinstall the extension

Reload or Restart VS Code

Simple but effective:

  • Run: Developer: Reload Window
  • Or fully close and reopen VS Code

This helps especially after cleaning tokens or changing authentication settings.

Final Troubleshooting Checklist

ActionCompleted?
Cleared authentication cache
Signed out and in
Updated extensions and VS Code
Disabled VPN/proxy
Re-authorised on GitHub
Configured credential helper
Verified Copilot subscription

Conclusion

When GitHub Copilot stops working in VS Code, the cause is almost always related to authentication tokens, expired credentials, or misconfigurations. By following the full cleanup method, clearing all cached credentials, and signing in through the recommended steps, you can restore functionality and keep your workflow seamless.