Skip to main content

Complete Guide to Managing Cursor AI Chat History

Cursor's chat history is a valuable resource that helps you maintain context and reference previous conversations with the AI. This guide will show you how to effectively manage your chat history across different machines and ensure you never lose important conversations.

Where is Chat History Stored?

Cursor stores chat history in SQLite databases using state.vscdb files. These files are located in the following directory:

  • Windows: %APPDATA%\Cursor\User\workspaceStorage
  • macOS: ~/Library/Application Support/Cursor/User/workspaceStorage
  • Linux: ~/.config/Cursor/User/workspaceStorage

Each workspace has its own database file containing all chat history for that specific workspace.

Managing Chat History

Viewing Chat History

  1. Open your workspace in Cursor
  2. Navigate to the AI Chat panel
  3. Your chat history will be displayed in chronological order
  4. Each chat session is saved as a separate tab

Exporting Chat History

To export your chat history:

  1. Navigate to the workspace storage directory
  2. Locate the state.vscdb file for your workspace
  3. Make a backup copy of this file
  4. You can use SQLite tools to view the contents:
    SELECT rowid, [key], value 
    FROM ItemTable
    WHERE [key] IN ('aiService.prompts', 'workbench.panel.aichat.view.aichat.chatdata')

Syncing Chat History Across Machines

To sync chat history between different computers:

  1. Copy the state.vscdb file from the source machine
  2. Place it in the corresponding directory on the target machine
  3. Restart Cursor to load the chat history

Best Practices

  1. Regular Backups: Make regular backups of your chat history
  2. Workspace Organization: Keep related projects in the same workspace
  3. Clean Up: Periodically review and clean up old chat history
  4. Version Control: Consider versioning your chat history for important projects

Troubleshooting

Common Issues

  1. Missing Chat History

    • Check if you're in the correct workspace
    • Verify the state.vscdb file exists
    • Restart Cursor
  2. Corrupted Chat History

    • Restore from backup
    • Create a new workspace if necessary
  3. Sync Issues

    • Ensure both machines are using the same Cursor version
    • Check file permissions

Future Developments

Cursor is working on implementing:

  • Cloud sync for chat history
  • Better export/import functionality
  • Improved chat history management tools

Conclusion

Proper management of your Cursor chat history ensures you maintain valuable context and can reference previous conversations. By following these guidelines, you can effectively manage your chat history across different machines and prevent data loss.

Remember to regularly backup your chat history and keep your workspace organized for the best experience with Cursor AI.