Skip to content

A web application for browsing and managing chat histories from the Cursor editor's AI chat feature.

Notifications You must be signed in to change notification settings

mfiasche/cursor-chat-browser

Repository files navigation

Cursor Chat Browser

A secure, local web application for browsing and managing chat histories from the Cursor editor's AI chat feature on macOS. View, search, export, backup, restore, and delete your AI conversations.

⚠️ macOS Only - This application is designed exclusively for macOS.

Features

  • 🔍 Browse and search all workspaces with Cursor chat history
  • 🌐 Support for both workspace-specific and global storage (newer Cursor versions)
  • 🤖 View both AI chat logs and Composer logs
  • 📁 Organize chats by workspace
  • 🔎 Full-text search with filters for chat/composer logs
  • 📱 Responsive design with dark/light mode support
  • ⬇️ Export chats as:
    • Markdown files
    • HTML documents (with syntax highlighting)
    • PDF documents
  • 💾 Full Backup & Restore - Complete workspace folder backups as ZIP archives
  • 🗑️ Delete conversations and projects with confirmation dialogs
  • 🎨 Syntax highlighted code blocks
  • 📌 Bookmarkable chat URLs
  • ⚙️ Automatic workspace path detection
  • 🔒 Secure by default - runs only on localhost

Security

This application is designed with security in mind:

  • Localhost-only binding - The server binds exclusively to 127.0.0.1, preventing network access
  • Confirmation dialogs - All delete operations require explicit confirmation to prevent accidental data loss
  • Path validation - Custom workspace paths are validated to prevent directory traversal attacks
  • Security headers - Includes X-Frame-Options and X-Content-Type-Options headers
  • No external connections - Your data never leaves your machine

Prerequisites

  • macOS
  • Node.js 18+ and npm
  • A Cursor editor installation with chat history

Installation

  1. Clone the repository:
cd cursor-chat-browser
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev
  1. Open http://localhost:3000 in your browser

Configuration

The application automatically detects your Cursor workspace storage location:

~/Library/Application Support/Cursor/User/workspaceStorage

If automatic detection fails, you can manually set the path in the Configuration page (⚙️).

Note: Recent versions of Cursor have moved chat data storage from workspace-specific locations to global storage. This application supports both storage methods to ensure compatibility with all Cursor versions.

Usage

Browsing Logs

  • View all workspaces on the home page
  • Browse AI chat logs by workspace
  • Access Composer logs from the navigation menu
  • Navigate between different chat tabs within a workspace
  • View combined logs with type indicators
  • See chat and composer counts per workspace

Searching

  • Use the search bar in the navigation to search across all logs
  • Filter results by chat logs, composer logs, or both
  • Search results show:
    • Type badge (Chat/Composer)
    • Matching text snippets
    • Workspace location
    • Title
    • Timestamp

Exporting

Each log can be exported as:

  • Markdown: Plain text with code blocks
  • HTML: Styled document with syntax highlighting
  • PDF: Formatted document suitable for sharing

Backup & Restore

The application supports full backup and restore of your Cursor workspace folders as ZIP archives. This creates a complete copy of the workspace folder that can be restored later.

Creating Backups

  1. On the home page, find the project you want to backup
  2. Click the ⬇️ (download) icon next to the project
  3. A ZIP file will be downloaded with the project name, e.g., MyProject-backup-2025-12-18.zip

What's included in the backup:

  • state.vscdb - Local workspace database with conversations
  • state.vscdb.backup - Database backup file (if exists)
  • workspace.json - Workspace configuration (project path reference)
  • Extension folders (e.g., anysphere.cursor-extension/, anysphere.cursor-retrieval/)

Restoring from Backup

  1. On the home page, find the "Restore from Backup" section at the top
  2. Click "Select Backup File"
  3. Choose a previously exported .zip backup file
  4. The application will extract and restore the complete workspace folder

Important Notes:

  • Workspaces that already exist will be skipped (not overwritten) to prevent data loss
  • The restore count shows how many workspaces were actually restored
  • After restoring, refresh the page to see the restored projects

Deleting Conversations & Projects

⚠️ Warning: Delete operations are permanent and cannot be undone.

💡 Tip: Always create a backup before deleting important data!

Delete Individual Conversations

  1. Navigate to a project/workspace
  2. Click the 🗑️ trash icon next to any conversation in the sidebar
  3. Confirm the deletion in the dialog

Delete Entire Projects

  1. On the home page, click the 🗑️ trash icon next to any project
  2. Review the warning showing how many conversations will be deleted
  3. Confirm the deletion in the dialog

All deletions include a confirmation dialog to prevent accidental data loss.

Development

Built with:

  • Next.js 14 (App Router)
  • TypeScript
  • Tailwind CSS
  • shadcn/ui components
  • better-sqlite3 for reading/writing Cursor's chat database
  • archiver for creating ZIP backups
  • adm-zip for extracting ZIP backups

Scripts

Command Description
npm run dev Start development server (localhost only)
npm run build Build for production
npm run start Start production server (localhost only)
npm run lint Run ESLint

API Endpoints

Endpoint Method Description
/api/workspaces GET List all workspaces with conversation counts
/api/workspaces/[id] GET Get workspace details
/api/workspaces/[id]/tabs GET Get conversations for a workspace
/api/workspaces/[id]/delete DELETE Delete a workspace and all its conversations
/api/conversations/[id] DELETE Delete a single conversation
/api/backup/workspace/[id] GET Download a workspace backup (ZIP)
/api/restore POST Restore workspace from a ZIP backup file
/api/search GET Search across all conversations

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Changelog

See CHANGELOG.md for a list of changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

A web application for browsing and managing chat histories from the Cursor editor's AI chat feature.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors