Cursor Database too large - state.vscdb

Its currently at 42.6 GB - and cursor does not provide a setting to move that DB to another drive.

What is the hack to improve this?

Is there a maintenance settings that can trim old chat history from it?

The hack is to move the globalStorage to another drive - then create a symlink

  1. First exit all cursor windows
  2. Rename APPDATA\Cursor\User\globalStorage directory to “globalStorage.bak”
  3. Copy it to the new drive
  4. On the new drive rename it back to “globalStorage”
  5. Then update the below command to your own locations - then run this in Administrator Terminal - This will create the symlink.

cmd /c mklink /J “$env:APPDATA\Cursor\User\globalStorage” “D:\CursorDB\globalStorage”

Boot into Cursor and make sure all chat history etc is still there… If all is good then delete that “globalStorage.bak” to free up space.

Hey, thanks for coming back and sharing your approach. A symlink to globalStorage is a working option, even if it’s unofficial, so make a backup before moving things, like you said.

A couple extra notes:

Officially supported migration. There isn’t a separate setting just for state.vscdb, but you can move the whole user data directory via the launch flag --user-data-dir <path> or use portable mode. That’s the supported path if you don’t want to rely on a symlink.

To trim old history. Open the Command Palette with Ctrl+Shift+P, run Developer: Delete Old Chats..., and pick an age cutoff. Before you run it, close other Cursor windows and back up the DB. Note that on a 42 GB database, the vacuum step will take noticeable time and needs free disk space roughly equal to the DB size.

Important: deleting chats from the sidebar doesn’t free space right now. You need the command above for that.

About state.vscdb growing without an age limit, that’s an issue we’re tracking, but there’s no ETA yet. If there’s an update, I’ll reply. Let me know how the trim goes.

It would be great if Cursor would occasionally check for this on its own and suggest it, or even do it automatically based on the TTL setting in the preferences :thinking: