GitHub Copilot in VS Code stores a local cache of suggestions, authentication tokens, and model data to speed up responses. Over time, this cache can become corrupted or outdated, causing Copilot to suggest irrelevant code snippets, fail to activate, or return errors like “GitHub Copilot could not connect.” Resetting the local cache forces Copilot to rebuild its suggestion index and re-authenticate with the GitHub server.
This article explains what the local cache is, why it needs resetting, and how to delete it step by step in VS Code on Windows, macOS, and Linux. You will also learn how to clear the cache without uninstalling the extension and how to verify that the reset worked.
Key Takeaways: Resetting GitHub Copilot Local Cache
- VS Code command palette > Developer: Reload Window: Clears in-memory cache and reloads extensions without deleting files.
- Delete Copilot cache folder manually: Removes corrupt suggestion data stored at
~/.config/Code/CachedData/on Linux or%APPDATA%\Code\CachedData\on Windows. - Sign out and sign back in to GitHub: Forces Copilot to re-authenticate and rebuild the local token cache.
What the GitHub Copilot Local Cache Stores and Why It Fails
The GitHub Copilot extension for VS Code maintains a local cache to reduce network requests and speed up suggestion generation. This cache includes:
- Authentication tokens: Your GitHub login session and token so you do not have to sign in every time you open VS Code.
- Model context: Recently seen code snippets and file context that Copilot uses to generate relevant suggestions.
- Extension state: Configuration settings, enabled/disabled state, and last-used language models.
The cache can become corrupted when VS Code updates, when the Copilot extension updates, or when your GitHub token expires. A corrupted cache causes Copilot to stop responding, suggest outdated code, or fail to load entirely. Resetting the cache forces Copilot to discard all stored data and download fresh model context and authentication tokens from the server.
Steps to Reset the GitHub Copilot Local Cache in VS Code
You can reset the cache using three methods. Use the first method if Copilot is still partially working. Use the second method if Copilot is completely unresponsive. Use the third method if you want a clean slate without affecting other extensions.
Method 1: Use the Developer: Reload Window Command
This method clears the in-memory cache and reloads all extensions without deleting any files.
- Open the command palette
Press Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on macOS. - Run the Reload Window command
Type Developer: Reload Window in the command palette and press Enter. - Wait for VS Code to reload
VS Code closes and reopens all windows and extensions. The Copilot status icon in the bottom-right corner should turn green.
Method 2: Delete the Copilot Cache Folder Manually
This method removes all cached suggestion data and forces Copilot to rebuild its suggestion index from scratch.
- Close VS Code completely
Exit VS Code to prevent file locks on the cache folder. - Open the cache folder location
On Windows, open File Explorer and paste%APPDATA%\Code\CachedData\into the address bar. On macOS, open Finder and press Cmd+Shift+G, then paste~/Library/Application Support/Code/CachedData/. On Linux, open your file manager and navigate to~/.config/Code/CachedData/. - Delete all files and subfolders
Select every item inside the CachedData folder and press Delete. You may need to confirm the deletion. - Restart VS Code
Open VS Code. The Copilot extension will rebuild the cache automatically.
Method 3: Sign Out and Sign Back In to GitHub
This method clears the authentication token cache and forces Copilot to re-authenticate.
- Open the Copilot status menu
Click the Copilot icon in the bottom-right corner of the VS Code window. - Select Sign Out
Choose Sign out of GitHub Copilot from the menu. - Sign back in
Click the Copilot icon again and select Sign in to GitHub Copilot. A browser window opens requesting GitHub authorization. Complete the sign-in process.
If Copilot Still Has Issues After Resetting the Cache
Resetting the cache usually fixes most Copilot problems, but some issues require additional steps.
Copilot Still Shows “Not Authenticated” After Signing In
This happens when the cached token file is locked by another process. Close VS Code, delete the %APPDATA%\Code\User\globalStorage\github.copilot folder on Windows or the equivalent path on macOS and Linux, then restart VS Code and sign in again.
Copilot Suggests Code in the Wrong Language
This indicates the model context cache is stale. Use Method 2 to delete the entire CachedData folder. Then open a file in the correct language and let Copilot generate a few suggestions to rebuild the context.
Copilot Extension Does Not Load After Cache Reset
The extension itself may be disabled or corrupted. Open the Extensions view by pressing Ctrl+Shift+X, search for “GitHub Copilot”, and check that it is enabled. If it is enabled but still not loading, disable it, reload the window, then enable it again.
VS Code Reload Window vs Manual Cache Deletion: Key Differences
| Item | Reload Window | Manual Cache Deletion |
|---|---|---|
| Scope | Clears in-memory cache only | Deletes all cached suggestion files |
| Effect on extensions | Reloads all extensions | Does not reload extensions automatically |
| Authentication tokens | Preserved | Preserved unless you delete the Copilot folder |
| Time to complete | 10 seconds | 2 minutes |
| When to use | Copilot is slow or not responding | Copilot suggests outdated or irrelevant code |
Choose Reload Window for quick in-memory issues. Use manual cache deletion when Copilot generates stale or wrong suggestions.
You can now reset the GitHub Copilot local cache in VS Code using the Developer: Reload Window command, manual folder deletion, or sign-out method. For persistent issues, delete the github.copilot folder in the globalStorage directory to clear all authentication and state data. As an advanced tip, you can automate the manual cache deletion by creating a batch script or shell script that deletes the CachedData folder before launching VS Code.