Hi all, where is the chat history stored?
I love Cursor but I just changed PC, while working on a same project, same folder but chat history is gone.
Thanks!
Hi all, where is the chat history stored?
I love Cursor but I just changed PC, while working on a same project, same folder but chat history is gone.
Thanks!
Hi @rudeevelops ,
Hopefully someone can give you a more satisfying/useful answer, but in previous posts on the topic of exporting chat history, I have seen this post referred to, which refers to a location where chat history is saved:
In response to that post, one user asked if there was a way to move data from one computer to another but hasn’t received a response yet:
Another user has put up a GitHub Repo that has this explanation:
Cursor’s chat history is stored in
sqlite3
databases usingstate.vscdb
files. One such file is for one workspace. All the chats for a workspace are saved here in so called tabs , one tab means a single chat.
Their post announcing the repo is here:
For reference, the Cursor team have noted the ‘export chat history’ feature request:
Thanks a lot!
Would be great if a centralized/synced approach based on user account is implemented so Cursor usage is not dependent on a local workstation.
Are you aware if core team are working on anything similar?
I made a cursor chat log browser which lets you browse and download your logs.
cursor-chat-browser on github…
Hi @rudeevelops
This SpecStory Cursor Extension lets you view and save your Chat & Composer history as Markdown, or get a URL so you can share the log with someone else.
(I made this alongside a small team — SpecStory. We just launched today in Showcase!)
I really like your idea about a centralized / synced approach. We’re working on authentication, so we can eventually tackle that!
A useless extension does not work at all Failed to read workspace storage:
I’ve just installed your extension. Had to move the project folder which is a nuisance. One thing to improve is to be able to prefix the .specstory history folders per developer, otherwise I have to .gitignore it.
Hey @CK-iRonin.IT, what would you like to prefix .specstory with? Can you open an issue GitHub - specstoryai/getspecstory: Install our VSCode extension for Cursor. File issues and requests.?
I just had Cursor write a chat history exporter in .md format here:
Specstory just saved me form loosing all the chat history in open Cursor instances after upgrading to 0.48.x today - I’m not the only one Lost entire chat history with 0.48.4 update - #7 by CK-iRonin.IT
Glad to hear it!
Is there a version of this for macOS?
Hey, this extension works on macOS!
I created gist with scripts to extract the history on a markdown file. Either use python on git bash or wsl to extract from the folder of dbs:
Thank you for mentioning. This is great…
I got my chat history back! Code was accidentally deleted, chat history disappeared. Devastating!
UNTIL - I searched on these forums and found I should look for .vscdb files on my computer which hold all the chat histories. Cursor told me to look in a hidden Library folder and actually opened the folder for me. - but they are not read-able. Cursor offered to help.
SOLUTION:
Cursor used 2 scripts to help search through the vscdb files and read them. I would tell Cursor what im looking for. key words, times, dates, and Cursor found everything one by one and compiled all the lost code and chat to a .md file. In conclusion ask Cursor to find it for you. I helped guide Cursor (EXAMPLE): " I remember asking to reduce the animation width by 50% and height by 50%." Cursor will find that point in the chat history and give all details and code involved.
Now let me make it easier - I asked Cursor to create a COPY and PASTE instruction message that you can give to your Cursor agent to help you recover lost chat history. here it is:
"Please help me recover lost chat history from Cursor’s workspace storage. This is a two-step process:
export_chats.py
that can search through SQLite databases in the workspace storage directory (on Mac: ~/Library/Application Support/Cursor/User/workspaceStorage
, each containing a state.vscdb
file). The script should search through chat data for specific time periods and keywords related to the lost content.clean_history.js
that processes the exported chat history. This script should:
export_chats.py
, refining the parameters each time to filter out noise and focus on relevant conversations. Once we have the raw chat data, we’ll use clean_history.js
to organize and clean it. When we find matching content, help me reconstruct the code and implementation details from the chat fragments. Please guide me through this process step by step, starting with creating both scripts and then helping me search effectively by suggesting relevant search terms and filtering strategies based on what I’m trying to recover. Remember that chat history might contain code snippets, implementation discussions, and debugging sessions that can help piece together the lost work."I got my chat history back! Code was accidentally deleted, chat history disappeared. Devastating!
UNTIL - I searched on these forums and found I should look for .vscdb files on my computer which hold all the chat histories. Cursor told me to look in a hidden Library folder and actually opened the folder for me. - but they are not read-able. Cursor offered to help.
SOLUTION:
Cursor used 2 scripts to help search through the vscdb files and read them. I would tell Cursor what im looking for. key words, times, dates, and Cursor found everything one by one and compiled all the lost code and chat to a .md file. In conclusion ask Cursor to find it for you. I helped guide Cursor (EXAMPLE): " I remember asking to reduce the animation width by 50% and height by 50%." Cursor will find that point in the chat history and give all details and code involved.
Now let me make it easier - I asked Cursor to create a COPY and PASTE instruction message that you can give to your Cursor agent to help you recover lost chat history. here it is:
"Please help me recover lost chat history from Cursor’s workspace storage. This is a two-step process:
export_chats.py
that can search through SQLite databases in the workspace storage directory (on Mac: ~/Library/Application Support/Cursor/User/workspaceStorage
, each containing a state.vscdb
file). The script should search through chat data for specific time periods and keywords related to the lost content.clean_history.js
that processes the exported chat history. This script should:
export_chats.py
, refining the parameters each time to filter out noise and focus on relevant conversations. Once we have the raw chat data, we’ll use clean_history.js
to organize and clean it. When we find matching content, help me reconstruct the code and implementation details from the chat fragments. Please guide me through this process step by step, starting with creating both scripts and then helping me search effectively by suggesting relevant search terms and filtering strategies based on what I’m trying to recover. Remember that chat history might contain code snippets, implementation discussions, and debugging sessions that can help piece together the lost work."1. Keep the Same Path Structure
Make sure your project path on the new machine matches exactly with the old machine.
Example:
PS C:\Users\User Name\Xyz-Project\React_FE\react-fe\react-fe>
This path must be identical on both machines.
2. Open the Project in Cursor on the New Machine
C:\Users\User Name\AppData\Roaming\Cursor\User\workspaceStorage\
Example:
C:\Users\User Name\AppData\Roaming\Cursor\User\workspaceStorage\fd84c037829daf424ecf3593ffdcb629
3. Identify the Correct Folder on the Old Machine
Go to the same workspaceStorage
path on your old machine.
Look for the hash-named folder that contains a file called workspace.json
.
Open workspace.json
and check if it matches your project’s path, e.g.:
PS C:\Users\User Name\Your-Project\React_FE\react-fe\react-fe>
If it matches, you’ve found the right folder.
4. Copy Chat Data from Old to New Machine
5. Done — Chat History Restored
Important Notes:
workspace.json
tells you which is which.