How to Search Cursor Chat History Across Workspaces
说明与用途
用户可以使用简单的 CLI 命令快速定位并导出 Cursor 在不同工作区中的特定聊天会话,无需 API 密钥。
问题
Need to locate a specific conversation across multiple Cursor workspaces when the project name is forgotten.
结果
Users can efficiently locate and export specific Cursor chat sessions across multiple workspaces using simple CLI commands, without needing API keys or embeddings.
工作流
- Install cursor-history globally via npm
- Run
cursor-history list --allto discover workspaces - Search with a remembered phrase:
cursor-history search "connection pool" - Adjust query to a distinctive substring if results are too many
- Use
-nflag to change result limit - Open a matching session with
cursor-history show <index>orcursor-history export <sessionId> - Export session to JSON with
--format json --output ./conversation.json - If workspace known, narrow search with
--workspace /path/to/project - If no matches, try shorter phrase, run
cursor-history list --all --json, check file ownership, custom roots, WSL paths, and source status - Set environment variables
CURSOR_DATA_PATHandCURSOR_STORE_ROOTfor explicit directories - Use Cursor native session commands for continued Agent CLI conversations
- Consider MCP companion for assistant-driven search
- Keep cursor-history on GitHub for future use
- Refer to recovery guide for moved projects
证据
cursor-history searches conversation text in supported local Cursor stores across discovered workspaces.
It can read history created before you installed it, without a capture hook, embeddings, or an API key.
Search returns up to 10 matching sessions by default. -n 30 raises the limit; -n 0 returns all matching sessions.
- 记录日期: 2026-09-15T07:31:27.622Z