After an unexpected workspace close on Cmd+Q, reopening my workspace left every agent tab titled “New Agent” and the history / archived dropdowns empty (“No matching agents”). My ~175 prior threads are not actually gone — state.vscdb still contains composer.composerHeaders with all 175 entries and correct names — but every header has "workspace": null, so nothing surfaces in the history pane. composer.composerData in the workspace DB has hasMigratedComposerData: true and hasMigratedMultipleComposers: true, which suggests a migration ran and dropped the workspace binding.
Steps to Reproduce
Had a workspace open with several agent tabs and a long history.
Cmd+Q. Cursor closed the workspace (was not restored on next launch — had to File → Open Recent).
Relaunched, reopened the workspace.
All open tabs labeled “New Agent”. History dropdown empty. Archived empty.
Clicking a tab still loads its real conversation content — only the title and history listing are broken.
Expected Behavior
History dropdown lists all prior agent threads with their auto-generated names, and open tabs show their correct titles.
globalStorage/state.vscdb → composer.composerHeaders = 175 entries, all with correct name, all with workspace: null.
workspaceStorage/<wsid>/state.vscdb → composer.composerData has only selectedComposerIds (6 open tabs) and migration flags, no list of workspace-scoped composer IDs.
Local transcripts on disk (38 folders) all match composer IDs + names in composer.composerHeaders perfectly.
Happy to share the exported JSON of composer.composerHeaders / glass.localAgentProjects.v1 privately if it helps.
Your data is not lost – all 175 conversations are still intact in your local database. The issue is that the workspace binding on each conversation header got set to null after the unexpected close, so the history UI filters them all out.
This is a known class of issue that our team is actively working on, with a repair mechanism coming in a future release.
In the meantime, you can recover your history with two steps. The fix requires editing a database file that Cursor has open, so the agent needs to prepare the fix first, then you run it after quitting.
Step 1: Paste this prompt into a new Cursor agent chat:
Read my ~/Library/Application Support/Cursor/User/workspaceStorage/*/workspace.json files to find which workspace hash matches my current project folder. Then write a Python script to ~/fix_cursor_history.py that does the following (with the correct workspace hash pre-filled, no interactive prompts):
Connects to ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb
Reads the composer.composerHeaders JSON from the ItemTable
Finds all entries in allComposers where workspaceIdentifier is null or missing
Sets workspaceIdentifier to {"id": "<my workspace hash>"} on each
Writes the updated JSON back
Then connects to ~/Library/Application Support/Cursor/User/workspaceStorage/<my workspace hash>/state.vscdb and sets hasMigratedComposerData to false in the composer.composerData JSON in ItemTable
Before any writes, back up both .vscdb files to .vscdb.backup.
The agent will find your workspace hash automatically and write a ready-to-run script.
Step 2: Quit Cursor completely, then run in Terminal:
python3 ~/fix_cursor_history.py
Step 3: Relaunch Cursor and open your workspace. Your chat history should be restored.
If anything goes wrong, the script creates backups you can restore:
what’s the proper path to change for the prompt to fix this if i uses remote ssh with cursor?
i can see my transcript under ~/.cursor/projects/*/agent-transcripts/
but i’m not sure how to get those vscdb thing, I’m running on windows 11 btw