October 29, 2026 · last month
I recently lost a prompt I'd spent a while writing in Cursor. After some poking around, I realized I could search Cursor's local database. A keyword I remembered was enough to recover it.
Open Cursor's local database in read-only mode. On macOS:
1sqlite3 -readonly "$HOME/Library/Application Support/Cursor/User/globalStorage/state.vscdb"Database locations
- Windows:
%APPDATA%\Cursor\User\globalStorage\state.vscdb- Linux:
~/.config/Cursor/User/globalStorage/state.vscdb
At the sqlite> prompt, search for a word you remember:
1SELECT key, CAST(value AS TEXT)
2FROM cursorDiskKV
3WHERE CAST(value AS TEXT) LIKE '%keyword%';Replace keyword with your word, keeping the % characters. Matching entries contain JSON; look for your prompt in the text field. If it appears as a composerDraft: entry, this query extracts the readable text:
1SELECT json_extract(CAST(value AS TEXT), '$.text')
2FROM cursorDiskKV
3WHERE key LIKE 'composerDraft:%'
4AND CAST(value AS TEXT) LIKE '%keyword%';If nothing matches, try another word. Recovery depends on the prompt still being stored locally, and Cursor's database structure may change between versions.