{"slug": "how-to-search-cursor-chat-history-across-workspaces", "title": "How to Search Cursor Chat History Across Workspaces", "summary": "A developer has released cursor-history, a command-line tool that searches Cursor chat history across workspaces by reading local data stores without requiring an API key or capture hooks. The tool supports text-based search, session listing, and JSON export, and can be used interactively or via an MCP companion for AI assistants.", "body_md": "*Originally published on [Extracurricular AI](https://extracurricular.ai/en/blog/search-cursor-chat-history/).*\n\nYou remember fixing the authentication bug. You cannot remember which project contained the conversation.\n\n`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.\n\n```\nnpm install -g cursor-history\ncursor-history list --all\ncursor-history search \"connection pool\"\n```\n\nRun this on the machine where the history is stored, using Node.js 20.x or 22.x–26.x. The CLI searches parsed message content using case-insensitive text matching. It does not semantically infer that “database saturation” means “connection pool.”\n\nTry a distinctive substring if a broad query returns too much:\n\n```\ncursor-history search \"ECONNRESET\" -n 30\ncursor-history search \"oauth callback\"\ncursor-history search \"refreshToken\"\n```\n\nSearch returns up to 10 matching sessions by default. `-n 30` raises the limit; `-n 0` returns all matching sessions. `list --all` removes the listing limit; it is not a switch that enables global search. Search covers discovered workspaces by default unless you select a workspace.\n\nFor interactive use, copy the session index displayed in the result. If it is `12`:\n\n```\ncursor-history show 12\ncursor-history export 12\n```\n\nThe number refers to the underlying session list within the same data roots and workspace scope. It is not the search result's ordinal position. New sessions can also change list indices, so use exact UUIDs for saved commands.\n\nWith `jq` installed, retrieve those UUIDs directly:\n\n```\ncursor-history search \"authentication\" --json   | jq -r '.results[].sessionId'\n```\n\nCopy a returned ID into these commands, replacing the placeholder:\n\n```\nsession_id='PASTE_RETURNED_SESSION_UUID'\ncursor-history show \"$session_id\"\ncursor-history export \"$session_id\" --format json --output ./conversation.json\n```\n\nThe JSON export contains the available session representation. It may include source details and inferred timestamps; it is not proof of a complete original conversation.\n\nKeep the same scope on the follow-up read:\n\n```\ncursor-history --workspace /absolute/path/to/project search \"authentication\"\ncursor-history --workspace /absolute/path/to/project show 1\n```\n\nHere `1` means session 1 in that workspace's list. Do not reuse a global index in a workspace-scoped read. A workspace filter also limits which conversation sources may be opened; it is more than a display filter.\n\n| Check | Why it matters | \n|---|---|\n| Try a shorter phrase or exact error token | Text search does not paraphrase the query | \n| Run `cursor-history list --all --json` | Inspect discovered sessions and any diagnostics | \n| Check which machine and user account owns the files | Local search does not fetch SSH, cloud, or another user's history | \n| Check custom roots or WSL paths | Composer data and `~/.cursor` can live in different environments | \n| Review source status | Missing, partial, or ambiguous sources can affect what is searchable | \n\nFor an explicit environment, set both roots to the intended directories:\n\n```\nCURSOR_DATA_PATH='/absolute/path/to/Cursor/User/workspaceStorage' CURSOR_STORE_ROOT='/absolute/path/to/.cursor' cursor-history search \"authentication\"\n```\n\nThe [platform guide](https://github.com/S2thend/cursor-history#where-cursor-stores-data) explains these selectors. An empty result means no match was returned from the readable selected sources; it does not prove that a chat was deleted.\n\nTo continue an Agent CLI conversation, start with Cursor's [native session commands](https://cursor.com/docs/cli/reference/parameters). This workflow is useful when you need to locate text across local conversations and then inspect or export the result.\n\nThe [MCP companion](https://github.com/S2thend/cursor-history-mcp#quick-start) can let an assistant perform the search. As checked on September 8, 2026, MCP 0.3.1 uses reader 0.18.0. The packages release independently, so update the MCP package when upgrading the server.\n\nIf the search finds something useful, [keep cursor-history on GitHub](https://github.com/S2thend/cursor-history). For moved projects, continue with [the recovery guide](https://extracurricular.ai/en/blog/recover-moved-cursor-project-chats/).\n\nImplementation references: [search traversal](https://github.com/S2thend/cursor-history/blob/3558ed86842d0beec8660abbb955ec9910720bc1/src/core/storage.ts), [text matcher](https://github.com/S2thend/cursor-history/blob/3558ed86842d0beec8660abbb955ec9910720bc1/src/core/parser.ts), [CLI JSON formatter](https://github.com/S2thend/cursor-history/blob/3558ed86842d0beec8660abbb955ec9910720bc1/src/cli/formatters/json.ts).", "url": "https://wpnews.pro/news/how-to-search-cursor-chat-history-across-workspaces", "canonical_source": "https://dev.to/s2thend/how-to-search-cursor-chat-history-across-workspaces-md1", "published_at": "2026-09-09 02:08:55+00:00", "updated_at": "2026-09-09 02:19:17.293767+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["cursor-history", "Cursor", "Extracurricular AI", "Node.js"], "alternates": {"html": "https://wpnews.pro/news/how-to-search-cursor-chat-history-across-workspaces", "markdown": "https://wpnews.pro/news/how-to-search-cursor-chat-history-across-workspaces.md", "text": "https://wpnews.pro/news/how-to-search-cursor-chat-history-across-workspaces.txt", "jsonld": "https://wpnews.pro/news/how-to-search-cursor-chat-history-across-workspaces.jsonld"}}