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

**URL:** <https://forum.cursor.com/t/how-can-i-reduce-the-size-of-the-state-vscdb-file-without-deleting-chats/169927>\
**Category:** Help\
**Tags:** performance, chat\
**Created:** [August 29, 2026, 3:09pm UTC](https://forum.cursor.com/t/how-can-i-reduce-the-size-of-the-state-vscdb-file-without-deleting-chats/169927 "2026-08-29T15:09:15Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [September 2, 2026, 8:39am UTC](https://forum.cursor.com/t/how-can-i-reduce-the-size-of-the-state-vscdb-file-without-deleting-chats/169927/19 "2026-09-02T08:39:38Z")

</div>

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.

---

_[View the full topic](https://forum.cursor.com/t/how-can-i-reduce-the-size-of-the-state-vscdb-file-without-deleting-chats/169927)._
