Skip to content

Counting does not work at all #196

Closed

Description

@cwik-tech

Just installed the app and got this:

Image Image

The only caveat:

  1. I dont use cursor at all
  2. I am coding now, but with codex model
  3. I am in zed IDE
  4. I am not debugging but creating new feature

So this whole thing could not be more wrong than it is. Had great hopes but looks useless so far.

Activity

  1. iamtoruk commented on May 2, 2026

    @iamtoruk
    Member

    On it

  2. iamtoruk commented on May 2, 2026

    @iamtoruk
    Member

    Thanks for reporting this and for being specific about what's wrong. Looking into it now.

    Two things are likely happening:

    1. Activity classification is too aggressive with "Debugging"

    The classifier checks debug keywords (fix, error, issue, bug) before feature keywords (add, create, implement, new). So if your prompt says something like "add error handling" or "create an issue tracker" or "fix the layout for the new feature", it gets tagged as Debugging instead of Feature Dev. These words show up all the time in normal feature work. We need to either reorder the priority or add context awareness so "error" in "error handling" doesn't trigger the debug path.

    2. Provider misattribution

    If you ever had Cursor installed, there may be leftover files in ~/.cursor/projects/ that our cursor-agent provider picks up. It scans that directory without checking whether Cursor is actually installed. Even residual transcript files get attributed as Cursor sessions.

    Can you check:

    • Does ~/.cursor/ exist on your machine even though you don't use Cursor?
    • What does codeburn status show for provider breakdown?
    • Can you share what your first prompt to Codex was in that session? (so I can trace why the classifier got it wrong)

    Working on fixes for both. The classifier one is the more impactful issue.

  3. iamtoruk commented on May 2, 2026

    @iamtoruk
    Member

    One more thing - we don't have Zed support yet. If you're using Zed's built-in AI assistant (even with a Codex/OpenAI model), codeburn can't see that usage. Zed stores AI sessions in its own format and location that we don't read.

    So the data you're seeing is likely either stale sessions from a previous tool, or the Codex CLI sessions being misclassified. If you're running Codex CLI separately from Zed, those sessions should show up under the Codex provider. But if you're using Zed's AI panel directly, that's the gap.

    Zed provider support is on the roadmap. In the meantime, codeburn status will show you which providers are actually contributing data so you can see what's being picked up.

  4. iamtoruk commented on May 2, 2026

    @iamtoruk
    Member

    Can you run these and paste the output?

    codeburn status
    codeburn today --json | head -100
    ls -la ~/.cursor/projects/ 2>&1 | head -20
    ls -la ~/.codex/ 2>&1 | head -10

    This will tell us exactly which providers are feeding data and whether there's a stale ~/.cursor directory on your machine.

  5. PhilippMolitor commented on May 6, 2026

    @PhilippMolitor

    Same for me, but I only use cursor.

    Output on latest version of codeburn: (apparently json flag is missing there)

    ❯ codeburn status
      codeburn today --json | head -100
      ls -la ~/.cursor/projects/ 2>&1 | head -20
      ls -la ~/.codex/ 2>&1 | head -10
    
      Today  €13.66  457 calls    Month  €13.81  645 calls
    
    error: unknown option '--json'
    Permissions Size User Group Date Modified Name
    drwxr-xr-x@    - phil staff 16 Apr 10:43  1776328994107
    drwxr-xr-x@    - phil staff 17 Apr 09:15  1776410135355
    drwxr-xr-x@    - phil staff 17 Apr 16:13  1776435216921
    drwxr-xr-x@    - phil staff 21 Apr 11:01  1776762092953
    drwxr-xr-x@    - phil staff 22 Apr 15:39  1776865169379
    drwxr-xr-x@    - phil staff 23 Apr 14:53  1776948838659
    drwxr-xr-x@    - phil staff 27 Apr 11:31  1777282289517
    drwxr-xr-x@    - phil staff 28 Apr 14:08  1777378120075
    drwxr-xr-x@    - phil staff 29 Apr 11:19  1777454391225
    drwxr-xr-x@    - phil staff 29 Apr 14:18  1777465134276
    drwxr-xr-x@    - phil staff 29 Apr 14:48  1777466924643
    drwxr-xr-x@    - phil staff 29 Apr 16:51  1777474310040
    drwxr-xr-x@    - phil staff 30 Apr 09:30  1777534235656
    drwxr-xr-x@    - phil staff 30 Apr 15:21  1777555317279
    drwxr-xr-x@    - phil staff  3 May 14:09  1777810197311
    drwxr-xr-x@    - phil staff  4 May 10:28  1777883329421
    drwxr-xr-x@    - phil staff 15 Apr 14:41  empty-window
    drwxr-xr-x@    - phil staff 29 Apr 16:58  Users-phil-Projects
    drwxr-xr-x@    - phil staff 17 Apr 10:11  Users-phil-Projects-redacted
    "/Users/phil/.codex/": No such file or directory (os error 2)
    

    Output of codeburn report --format json

    {
      "generated": "2026-05-06T14:08:58.975Z",
      "currency": "EUR",
      "period": "Last 7 Days",
      "periodKey": "week",
      "overview": {
        "cost": 14.25,
        "calls": 1017,
        "sessions": 17,
        "cacheHitPercent": 0,
        "tokens": {
          "input": 3403981,
          "output": 430053,
          "cacheRead": 0,
          "cacheWrite": 0
        }
      },
      "daily": [
        {
          "date": "2026-04-29",
          "cost": 0.3,
          "calls": 270
        },
        {
          "date": "2026-04-30",
          "cost": 0.14,
          "calls": 102
        },
        {
          "date": "2026-05-03",
          "cost": 0.04,
          "calls": 51
        },
        {
          "date": "2026-05-04",
          "cost": 0.09,
          "calls": 108
        },
        {
          "date": "2026-05-05",
          "cost": 0.03,
          "calls": 29
        },
        {
          "date": "2026-05-06",
          "cost": 13.66,
          "calls": 457
        }
      ],
      "projects": [
        {
          "name": "cursor",
          "path": "cursor",
          "cost": 13.99,
          "avgCostPerSession": 13.99,
          "calls": 870,
          "sessions": 1
        },
        {
          "name": "core",
          "path": "core",
          "cost": 0.11,
          "avgCostPerSession": 0.02,
          "calls": 55,
          "sessions": 5
        },
        {
          "name": "mfe",
          "path": "mfe",
          "cost": 0.07,
          "avgCostPerSession": 0.02,
          "calls": 35,
          "sessions": 4
        },
        {
          "name": "Projects",
          "path": "Projects",
          "cost": 0.03,
          "avgCostPerSession": 0.02,
          "calls": 23,
          "sessions": 2
        },
        {
          "name": "docs",
          "path": "docs",
          "cost": 0.03,
          "avgCostPerSession": 0.01,
          "calls": 23,
          "sessions": 3
        },
        {
          "name": "default",
          "path": "default",
          "cost": 0.02,
          "avgCostPerSession": 0.01,
          "calls": 11,
          "sessions": 2
        }
      ],
      "models": [
        {
          "name": "Cursor (auto)",
          "calls": 884,
          "inputTokens": 3391227,
          "outputTokens": 430053,
          "cacheReadTokens": 0,
          "cacheWriteTokens": 0,
          "cost": 14.23
        },
        {
          "name": "Opus 4.7",
          "calls": 42,
          "inputTokens": 3894,
          "outputTokens": 0,
          "cacheReadTokens": 0,
          "cacheWriteTokens": 0,
          "cost": 0.02
        },
        {
          "name": "GPT-5.5",
          "calls": 91,
          "inputTokens": 8860,
          "outputTokens": 0,
          "cacheReadTokens": 0,
          "cacheWriteTokens": 0,
          "cost": 0.01
        }
      ],
      "activities": [
        {
          "category": "Coding",
          "cost": 5.32,
          "turns": 137,
          "editTurns": 16,
          "oneShotTurns": 16,
          "oneShotRate": 100
        },
        {
          "category": "Debugging",
          "cost": 3.3,
          "turns": 160,
          "editTurns": 14,
          "oneShotTurns": 14,
          "oneShotRate": 100
        },
        {
          "category": "Feature Dev",
          "cost": 2.44,
          "turns": 229,
          "editTurns": 4,
          "oneShotTurns": 4,
          "oneShotRate": 100
        },
        {
          "category": "Exploration",
          "cost": 1.51,
          "turns": 174,
          "editTurns": 0,
          "oneShotTurns": 0,
          "oneShotRate": null
        },
        {
          "category": "Refactoring",
          "cost": 0.97,
          "turns": 4,
          "editTurns": 4,
          "oneShotTurns": 4,
          "oneShotRate": 100
        },
        {
          "category": "Conversation",
          "cost": 0.47,
          "turns": 296,
          "editTurns": 0,
          "oneShotTurns": 0,
          "oneShotRate": null
        },
        {
          "category": "Brainstorming",
          "cost": 0.23,
          "turns": 17,
          "editTurns": 0,
          "oneShotTurns": 0,
          "oneShotRate": null
        }
      ],
      "tools": [
        {
          "name": "cursor:readfile",
          "calls": 164
        },
        {
          "name": "cursor:rg",
          "calls": 40
        },
        {
          "name": "cursor:edit",
          "calls": 38
        },
        {
          "name": "cursor:read",
          "calls": 23
        },
        {
          "name": "cursor:glob",
          "calls": 20
        },
        {
          "name": "cursor:shell",
          "calls": 16
        },
        {
          "name": "cursor:strreplace",
          "calls": 15
        },
        {
          "name": "cursor:todowrite",
          "calls": 14
        },
        {
          "name": "lang:typescript",
          "calls": 11
        },
        {
          "name": "lang:python",
          "calls": 11
        },
        {
          "name": "lang:sql",
          "calls": 7
        },
        {
          "name": "lang:shellscript",
          "calls": 6
        },
        {
          "name": "cursor:grep",
          "calls": 5
        },
        {
          "name": "lang:yaml",
          "calls": 3
        },
        {
          "name": "lang:json",
          "calls": 3
        },
        {
          "name": "cursor:websearch",
          "calls": 3
        },
        {
          "name": "lang:javascript",
          "calls": 2
        },
        {
          "name": "cursor:task",
          "calls": 2
        },
        {
          "name": "cursor:applypatch",
          "calls": 1
        },
        {
          "name": "cursor:callmcptool",
          "calls": 1
        }
      ],
      "mcpServers": [],
      "shellCommands": [],
      "topSessions": [
        {
          "project": "cursor",
          "sessionId": "unknown",
          "date": "2026-04-29",
          "cost": 13.99,
          "calls": 870
        },
        {
          "project": "core",
          "sessionId": "c53cde67347da80b",
          "date": "2026-05-06",
          "cost": 0.06,
          "calls": 29
        },
        {
          "project": "mfe",
          "sessionId": "80bf8d1d493f1e9b",
          "date": "2026-04-29",
          "cost": 0.04,
          "calls": 17
        },
        {
          "project": "mfe",
          "sessionId": "298e5aacb583f41d",
          "date": "2026-04-30",
          "cost": 0.03,
          "calls": 14
        },
        {
          "project": "Projects",
          "sessionId": "de9052f867010998",
          "date": "2026-04-29",
          "cost": 0.03,
          "calls": 21
        }
      ]
    }
  6. iamtoruk commented on May 10, 2026

    @iamtoruk
    Member

    @PhilippMolitor @koshurai update on this. Two fixes have landed on `main` since the last reply:

    1. Activity classifier no longer mislabels feature work as Debugging (#289, `7a878f4`). Previously `add error handling`, `create an issue tracker`, `implement the 404 page` etc. all bucketed as Debugging because the debug-keyword regex was checked before the feature-keyword regex. Now whichever pattern matches earliest in the user message wins, so a feature verb at the start beats an incidental `error` / `fix` / `issue` later in the same sentence. Real bug reports (`login is broken, traceback below`) still classify as Debugging because the debug word leads.

    2. Cursor cost shown for every model, not just Auto (#290, `cdf7169`). The alias map was missing ~20 model strings Cursor actually emits (`claude-4.6-opus-high`, `-low`, `-medium`, `-fast-mode`, `-high-thinking`, plus `composer-1.5` / `composer-2` and several others). Verified against a real 1.9 GB Cursor DB — coverage went from "Auto only" to 99.2%.

    Still pending: per-project breakdown

    The "everything shows up under one row labeled `cursor`" half of this issue (visible in @PhilippMolitor's JSON dump showing one project `name: cursor, cost: 13.99, calls: 870, sessions: 1`) is being addressed in a separate PR. The fix needs to read Cursor's `workspaceFolderName` from the SQLite db so each project shows up as its own row rather than collapsing into one. Will tag this issue when it lands.

    Test the two fixes now

    ```bash
    git clone https://github.com/getagentseal/codeburn
    cd codeburn
    npm install
    npm run build
    node dist/cli.js report -p all --format json | jq '.activities | map({name, turns, cost})'
    ```

    If your "Debugging" share has dropped to a sensible level (i.e. matches actual bug-fix work, not feature work), the classifier fix is doing its job. Reply with output if anything still looks wrong and we'll dig in before the next npm publish.

  7. iamtoruk commented on May 11, 2026

    @iamtoruk
    Member

    Fully fixed in v0.9.8 across three PRs:

    1. Per-project breakdown (fix(cursor): per-project breakdown by workspace (closes per-project half of #196) #296) — Cursor sessions now break down by workspace instead of one "cursor" row. Walks workspaceStorage/*/workspace.json to attribute bubbles per project.
    2. Model alias coverage (fix(cursor): alias every Cursor model variant so non-Auto sessions price (#159) #290) — every Cursor model variant (claude-4.x-*, composer-1/1.5/2, etc.) now resolves to pricing. No more $0 rows.
    3. Classifier fix (fix(classifier): feature verb wins over debug keyword (part of #196) #289) — "add error handling" classifies as Feature, not Debugging. Earliest keyword match wins.

    To verify:

    npm i -g [email protected]
    codeburn today
    codeburn models --provider cursor
    

    You should see per-workspace project rows and correct costs on all models.

  8. iamtoruk commented on May 12, 2026

    @iamtoruk
    Member

    Fixed in #320. Project names with dashes and dots now render correctly in both the By Project and Top Sessions panels. Available on main -- please test with npx codeburn@latest once the next release is published.

  9. added a commit that references this issue on May 16, 2026
    36e9416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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