cd /news/developer-tools/how-to-search-cursor-chat-history-ac… · home topics developer-tools article
[ARTICLE · art-124051] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

How to Search Cursor Chat History Across Workspaces

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.

by read3 min views2 publishedSep 9, 2026

Originally published on Extracurricular AI.

You remember fixing the authentication bug. You cannot remember which project contained the conversation.

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.

npm install -g cursor-history
cursor-history list --all
cursor-history search "connection pool"

Run 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.”

Try a distinctive substring if a broad query returns too much:

cursor-history search "ECONNRESET" -n 30
cursor-history search "oauth callback"
cursor-history search "refreshToken"

Search 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.

For interactive use, copy the session index displayed in the result. If it is 12:

cursor-history show 12
cursor-history export 12

The 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.

With jq installed, retrieve those UUIDs directly:

cursor-history search "authentication" --json   | jq -r '.results[].sessionId'

Copy a returned ID into these commands, replacing the placeholder:

session_id='PASTE_RETURNED_SESSION_UUID'
cursor-history show "$session_id"
cursor-history export "$session_id" --format json --output ./conversation.json

The JSON export contains the available session representation. It may include source details and inferred timestamps; it is not proof of a complete original conversation.

Keep the same scope on the follow-up read:

cursor-history --workspace /absolute/path/to/project search "authentication"
cursor-history --workspace /absolute/path/to/project show 1

Here 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.

Check Why it matters
Try a shorter phrase or exact error token Text search does not paraphrase the query
Run cursor-history list --all --json Inspect discovered sessions and any diagnostics
Check which machine and user account owns the files Local search does not fetch SSH, cloud, or another user's history
Check custom roots or WSL paths Composer data and ~/.cursor can live in different environments
Review source status Missing, partial, or ambiguous sources can affect what is searchable

For an explicit environment, set both roots to the intended directories:

CURSOR_DATA_PATH='/absolute/path/to/Cursor/User/workspaceStorage' CURSOR_STORE_ROOT='/absolute/path/to/.cursor' cursor-history search "authentication"

The platform guide 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.

To continue an Agent CLI conversation, start with Cursor's native session commands. This workflow is useful when you need to locate text across local conversations and then inspect or export the result.

The MCP companion 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.

If the search finds something useful, keep cursor-history on GitHub. For moved projects, continue with the recovery guide.

Implementation references: search traversal, text matcher, CLI JSON formatter.

── more in #developer-tools 4 stories · sorted by recency
── more on @cursor-history 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-search-cursor…] indexed:0 read:3min 2026-09-09 ·