Cursor lost all my agent chat history

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

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

  1. Had a workspace open with several agent tabs and a long history.
  2. Cmd+Q. Cursor closed the workspace (was not restored on next launch — had to File → Open Recent).
  3. Relaunched, reopened the workspace.
  4. All open tabs labeled “New Agent”. History dropdown empty. Archived empty.
  5. 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.

Operating System

MacOS

Version Information

Version: 3.1.17 (Universal)
VSCode Version: 1.105.1
Commit: fce1e9ab7844f9ea35793da01e634aa7e50bce90
Date: 2026-04-19T19:33:58.189Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 24.6.0

For AI issues: which model did you use?

Claude-opus-4-7-high

Additional Information

  • globalStorage/state.vscdbcomposer.composerHeaders = 175 entries, all with correct name, all with workspace: null.
  • workspaceStorage/<wsid>/state.vscdbcomposer.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.

Does this stop you from using Cursor

Yes - Cursor is unusable

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:

cp ~/Library/Application\ Support/Cursor/User/globalStorage/state.vscdb.backup ~/Library/Application\ Support/Cursor/User/globalStorage/state.vscdb

Hopefully this resolves it.

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

Thanks @mohitjain , will try to fix it with the help of cursor, let me know if you find a reason or something I did that triggered that.

I backed up all the history (6gb) before messing with it.

Cheers,

Laurence.