The problem: restored sessions reopening a file that crashes the editor
VS Code can be configured to reopen previously open files the next time the app launches. That's convenient right up until the restored session points at a file that reliably crashes the editor.
One such case: reinstalling a local WordPress site that ships with a 3GB+ database. Opening that SQL file for a search-and-replace required raising the memory limit, and there is even an extension that both increases the memory and performs a search-and-replace on open.
Even after the oversized file was deleted, the editor kept attempting to reopen it and crashed each time, forcing a wait on the MacOS beachball before the app could be relaunched.
Fixes that didn't work
A Stack Overflow thread recommends disabling extensions and increasing the memory limit from the command line; another thread recommends clearing the app's cache from the command palette.
What worked: delete the offending cache file manually
The fix that stuck was clearing cached files by hand, following a YouTube walkthrough by Jie Jenn. The video demonstrates Windows, but the MacOS steps are nearly identical. The cache lives in the user folder.
Removing the files in the CachedData folder — the step shown in the video — only triggered a prompt to reinstall the app. Deleting what appeared to be a 3GB+ file in the Backups folder did the trick, and the editor has launched cleanly since.
The obvious caveat applies: deleting arbitrary cache files is a gamble, and only time will tell whether anything else broke. In this case, so far, so good.



