CodeSeshv1.5.3
Start locally

Cursor Chat History Search & Viewer (state.vscdb)

Find where Cursor stores Composer and chat history in state.vscdb on macOS, Linux, and Windows, and search or replay past Cursor conversations locally with CodeSesh.

By CodeSeshUpdated

npx codesesh --agent cursor --days 0
Explore live preview
localhost:4521dashboard-ui
globalStorage/state.vscdbSample UI
CursorRead-only index
1.8M tokens$1.14
Composer: virtualize session timeline list
19 messages · 4 files changed · Composer
editsrc/components/Timeline.tsx+42 −19

Cursor stores local Composer and chat history inside an SQLite database at globalStorage/state.vscdb under its user data directory (~/Library/Application Support/Cursor/User on macOS, ~/.config/Cursor/User on Linux, and %APPDATA%\Cursor\User on Windows). To search, browse, and replay Cursor conversations across projects in a local Web UI without querying SQLite by hand, run npx codesesh --agent cursor --days 0.

Where Cursor stores chat and Composer history

By default, Cursor keeps its local state in the OS-standard application data directory. If you export CURSOR_DATA_PATH pointing to your Cursor/User folder, CodeSesh reads from that directory instead.

  • macOS: ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb
  • Linux: ~/.config/Cursor/User/globalStorage/state.vscdb (or $XDG_CONFIG_HOME/Cursor/User/globalStorage/state.vscdb)
  • Windows: %APPDATA%\Cursor\User\globalStorage\state.vscdb

Inside state.vscdb, Cursor writes Composer sessions and message bubbles to the cursorDiskKV table under composerData:*, bubbleId:*, and bubble:* keys. Because everything is stored as JSON blobs inside SQLite rather than plain Markdown or JSONL files, grep and file search cannot read it directly.

Search and replay Cursor history with CodeSesh

Cursor lets you reopen chats inside the IDE, but searching across older workspaces, tracing tool outputs, or finding which conversation modified a specific file is difficult from the editor sidebar. CodeSesh opens state.vscdb in read-only mode, parses Composer sessions and tool calls, and builds a searchable local index on localhost.

Scan all local Cursor history:

Terminal
npx codesesh --agent cursor --days 0

Limit the view to the current repository:

Terminal
npx codesesh --agent cursor --days 0 --cwd .

In the Web UI at http://localhost:4521, you can:

  • Search across repositories: Match prompts, assistant replies, tool outputs, and touched file paths across every Cursor workspace in one query.
  • Replay tool calls and edits: Read messages and tool results in sequence without modifying state.vscdb or reopening old Cursor windows.
  • Combine with terminal agents: Drop --agent cursor to browse Cursor history alongside Claude Code, Codex, OpenCode, and Gemini CLI in the same project tree.

Cursor is a desktop IDE and does not expose a CLI session resume flag, so CodeSesh displays history for reading and search without generating a terminal resume command.

Troubleshoot missing Cursor chats

  • Pass --days 0. Plain npx codesesh defaults to the last 7 local calendar days. Pass --days 0 or switch the UI time range to All to view older Cursor conversations.
  • Check CURSOR_DATA_PATH. If Cursor stores its user data in a custom profile or portable directory, export CURSOR_DATA_PATH pointing to the User directory that contains globalStorage/state.vscdb.
  • Check token and cost fields. Cursor records partial token counts on some sessions; when model and token counts are present, CodeSesh estimates costs locally without uploading session content.

For terminal-based agents, see the Claude Code session history guide, Codex session history guide, or the cross-agent session history overview.

Keep Cursor data safe and export when needed

CodeSesh always opens state.vscdb in read-only mode and never writes to Cursor’s database. If you want a long-term backup before reinstalling or clearing Cursor storage, close Cursor and copy the Cursor/User/globalStorage/state.vscdb file directly. CodeSesh focuses on local search, replay, and usage review; if you need to export Cursor chats into standalone files for sharing or archiving, use Agent Dump.

Browse your local history in one Web UI

MIT open source and read-only on your machine. Search conversations, tool calls, file changes, and token costs with one command.

Explore live preview

Installation method

npx codesesh@latest

macOS / Linux / Windows · Node.js 22+

Frequently asked questions

Where does Cursor store chat and Composer history?

Cursor stores local chat and Composer sessions inside globalStorage/state.vscdb under ~/Library/Application Support/Cursor/User on macOS, ~/.config/Cursor/User on Linux, and %APPDATA%\Cursor\User on Windows. Export CURSOR_DATA_PATH if you use a custom data directory.

How do I search Cursor chat history across projects?

Run npx codesesh --agent cursor --days 0. CodeSesh reads Cursor's state.vscdb in read-only mode, parses Composer conversations and tool calls, and lets you search prompts, replies, tool outputs, and file paths across all workspaces in a local Web UI.

Does CodeSesh modify Cursor's state.vscdb database?

No. CodeSesh opens globalStorage/state.vscdb strictly in read-only mode and writes its search index to a separate local SQLite database. Your Cursor editor data is never altered.

Can I view Cursor history together with Claude Code and Codex?

Yes. Run npx codesesh --days 0 without the --agent flag to index Cursor alongside Claude Code, Codex, OpenCode, Gemini CLI, and all other supported local agents in one project-aware timeline.

Browse all guides