A Python utility for recovering file history from the Cursor IDE's local storage. This tool helps you retrieve and organize previous versions of your code files.
- π Extracts file history from Cursor's VSCode SQLite database
- π Project-specific file filtering
- π Timestamp-based version organization
- πΎ Support for both main and backup databases
- π₯οΈ User-friendly GUI interface
- Python 3.x
- tkinter (usually comes with Python)
- macOS (currently only supports Cursor's macOS file paths)
- May work on Windows but not tested. Check paths!
pip3 install ttkwidgets # Advanced widgets for tkinter
Most other required libraries are part of Python's standard library:
os
- File and path operationsjson
- JSON data handlingsqlite3
- Database operationstempfile
- Temporary file managementshutil
- File operationstkinter
- GUI frameworkdatetime
- Date and time handlingsubprocess
- Process management
- Clone this repository:
git clone https://github.com/yourusername/cursor-recovery-tool.git
cd cursor-recovery-tool
- Make sure you have Python 3.x installed:
python3 --version
- Install required dependencies:
pip3 install -r requirements.txt
- Run the tool:
python3 cursor_recovery_ui.py
- In the GUI:
- Choose between main or backup database using the checkbox
- Click "Load Database" to load the conversation history
- (Optional) Enter a project name to filter specific files
- Click "Recover Files" to start the recovery process
- Default database:
~/Library/Application Support/Cursor/User/globalStorage/state.vscdb
- Backup database:
~/Library/Application Support/Cursor/User/globalStorage/state.vscdb.backup
- History folder:
~/Library/Application Support/Cursor/User/History/
- Recovery output:
~/CursorRecovered/final/
- Extracts conversation history from Cursor's SQLite database
- Organizes file versions by timestamp
- Filters files by project name (if specified)
- Recovers the most recent version of each file up to the selected point in time
- Always make sure to have backups of your important files
- The tool works with Cursor's default macOS file locations
- Recovered files are organized by timestamp in the output directory
Feel free to submit issues, fork the repository, and create pull requests for any improvements.