You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are rolling out codeburn for agentic coding tracking for our developer population and have feedback from many of them that the numbers shown are not accurate.
I tested this morning and codeburn is definitely not picking up all usage.
We use Cursor as the coding tool, and most of our devs use macbooks.
Test evidence:
Cursor token usage screenshot from admin portal for the current user (Millions of tokens shown):
Codeburn daily usage screen for the current user (thousands of tokens shown):
Thanks again for the clear report, the screenshots made this easy to chase. Here's the honest picture, plus a branch to test.
What's happening: Cursor stores each chat in a local SQLite DB, but on current builds the per-message token count is written as {input: 0, output: 0}. So codeburn was estimating Cursor tokens rather than reading them, which is why the numbers came in low.
Cursor does record its own tokenizer-accurate context size per conversation in composerData.promptTokenBreakdown (the number behind the in-app context-window bar). codeburn just wasn't reading it.
The honest limit: we searched the entire local Cursor footprint (global and per-workspace state.vscdb, ai-code-tracking.db, logs, LevelDB, ~/.cursor). The exact billed figures are not stored on disk anywhere. Only the input/context count is local; output tokens, cache tokens, and the cumulative-per-turn total your admin portal bills are computed server-side and never written locally. That is inherent to usage-based billing.
Input tokens now come from promptTokenBreakdown instead of an estimate. On a test machine, one day's Cursor input went from ~44.9k to ~168.5k tokens, matching the real per-conversation context.
Tools + bash: codeburn now surfaces the agent's tool calls (Read, Grep, Glob, Shell) and the actual shell commands it ran, pulled from the local agent log.
Pricing:composer-2.5 was missing a price mapping (showed $0); it is now priced like composer-2.
It gets much closer but will not match the portal exactly: it is the latest context snapshot (not cumulative-per-turn), output stays a reply-text estimate, and cache tokens are not on disk.
You can check the real on-disk context total yourself (read-only, no chat content):
DB="$HOME/Library/Application Support/Cursor/User/globalStorage/state.vscdb"
sqlite3 "$DB""SELECT COALESCE(SUM(CAST(json_extract(value,'$.promptTokenBreakdown.totalUsedTokens') AS INT)),0) FROM cursorDiskKV WHERE key LIKE 'composerData:%';"
Question for you: to match your admin portal exactly, the only path is reading Cursor's Team/Admin API with an API key. That is opt-in, since it leaves the machine, unlike everything else codeburn does locally. You are rolling this out to a developer population and already have admin access, so would an opt-in Cursor API-key integration be worth it for you? If yes, we will build it. If the local improvement above is close enough, we will keep it local-first.
Either way, please try the #575 branch and let us know how the numbers compare to your portal.
For token amount mismatches, it would help to split the report by source of truth: provider usage API, local transcript tokenization, or normalized model family totals. If the issue is that some providers report cached/input/output/reasoning tokens differently, a small table with raw provider payload versus Codeburn's displayed totals would make it much easier to see where the conversion is drifting.
@hiSandog this is exactly the right instinct, and it's now built: codeburn audit (#578).
It prints a per-(provider, model) table of the raw token fields each provider records next to what codeburn displays and prices, so any drift is visible in one place:
One small adjustment to the framing: codeburn is local-first, so for most providers the "source of truth" isn't a usage API, it's the provider's own usage object recorded in the local transcript. Cursor is the exception (no real per-token on disk, so it estimates). The audit makes both modes' conversions explicit: reasoning folding into output, cache read = max(Anthropic cacheReadInput, OpenAI cached), and the 1.25x / 0.1x cache multipliers, which is where most "the numbers look off" reports actually trace back to.
Is this what you had in mind? Happy to add a per-call mode or more columns if you want it more granular.
Closing as completed. The fixable half of this landed the week it was reported: #575 switched pricing to Cursor's real context tokens (merged Jul 2, after your branch feedback was addressed) and #578 shipped codeburn audit, which prints per-(provider, model) raw token fields next to what codeburn displays, so any drift is inspectable on your own data. What remains is a Cursor-side data limitation, documented in #861: the local DB carries no cache-read tokens, no Tab/autocomplete usage, and a context-window snapshot rather than a cumulative sum, so full parity with the subscription dashboard is not reachable from local data. If codeburn audit on a current build still shows drift that codeburn itself could fix, please reopen with its output.
@Joon, you were the first person here to describe a whole team on Cursor and ask for per-developer tracking across it. That is now the thing we are building: CodeBurn Teams, every plan and every tool in one number, cost per merged PR, where the budget leaks, what worked and whether it spread, with nothing but aggregates leaving a machine. The CLI stays free; Teams is the paid part, and the beta costs nothing. Since your team is already running it, I would like your answer to one question: what do you use today to see the team's spend, and what does it miss? https://codeburn.app/teams
Activity
iamtoruk commentedon Jun 29, 2026
Thanks again for the clear report, the screenshots made this easy to chase. Here's the honest picture, plus a branch to test.
What's happening: Cursor stores each chat in a local SQLite DB, but on current builds the per-message token count is written as
{input: 0, output: 0}. So codeburn was estimating Cursor tokens rather than reading them, which is why the numbers came in low.Cursor does record its own tokenizer-accurate context size per conversation in
composerData.promptTokenBreakdown(the number behind the in-app context-window bar). codeburn just wasn't reading it.The honest limit: we searched the entire local Cursor footprint (global and per-workspace
state.vscdb,ai-code-tracking.db, logs, LevelDB,~/.cursor). The exact billed figures are not stored on disk anywhere. Only the input/context count is local; output tokens, cache tokens, and the cumulative-per-turn total your admin portal bills are computed server-side and never written locally. That is inherent to usage-based billing.What we changed (branch in #575, draft):
promptTokenBreakdowninstead of an estimate. On a test machine, one day's Cursor input went from ~44.9k to ~168.5k tokens, matching the real per-conversation context.composer-2.5was missing a price mapping (showed $0); it is now priced likecomposer-2.It gets much closer but will not match the portal exactly: it is the latest context snapshot (not cumulative-per-turn), output stays a reply-text estimate, and cache tokens are not on disk.
You can check the real on-disk context total yourself (read-only, no chat content):
Question for you: to match your admin portal exactly, the only path is reading Cursor's Team/Admin API with an API key. That is opt-in, since it leaves the machine, unlike everything else codeburn does locally. You are rolling this out to a developer population and already have admin access, so would an opt-in Cursor API-key integration be worth it for you? If yes, we will build it. If the local improvement above is close enough, we will keep it local-first.
Either way, please try the #575 branch and let us know how the numbers compare to your portal.
hiSandog commentedon Jun 30, 2026
For token amount mismatches, it would help to split the report by source of truth: provider usage API, local transcript tokenization, or normalized model family totals. If the issue is that some providers report cached/input/output/reasoning tokens differently, a small table with raw provider payload versus Codeburn's displayed totals would make it much easier to see where the conversion is drifting.
iamtoruk commentedon Jun 30, 2026
@hiSandog this is exactly the right instinct, and it's now built:
codeburn audit(#578).It prints a per-(provider, model) table of the raw token fields each provider records next to what codeburn displays and prices, so any drift is visible in one place:
--format jsonadds the conversion detail you asked for: the per-component cost, the exact rates applied, and both raw cache-read fields.One small adjustment to the framing: codeburn is local-first, so for most providers the "source of truth" isn't a usage API, it's the provider's own usage object recorded in the local transcript. Cursor is the exception (no real per-token on disk, so it estimates). The audit makes both modes' conversions explicit: reasoning folding into output, cache read = max(Anthropic
cacheReadInput, OpenAIcached), and the 1.25x / 0.1x cache multipliers, which is where most "the numbers look off" reports actually trace back to.Is this what you had in mind? Happy to add a per-call mode or more columns if you want it more granular.
Joon commentedon Jun 30, 2026
This is awesome team, thank you so much! I will test this branch today
Joon commentedon Jun 30, 2026
Tested and it's not working (or I tested incorrectly)
I left detailed comments with screenshots in the PR #575
fix(cursor): use Cursor's real context tokens for input (#574) (#575)
ozymandiashh commentedon Aug 3, 2026
Closing as completed. The fixable half of this landed the week it was reported: #575 switched pricing to Cursor's real context tokens (merged Jul 2, after your branch feedback was addressed) and #578 shipped
codeburn audit, which prints per-(provider, model) raw token fields next to what codeburn displays, so any drift is inspectable on your own data. What remains is a Cursor-side data limitation, documented in #861: the local DB carries no cache-read tokens, no Tab/autocomplete usage, and a context-window snapshot rather than a cumulative sum, so full parity with the subscription dashboard is not reachable from local data. Ifcodeburn auditon a current build still shows drift that codeburn itself could fix, please reopen with its output.iamtoruk commentedon Sep 14, 2026
@Joon, you were the first person here to describe a whole team on Cursor and ask for per-developer tracking across it. That is now the thing we are building: CodeBurn Teams, every plan and every tool in one number, cost per merged PR, where the budget leaks, what worked and whether it spread, with nothing but aggregates leaving a machine. The CLI stays free; Teams is the paid part, and the beta costs nothing. Since your team is already running it, I would like your answer to one question: what do you use today to see the team's spend, and what does it miss? https://codeburn.app/teams