If you’re running out of space on your Linux desktop or laptop, Visual Studio Code might be the culprit. There’s a bug that causes some VS Code installations to never delete files after you trash them, potentially eating up hundreds of gigabytes of storage.
When you delete a file or folder in Visual Studio Code, the data is usually moved to your system’s trash directory or recycle bin. That way, you can restore the file if needed, at least until you empty the trash. However, when Visual Studio Code is installed as a Snap package on a Linux computer, the file is moved to a trash folder within the Snap package, instead of the system trash bin.
This behavior prevents files from being recovered by opening the system’s trash folder. More importantly, Visual Studio Code is not cleaning out that trash directory. If you ‘deleted’ a file in your project six months ago, it might still be in the Snap container’s trash directory.
You can check the Snap package’s trash directory by navigating to the below directory, replacing “
/home//snap/code/current/.local/share/Trash The “.local” directory may be hidden by some file managers. If you can’t find it, try running this command in the Terminal:
xdg-open /home/$USER/snap/code/current/.local/share/TrashThe issue was initially reported in November 2024, and it has not yet been fixed. One person said, “There are files in there from 2 years ago. Holding onto files in the trash forever seems like a bug.” Another person replied, “I had almost 200GB of data that I thought were previously deleted.”
This bug only seems to affect the Snap package version of Visual Studio Code on Linux. If you are using that version, I recommend uninstalling VS Code and using the official .DEB or .RPM packages instead. If your distribution doesn’t support those package formats, you can run it from a folder with the .tar.gz download option, or try the unofficial Flatpak version on Flathub.
VSCodium, a popular recompiled version of Visual Studio Code, also seems to be affected. I installed the Snap package version on Ubuntu 24.04, and when I deleted files, they were moved to the trash directory inside the Snap container (which is called “codium” instead of “code”). As with regular Visual Studio Code, installing a non-Snap version should fix the problem.
Hopefully, Microsoft actually fixes this bug in the near future, so Visual Studio Code stops eating up hundreds of gigabytes of storage for no reason.
Source: GitHub via Chris Hayes (Mastodon)


