docs/cursor.md
Cursor is primarily web-backed. Usage is fetched via browser cookies, with legacy stored-session cookies and Cursor.app local auth as fallbacks.
Cached cookie header (preferred)
com.steipete.codexbar.cache (account cookie.cursor).Browser cookie import
cursor.com, cursor.sh.WorkosCursorSessionToken__Secure-next-auth.session-tokennext-auth.session-tokenStored session cookies (fallback)
~/Library/Application Support/CodexBar/cursor-session.json.Cursor.app local auth (last fallback)
~/Library/Application Support/Cursor/User/globalStorage/state.vscdb$XDG_CONFIG_HOME/Cursor/User/globalStorage/state.vscdb (default ~/.config/Cursor/...)Manual option:
Cookie: header from a cursor.com request.https://authenticator.cursor.sh/ in a supported browser.GET https://cursor.com/api/usage-summary
GET https://cursor.com/api/auth/me
GET https://cursor.com/api/usage?user=ID
~/Library/Cookies/Cookies.binarycookies~/Library/Application Support/Google/Chrome/*/Cookies~/Library/Application Support/Firefox/Profiles/*/cookies.sqlitecodexbar usage --provider cursor reads the signed-in Cursor app's access token from the Linux global state DB and reuses the same cursor.com usage endpoints as macOS.~/.config/codexbar/config.json (or legacy ~/.codexbar/config.json) work on Linux.When Settings → Advanced → Track provider local storage is enabled on macOS, CodexBar measures:
~/Library/Application Support/Cursor~/Library/Application Support/Caches/cursor-updater~/.cursor~/Library/Caches/Cursor~/Library/Caches/com.todesktop.230313mzl4w4u92~/Library/Caches/com.todesktop.230313mzl4w4u92.ShipIt~/Library/Caches/cursor-compile-cache~/Library/HTTPStorages/com.todesktop.230313mzl4w4u92The storage detail lists measured paths and their sizes. CodexBar does not delete Cursor data.
The cost summary's Cursor section is opt-in: it only fetches when Show cost summary is enabled and the Cursor provider is on. Unlike Claude and Codex cost (scanned from local session logs on this machine), Cursor cost is remote, account-wide data from the cursor.com dashboard, so it covers usage from every machine on the account.
Auth reuses the exact status-probe session resolution and cookie-source policy:
codexbar cost --provider cursor fails explicitly and /cost returns a provider error row.Fetch behavior:
POST https://cursor.com/api/dashboard/get-filtered-usage-events (cookie-authenticated; requires a matching Origin for CSRF).Two totals are reported from the same events:
tokenUsage cents, aggregated per day/model (comparable to the Claude/Codex estimates).meteredCostUSD): what Cursor's plan actually deducts over the window, shown as its own "Cursor-metered:" line.Caching: the app holds the snapshot for an in-memory hourly TTL, keyed by the history window plus the cookie source and resolved account (manual-cookie hash or auto-mode account fingerprint), so switching accounts or pasting a new cookie invalidates it immediately.
Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swiftSources/CodexBar/CursorLoginRunner.swift (login flow)Sources/CodexBar/Providers/Cursor/CursorLoginFlow.swift (menu integration)Sources/CodexBar/CursorLoginBrowserRouter.swift (browser routing and selection)