We need a deterministic way to attribute Cursor token usage to local IDE sessions, features, and subagents

Feature request for product/service

Chat

Describe the request

We need a deterministic way to attribute Cursor token usage to local IDE sessions, features, and subagents.

Today:

  • Hooks expose useful local identifiers such as conversation_id, generation_id, session_id, and transcript_path.
  • /teams/filtered-usage-events exposes real usage/cost data such as tokenUsage, chargedCents, model, timestamp, userEmail, and isHeadless.
  • But there is no stable join key between the two.
  • Time-based correlation breaks when multiple chats/subagents run in parallel.

Either of these would solve the issue:

  1. Expose real session usage locally in session/transcript files

    • Add token usage per generation/session to local transcript/session files.
    • Include inputTokens, outputTokens, cacheWriteTokens, cacheReadTokens, chargedCents, and model metadata.
    • Include parent/child relationships for subagents.
  2. Allow Admin API usage lookup by conversation/session identifiers

    • Add conversation_id, generation_id, session_id, and optionally subagent_id/parent_conversation_id to /teams/filtered-usage-events.
    • Or provide a new endpoint like:
      GET /usage/conversations/{conversation_id}
    • The API should account for subagents by exposing parent/child usage relationships.

Desired outcome:
We can attribute real Cursor token usage to product features, tickets, branches, and subagents without unreliable time-window correlation.

This is especially important for Enterprise teams building internal cost dashboards and feature-level AI usage reports.

1 Like