Part of the AI coding agent security checklist
Where Cursor stores your chat and agent history
The chat where Cursor's agent ran that migration is gone from the sidebar, and you want to know exactly what it did. It is still on your disk: Cursor keeps every editor chat, with each tool call and its result, in one SQLite database. Cursor publishes no storage format, so this is what ranwhat's reader found in it, with the caveats.
Paths and keys are the ones ranwhat's Cursor reader uses, checked against a real Cursor 3.6 session and the open-source readers under Sources. Published .
Where does Cursor store chat history?
In one SQLite database, Cursor/User/globalStorage/state.vscdb, in your system's application data folder.
Cursor ignores VS Code's VSCODE_PORTABLE and VSCODE_APPDATA, so these paths hold even when you moved VS Code's. The per-workspace workspaceStorage/*/state.vscdb files hold no chats any more: since the composer replaced the old chat panel, their chat table is empty.
Where does the Cursor CLI store its sessions?
One SQLite file per session, ~/.cursor/chats/<md5 of the folder>/<agentId>/store.db.
The folder name is the MD5 hash of the directory you ran cursor-agent in, so ls ~/.cursor/chats shows hashes, not project names. ACP sessions are under ~/.cursor/acp-sessions/<id>/, with meta.json beside the database naming the folder. Messages sit in a blobs table as JSON, with each tool call and its result; a shell result is the text Exit code: N followed by the output. CLI messages carry no time of their own.
What is in Cursor's state.vscdb?
Chats are rows in the cursorDiskKV table, each value a UTF-8 JSON document.
The database can grow to gigabytes, because every chat, every message and the file contents of every edit are in it. Bubbles that a rewind or an edit dropped from a chat are still rows: what they ran, ran. All of this is undocumented and can change with a Cursor update.
How do I read Cursor chat history myself?
Copy the database and its -wal file, then open the copy read-only with sqlite3.
# macOS; on Linux use ~/.config/Cursor/User/globalStorage cd ~/Library/Application\ Support/Cursor/User/globalStorage mkdir -m 700 ~/cursor-copy cp state.vscdb state.vscdb-wal ~/cursor-copy/ 2>/dev/null # how many chats sqlite3 -readonly ~/cursor-copy/state.vscdb \ "SELECT count(*) FROM cursorDiskKV WHERE key >= 'composerData:' AND key < 'composerData;'" # done: the copy holds your Cursor login too rm -r ~/cursor-copy
A running Cursor keeps its newest rows in state.vscdb-wal, so copy both. The key range in the query uses the table's index, which matters on a large file; a LIKE would scan every row. Never write to the live database.
How do I see what Cursor's agent ran?
Run uvx ranwhat watch --source cursor: it reads both stores read-only and lists the risky calls.
How do I delete Cursor chat history?
Delete the chat in Cursor itself; Cursor documents no retention period, so nothing expires on its own.
Deleting state.vscdb removes far more than chats: it is the editor's shared state, login included. For the CLI, remove the session folders under ~/.cursor/chats. If a chat showed a credential, rotate it at the provider first: deleting your copy does not undo that it was readable, as rotating a leaked key explains.
Common questions about Cursor chat history
Does Cursor save chat history locally?
Yes. Every editor chat is saved in state.vscdb in Cursor's application data folder, and CLI sessions in ~/.cursor/chats. Cursor publishes no retention period for either.
Is Cursor chat history encrypted?
The chat values ranwhat reads are plain JSON inside SQLite, so file permissions are the only protection. Anything running as you can read them, and so can whatever backs up your home folder.
Where are Cursor chats for one project?
In the same global database. Each chat records its workspace, and composer.composerHeaders lists every chat with it; workspaceStorage/<id>/workspace.json maps a workspace id to its folder.
Why is Cursor's state.vscdb so large?
It holds every chat, every message and the before and after text of every file the agent edited, in one file.