--- title: Cursor description: How ClawMetry observes Cursor — where its data lives, the environment variables that move it, what cost data is real, and the traps in its store. eyebrow: Runtime reference --- # Cursor Cursor keeps chat in a VS Code-style SQLite key-value store, and its modern Agent mode writes a separate JSONL transcript under the home directory. ClawMetry reads both, because either one alone leaves a live session looking empty. | | | |---|---| | **Runtime id** | `cursor` | | **Category** | AI IDE (editor + CLI) | | **Vendor** | Anysphere | | **Tier** | Paid tier (Starter and up) | | **Upstream** | [cursor.com](https://cursor.com) | ## Where the data comes from ClawMetry reads these locations, in order, and never writes to any of them. - `~/Library/Application Support/Cursor/User/globalStorage/state.vscdb` — primary (Linux: ~/.config/Cursor/…) - `…/workspaceStorage//state.vscdb` — older per-workspace layout - `~/.cursor/projects//agent-transcripts//.jsonl` — Agent mode transcripts **Format.** SQLite `cursorDiskKV` rows (`composerData:`, `bubbleId::`) plus Anthropic-shaped JSONL for Agent sessions. ## Environment variables | Variable | Effect | |---|---| | `CLAWMETRY_CURSOR_DB` | point at a specific state.vscdb | | `CLAWMETRY_CURSOR_AGENT_ROOT` | Agent-transcript root override | | `CLAWMETRY_CURSOR_CHATS_ROOT` | chat root override | See [Environment variables](/docs/config/environment/) for the variables that apply to every runtime. ## Tokens and cost **Tokens.** Cursor's `tokenCount` hint is not a billed total, and the backend is proprietary. On hosted VMs the loopback usage log is the only real token source. **Cost.** Not on disk. Cursor is one of two runtimes on the token-blind allowlist for the hosted-VM usage log, which is why a Cursor row can show real cost on a managed node and none on a laptop. :::note Why this section exists Runtimes differ enormously in what they persist. Rather than showing a plausible number everywhere, ClawMetry reports what the store actually contains and marks the rest unknown. A cost of `$0.00` and a cost of *unknown* mean different things, and the dashboard keeps them different. ::: ## Sub-agents and delegation Sub-agent transcripts live under a `subagents/` subtree of the session directory; the primary transcript is exactly `/.jsonl`. ## Things worth knowing - Cursor is usually running, so recent writes sit in the `state.vscdb-wal` sidecar. Opening the database with `immutable=1` skips the WAL and returns a stale or empty view. - A Cursor **CLI** session is a real process tree and can be paused or stopped. A Cursor **editor** conversation shares the one IDE process and cannot — the Guard tab says so per session rather than refusing the whole runtime. - Agent-mode records carry no per-line timestamp; ClawMetry falls back to file mtime and offsets each message by a millisecond to keep order. ## Verify it is being read ```bash # Is this runtime detected, and would this install unlock it? clawmetry runtimes --json | jq '.runtimes[] | select(.id=="cursor")' # Why is it locked, if it is? clawmetry runtimes --why cursor # Any sessions ingested yet? curl -s 'http://localhost:8900/api/local/sessions?limit=5' \ | jq '.rows[] | {session_id, agent_id, events, cost_usd}' ``` If detection succeeds but no sessions appear, work through [Troubleshooting](/docs/ops/troubleshooting/) — the usual causes are a relocated data directory (set the override above), a session limit that is hiding older runs, or a runtime that simply has not written anything yet.