How can I reduce the size of the state.vscdb file without deleting chats?

Hey, thanks for the screenshots. They make it clear where the gigabytes are going: state.vscdb is 14,3 GB and state.vscdb.backup is 10,62 GB.

Start with the easy win. state.vscdb.backup is no longer updated on purpose. Cursor stopped copying a multi-GB DB on every close, so the old file just got left behind. You can delete it after Cursor is fully closed, and that will free up about 10 GB right away and won’t affect your chats.

Next is state.vscdb. You don’t need to delete chats. There’s a correct way to clean it up and compact it:

  • Open the Command Palette with Cmd+Shift+P and run GC Agent KV Blobs. This removes orphaned data and compacts the DB, and it keeps your chats.
  • With a DB this big, it can take a few minutes and it will temporarily need free disk space roughly equal to the current DB size. Let it finish and don’t close Cursor.
  • If you want a safety copy of important chats first, open the chat and run Export Chat from the Command Palette to get a markdown copy.

The files are in ~/Library/Application Support/Cursor/User/globalStorage.

One more note from earlier in the thread: for DBs created by older Cursor versions, space can be freed inside the file but not always returned to the OS. So the file size on disk might not drop much even though the extra data is cleaned and performance gets back to normal. We’re tracking this issue. Let me know how it goes after the cleanup.