# Where Cursor stores your chat and agent history

> Cursor keeps agent and chat history in a SQLite database, state.vscdb. Where it is on macOS, Windows and Linux, how to read a copy, and how to clear it.

Source: https://groundedby.com/agents/cursor (updated 2026-10-29)

Cursor is a VS Code fork, and it stores agent and chat history the way VS Code stores state: in a SQLite database, not in readable files.

## Where the database is

| System | Path |
| --- | --- |
| macOS | `~/Library/Application Support/Cursor/User/globalStorage/state.vscdb` |
| Windows | `%APPDATA%\Cursor\User\globalStorage\state.vscdb` |
| Linux | `~/.config/Cursor/User/globalStorage/state.vscdb` |

Next to it sit `state.vscdb-wal` and `state.vscdb-shm`, SQLite's write-ahead files. Each workspace has another `state.vscdb` under `workspaceStorage/<hash>/`.

Cursor's documentation does not cover any of this. The paths come from Cursor staff answers on its forum, and match what we see on a Mac.

## What is inside

Conversations live in the `cursorDiskKV` table as JSON values:

| Key prefix | What it holds |
| --- | --- |
| `composerData:<id>` | One conversation: id, created time, status, whether it was agentic, token count |
| `bubbleId:<composerId>:<bubbleId>` | One message: type, text, tool results, thinking blocks |
| `messageRequestContext:` | Context sent with a request |
| `agentKv:blob:` | Agent state |

To look, copy the database while Cursor is closed and open the copy:

```bash
cp ~/Library/Application\ Support/Cursor/User/globalStorage/state.vscdb /tmp/cursor.db
sqlite3 /tmp/cursor.db "select count(*) from cursorDiskKV where key like 'composerData:%';"
```

Never write to the live database.

## The Cursor CLI

The terminal agent, `agent`, keeps its chats separately, under `~/.cursor/chats/<workspace-hash>/<chat-id>/`.

```bash
agent ls                  # list chats
agent resume              # pick one
agent --continue          # the latest
agent --resume <chatId>
```

## Clear history

Cursor does not prune chats on its own. To clean up, open the command palette and run:

1. **Developer: Delete Old Chats…**
2. **Developer: GC Agent KV Blobs**
3. Quit Cursor fully, so the database can shrink.

Deleting a chat is permanent.

## Privacy notes

- Chat history stays on your machine and is not part of Settings Sync.
- Transcripts you share (Teams and Enterprise) and Cloud Agent runs are stored by Cursor.
- The database holds code and output the agent saw. [Redact before sharing](/guides/redact-secrets-from-agent-logs).

The groundedby [evaluator](/evaluate) does not read Cursor's database yet.

## Questions

**Where are Cursor chats saved?**

In a SQLite database called state.vscdb in Cursor's globalStorage folder - on a Mac, ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb. Each workspace also has its own state.vscdb under workspaceStorage. Cursor's docs do not describe this; the location comes from Cursor staff on its forum.

**Does Cursor sync chat history between computers?**

No. Chat history is local and not covered by Settings Sync. Transcripts you share on Teams or Enterprise plans, and Cloud Agent runs, are stored by Cursor.

**How do I clear Cursor's chat history?**

Use the command palette - "Developer - Delete Old Chats", then "Developer - GC Agent KV Blobs" - and fully quit Cursor so the database shrinks. Deleting a chat is permanent.

**Can I read the database myself?**

Yes, with any SQLite client, on a copy while Cursor is closed. Conversations are JSON values in the cursorDiskKV table under keys starting composerData and bubbleId. The layout is undocumented and can change.

## Sources

- [Cursor forum, staff answer on where chats are stored](https://forum.cursor.com/t/170297)
- [Cursor forum, staff answer on chat cleanup](https://forum.cursor.com/t/156640)
- [Cursor docs, CLI parameters](https://cursor.com/docs/cli/reference/parameters)
