docs/cursor.md
On macOS, Cursor can reuse Cursor.app's local session or a cursor.com browser session. Automatic mode prefers a usable Cursor.app session and falls back to cookies when the app token is missing, expired, invalid, or rejected.
Cursor.app local auth (preferred in Automatic mode)
ItemTable key cursorAuth/accessToken.~/Library/Application Support/Cursor/User/globalStorage/state.vscdbstate.vscdb-wal and state.vscdb-shm~/Library/Application Support/CodexBar/cursor-session.json through the standard credential-file writer.Cached cookie header
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.On macOS, explicit --source web skips Cursor.app local auth and uses only the cookie ladder. A configured Manual cookie
header remains an explicit override. codexbar usage --provider cursor --source auto --verbose prints the selected
automatic path and is the quickest live-read check after Cursor login.
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.sqlite~/.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/CursorAppAuth.swiftSources/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)