GitShow/ofershap/cursor-usage-tracker
ofershap

cursor-usage-tracker

Monitor Cursor IDE usage, detect spending anomalies, and alert your team. Self-hosted, open-source.

by ofershap
aiai-costsanomaly-detectioncursorcursor-ideenterprisenextjsopen-source
Star on GitHubForknpm

TypeScript

30 stars10 forks2 contributorsActive · 1mo agoSince 2026v1.24.0MIT

Meet the team

See all 2 on GitHub →
ofershap
ofershap69 contributions
dependabot[bot]Bot
dependabot[bot]8 contributions

Languages

View on GitHub →
TypeScript99.3%
JavaScript0.3%
CSS0.2%
Dockerfile0.1%

Commit activity

Last 12 weeks · 3 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · 1 in progress · Last activity 1mo ago
See all on GitHub →
Sebastien-Meiffren
collect fails on /teams/spend: NOT NULL on included_spend_cents + wrong spend amounts (API shape changed)OpenIssue

Summary Running fails to persist spending data because Cursor's API response shape has changed. Two related issues: 1. The endpoint no longer returns , causing a SQLite constraint violation. 2. The endpoint now returns for users under their plan limit and exposes the actual cycle total in a new field, . As a result, even after working around the constraint error, all stored spend values would be . Reproduction Output: is reported, while every other collector (daily usage, groups, usage events, analytics) succeeds. Root cause A live response from (page 1, pageSize 3) currently looks like: Differences from what the codebase expects (see in and in ): — no longer present. The collector binds , which better-sqlite3 sends as , hitting . — semantics appear to have changed. It now seems to represent the overage above the plan-included amount, and is for everyone within plan. — new field. Represents the cycle-to-date total (what the dashboard previously showed as ). New fields seen on members: , . Suggested fix In , normalize the response so the rest of the pipeline keeps working: (total cycle spend) (or if not derivable) Defensive / in bindings as a belt-and-suspenders fix against future schema changes. Update and to document the new fields and the new semantics of . The API reference in should also be refreshed — it currently lists only for this endpoint. Environment Branch: @ Node / SQLite: better-sqlite3 Team size in repro: 50 members, 17 spend pages

Sebastien-Meiffren · 1mo ago

Recent fixes

View closed PRs →
mcobery
fix: update /teams/spend API response handling and normalization (Issue 19)MergedPR

Enhanced the /teams/spend endpoint response structure to include new fields: overallSpendCents, totalMembers, limitedUsersCount, and maxUserSpendCents. Updated the normalizeMemberSpend function to accommodate the new API shape, ensuring backward compatibility with pre-2026 data. Added defensive defaults in the SQLite upsert function to prevent crashes due to missing fields. Implemented tests to verify the normalization of both pre-2026 and post-2026 API shapes. Addresses issue #19.

mcobery · 3w ago
Structured data for AI agents

Repository: ofershap/cursor-usage-tracker. Description: Monitor Cursor IDE usage, detect spending anomalies, and alert your team. Self-hosted, open-source. Stars: 30, Forks: 10. Primary language: TypeScript. Languages: TypeScript (99.3%), JavaScript (0.3%), CSS (0.2%), Dockerfile (0.1%). License: MIT. Topics: ai, ai-costs, anomaly-detection, cursor, cursor-ide, enterprise, nextjs, open-source, slack-alerts, sqlite, typescript, usage-monitoring. Latest release: v1.24.0 (3mo ago). Open PRs: 1, open issues: 1. Last activity: 1mo ago. Community health: 85%. Top contributors: ofershap, dependabot[bot].

·@ofershap

Replace github.com with gitshow.dev