In my Mac these 2 dbs are 20Gb each and it’s surprised me, because I didn’t notice it could be so big. So, I ask you what are the best practices to maintain those files in a good size, because I have just a 256 SSD and it’s ‘eating’ too much space?
Hey, this is a known issue. The cursorDiskKV table inside state.vscdb keeps storing data from chats and agent sessions with no limit or cleanup. The team is aware, but there’s no ETA yet.
sqlite3 ~/Library/Application\ Support/Cursor/User/globalStorage/state.vscdb <<'SQL'
PRAGMA journal_mode=DELETE;
BEGIN IMMEDIATE;
DELETE FROM cursorDiskKV WHERE key LIKE 'agentKv:%';
DELETE FROM cursorDiskKV WHERE key LIKE 'bubbleId:%';
DELETE FROM cursorDiskKV WHERE key LIKE 'checkpointId:%';
COMMIT;
VACUUM;
SQL
This can shrink the file from 20 GB down to tens of MB. But note that chat history in the UI will disappear. Old chats may show an endless Loading Chat. The actual chat data isn’t deleted from workspaceStorage, the UI just won’t be able to find it. Agent transcripts will still be in ~/.cursor/projects/.
The state.vscdb.backup file is an automatic backup created by Cursor. It should shrink on its own after the main file gets smaller.
More details and workaround discussion:
Let me know if you have any questions about the process.
Yeah, there’s no automatic cleanup yet, so you’ll need to do it manually from time to time. How often depends on how actively you use Agent and chats. If you use it a lot, you might need to do it every couple of weeks. If you use it moderately, once a month should be enough.
The team is aware of the issue. There’s no exact ETA yet, but your report helps with prioritization. Once there’s a built-in retention policy, manual cleanup won’t be needed.
For now, just keep an eye on the file size and clean it up when it starts getting too big.