Expand description
Cursor session reader (local SQLite blob stores).
Cursor keeps session data in two places under ~/.cursor:
ai-tracking/ai-code-tracking.db— one row per AI-authored code line, carrying themodelthat wrote it. Used to attribute each conversation to a model for theanalysisview (conversationId -> model).chats/<projectHash>/<conversationId>/store.db— a content-addressed blob store holding the whole conversation. Assistant turns live in binary protobuf DAG nodes (field 4= the message JSON,field 26= timestamp,field 5= the running context-window gauge); tool results live in standalone JSON blobs. Parsed foranalysistool-call metrics.
Cursor does not persist real billing tokens locally (only the context
gauge), so the usage view is a deliberately-rough local estimate from
that gauge (there is no dashboard-API path here; see docs/quota.md for
the raw endpoint if it is ever reintroduced), keeping Cursor consistent with
the other providers whose usage is likewise computed from local session
data.
Both entry points return the same (local YYYY-MM-DD, CodeAnalysis[, cost])
shape the OpenCode reader produces, so the usage / analysis aggregators
fold Cursor in exactly like the other providers.
Functions§
- read_
cursor_ analysis - Reads per-model file-operation metrics for Cursor from the chat stores.
- read_
cursor_ usage - Reads per-model token usage for Cursor.