Skip to content

[Feature] Expose cumulative session token counts in session_status #16079

@finwitz

Description

@finwitz

Problem

When building activity tracking/dashboards, there's no way to get actual token usage per task. The session_status tool shows per-turn tokens (e.g., "8 in / 56 out") but not cumulative session totals.

Proposed Solution

Add cumulative token fields to session_status output:

🧮 Tokens: 8 in / 56 out (this turn)
📊 Session: 45,230 in / 32,100 out (cumulative)
💰 Cost: $1.23 (session total)

Or expose via a separate tool/API:

session_tokens -> {inputTokens: 45230, outputTokens: 32100, costUsd: 1.23}

Use Case

Tracking token usage per task for:

  • Activity feed dashboards showing cost per action
  • Budget monitoring
  • Efficiency analysis

Current Workaround

Tracking context size deltas as a rough proxy, but this is imprecise.

Additional Context

Would enable accurate cost attribution to specific tasks/activities rather than just session-level totals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions