Skip to content

Issue: Cursor Cost Tracking Not working #159

Closed

Description

@CarlvinceTan

Currently it incorrectly shows:
Image

When there definitely has been usage:
Image

Activity

  1. self-assigned this
    on Apr 27, 2026
  2. iamtoruk commented on Apr 27, 2026

    @iamtoruk
    Member

    On it

  3. iamtoruk commented on Apr 27, 2026

    @iamtoruk
    Member

    Can you please try npm install -g codeburn , codeburn menubar --force

    Image as in my case I am able to track usage if this still not work, then I will have to dive deeper :)

  4. iamtoruk commented on Apr 27, 2026

    @iamtoruk
    Member

    Hey, pushed a fix in v0.9.2 that should address this.

    The root cause was Cursor's v3 bubble format storing zero token counts for all entries. The provider was filtering on inputTokens > 0, so everything got dropped. Now it estimates tokens from the text length when the counts are zero.

    Also fixed the agentKv fallback path which was skipping entries with plain string content instead of JSON arrays.

    Can you update and let us know if it's working for you?

    npm install -g codeburn@latest
    codeburn report
    
  5. CarlvinceTan commented on Apr 28, 2026

    @CarlvinceTan
    Author

    Hey, pushed a fix in v0.9.2 that should address this.

    The root cause was Cursor's v3 bubble format storing zero token counts for all entries. The provider was filtering on inputTokens > 0, so everything got dropped. Now it estimates tokens from the text length when the counts are zero.

    Also fixed the agentKv fallback path which was skipping entries with plain string content instead of JSON arrays.

    Can you update and let us know if it's working for you?

    npm install -g codeburn@latest
    codeburn report
    

    Unfortunately it still doesn't work. I reinstalled it making sure it's on v0.9.2 but still hasn't changed the metrics for Cursor. It's showing "no usage data found for "

  6. added a commit that references this issue on Apr 28, 2026
    410fad9
  7. added a commit that references this issue on Apr 28, 2026
    e3506ca
  8. added a commit that references this issue on Apr 28, 2026
    383df90
  9. iamtoruk commented on Apr 28, 2026

    @iamtoruk
    Member

    v0.9.3 just shipped with an additional fix for this. The v0.9.2 fix handled the zero token counts, but there was a second bug: a hardcoded 35-day lookback in the SQL query that dropped all bubbles older than 5 weeks — including ones with NULL createdAt timestamps. That's been widened to 180 days.

    npm install -g codeburn@latest
    codeburn menubar --force
    codeburn report --provider cursor -p all
    

    Let us know if it's picking up your data now.

  10. CarlvinceTan commented on Apr 28, 2026

    @CarlvinceTan
    Author
    Image

    It does pick up cost now but only for the auto mode not for individual models

  11. iamtoruk commented on Apr 28, 2026

    @iamtoruk
    Member

    Nice, glad costs are showing up now! The individual model issue is that Cursor emits names like claude-4.6-sonnet which don't match our pricing keys (claude-sonnet-4-6). Just pushed aliases for all known Cursor model names.

    To test from source:

    git clone https://github.com/getagentseal/codeburn.git
    cd codeburn
    npm install
    npx tsx src/cli.ts report --provider cursor -p all

    Individual models should now show costs instead of $0. Let us know!

  12. CarlvinceTan commented on Apr 28, 2026

    @CarlvinceTan
    Author

    Unfortunately it's still not showing the costs for the other models used. I'm on the main branch though, were the aliases pushed on another branch?

    Image
  13. iamtoruk commented on Apr 30, 2026

    @iamtoruk
    Member

    The aliases for Cursor model names are in v0.9.4, so this should be resolved. Here's how to debug:

    1. Update to latest:

    npm install -g codeburn@latest
    codeburn --version

    2. Check if costs show up now:

    codeburn report --provider cursor -p all

    3. If models still show $0, dump the raw model names Cursor is storing:

    codeburn report --provider cursor -p all --format json 2>/dev/null | grep -o '"model":"[^"]*"' | sort -u

    4. Check if pricing lookup finds those models:

    codeburn report --provider cursor -p all --format json 2>/dev/null | grep -o '"costUSD":[0-9.]*' | sort -u

    5. If all costUSD are 0, check that pricing data loaded:

    cat ~/.cache/codeburn/litellm-pricing.json | head -c 200

    If this file is missing or empty, there may be a network issue fetching pricing data. Delete it and run codeburn report again to force a fresh fetch:

    rm ~/.cache/codeburn/litellm-pricing.json
    codeburn report --provider cursor -p all

    6. If it's still broken, run with debug output:

    DEBUG=1 codeburn report --provider cursor -p all 2>&1 | head -50

    Paste the output from steps 3-6 and I can pinpoint exactly where it's failing.

  14. teziovsky commented on May 8, 2026

    @teziovsky
    Image Image
  15. iamtoruk commented on May 10, 2026

    @iamtoruk
    Member

    @CarlvinceTan @teziovsky update on this. The individual-model $0 issue should be resolved on `main` as of #290 (`cdf7169`), shipping in the next npm publish.

    What was actually broken

    The v0.9.4 alias map covered the most-common Cursor model strings (`claude-4.6-sonnet`, `claude-4.5-sonnet-thinking`, etc.) but missed the family of reasoning / tier suffixes that Cursor actually emits. Specifically:

    • `-high`, `-low`, `-medium`, `-high-thinking`, `-fast-mode` variants for both Opus and Sonnet at every released version
    • The dash-form `claude-opus-4-7-thinking-high` (most others use dot form)
    • Plain `claude-4-sonnet`, `claude-4-sonnet-1m`, `claude-4-opus` (the last one was worse than missing — it was aliased to Opus 4.5 pricing instead of Opus 4, under-billing by 67%)
    • `composer-1.5` and `composer-2` (Cursor's house models)
    • `gpt-5-fast`
    • `claude-4.5-haiku`, `claude-4.6-haiku`

    A multi-agent verification ran the resolver against a real 1.9 GB Cursor SQLite DB (5,556 distinct rows). Coverage went from "Auto only" to 5,510 / 5,556 = 99.2% with the four genuine misses being local on-device models (`local-qwen`, `qwen3-coder-next`, etc.) where $0 is correct.

    How to test before the publish

    ```bash
    git clone https://github.com/getagentseal/codeburn
    cd codeburn
    npm install
    npm run build

    Replace with your real Cursor data

    node dist/cli.js report --provider cursor -p all
    node dist/cli.js report --provider cursor -p all --format json | jq '.models'
    ```

    If you can confirm the cost column is non-zero for whatever models your screenshot was showing, we'll cut the next publish. If you still see $0 anywhere, please paste the exact model name (`jq '.models | map(.name)'` will dump them) so we can add the alias before tagging.

    `#196` reporter — the per-project breakdown half (everything showing under one row labeled "cursor") is a separate fix coming in the next PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions