What's missing
The cursor provider only reads the Cursor IDE's SQLite db at ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb. It does not parse sessions from cursor-agent, Cursor's headless CLI agent, which stores data separately under ~/.cursor.
Reported on HN by halostatue on the Show HN thread: https://news.ycombinator.com/item?id=47759035
Where the data lives
On macOS, cursor-agent writes to two locations under ~/.cursor:
-
Transcripts (plain text)
~/.cursor/projects/<project-id>/agent-transcripts/<uuid>.txt
<project-id> is either a timestamp (e.g. 1771021702762) or a slugified absolute path (e.g. Users-foo-Documents-MyProject).
-
Code-attribution SQLite DB
~/.cursor/ai-tracking/ai-code-tracking.db
Linux/Windows paths need verification.
Transcript format
Plain text, one conversation per file. Observed markers:
user: with <user_query>...</user_query>
A: for assistant turns
[Thinking] ... for reasoning blocks
[Tool call] ToolName followed by indented args
[Tool result] ToolName
No token counts or model names inside the transcript text.
ai-code-tracking.db schema (relevant tables)
conversation_summaries (conversationId, title, tldr, model, mode, updatedAt)
ai_code_hashes (hash, source, fileName, conversationId, model, timestamp)
scored_commits (lines added/deleted split by tab/composer/human, v1AiPercentage, v2AiPercentage, commitDate)
tracked_file_content (gitPath, content, conversationId, model)
Good news: model is present, so conversations can be attributed. Bad news: no token counts anywhere in this DB.
Open questions
- Where do cursor-agent token counts live? Possibly server-side only. Worth checking
~/.cursor/extensions/, ~/.cursor/argv.json, and any VS Code-style log dirs before giving up.
- If tokens are not available locally, fall back to character-length estimation per model, clearly marked as estimated in the report.
- Confirm Linux (
~/.cursor) and Windows paths.
Proposed approach
- Add a
cursor-agent source (either a sibling file src/providers/cursor-agent.ts or extend cursor.ts with a second reader).
- Walk
~/.cursor/projects/*/agent-transcripts/*.txt.
- Join against
ai-code-tracking.db on conversationId (extracted from the transcript filename if it matches, or from summaries) to pick up the model.
- Estimate tokens from transcript text length if no exact source is found. Mark clearly as estimated.
- Expose via
codeburn report --provider cursor-agent. Decide whether to merge cursor-agent into the existing --provider cursor or keep them split.
Acceptance
codeburn today --provider cursor-agent lists today's cursor-agent sessions with project, model, tokens (exact or estimated), and cost.
- The main
report view includes cursor-agent sessions.
- Tests cover: empty
~/.cursor/projects/, a single transcript, a project with many transcripts, missing ai-code-tracking.db, mixed IDE and CLI usage on the same machine.
What's missing
The
cursorprovider only reads the Cursor IDE's SQLite db at~/Library/Application Support/Cursor/User/globalStorage/state.vscdb. It does not parse sessions fromcursor-agent, Cursor's headless CLI agent, which stores data separately under~/.cursor.Reported on HN by halostatue on the Show HN thread: https://news.ycombinator.com/item?id=47759035
Where the data lives
On macOS, cursor-agent writes to two locations under
~/.cursor:Transcripts (plain text)
~/.cursor/projects/<project-id>/agent-transcripts/<uuid>.txt<project-id>is either a timestamp (e.g.1771021702762) or a slugified absolute path (e.g.Users-foo-Documents-MyProject).Code-attribution SQLite DB
~/.cursor/ai-tracking/ai-code-tracking.dbLinux/Windows paths need verification.
Transcript format
Plain text, one conversation per file. Observed markers:
user:with<user_query>...</user_query>A:for assistant turns[Thinking] ...for reasoning blocks[Tool call] ToolNamefollowed by indented args[Tool result] ToolNameNo token counts or model names inside the transcript text.
ai-code-tracking.db schema (relevant tables)
conversation_summaries(conversationId, title, tldr, model, mode, updatedAt)ai_code_hashes(hash, source, fileName, conversationId, model, timestamp)scored_commits(lines added/deleted split by tab/composer/human, v1AiPercentage, v2AiPercentage, commitDate)tracked_file_content(gitPath, content, conversationId, model)Good news:
modelis present, so conversations can be attributed. Bad news: no token counts anywhere in this DB.Open questions
~/.cursor/extensions/,~/.cursor/argv.json, and any VS Code-style log dirs before giving up.~/.cursor) and Windows paths.Proposed approach
cursor-agentsource (either a sibling filesrc/providers/cursor-agent.tsor extendcursor.tswith a second reader).~/.cursor/projects/*/agent-transcripts/*.txt.ai-code-tracking.dbon conversationId (extracted from the transcript filename if it matches, or from summaries) to pick up the model.codeburn report --provider cursor-agent. Decide whether to merge cursor-agent into the existing--provider cursoror keep them split.Acceptance
codeburn today --provider cursor-agentlists today's cursor-agent sessions with project, model, tokens (exact or estimated), and cost.reportview includes cursor-agent sessions.~/.cursor/projects/, a single transcript, a project with many transcripts, missing ai-code-tracking.db, mixed IDE and CLI usage on the same machine.