Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>GitHub Copilot Token TrackerNew to Visual Studio Code? Get it now.
GitHub Copilot Token Tracker

GitHub Copilot Token Tracker

winter0729

|
2 installs
| (0) | Free
Track GitHub Copilot Chat token usage from request export logs.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copilot Token Tracker

Track GitHub Copilot Chat token usage directly inside VS Code.

This extension collects usage by calling Copilot Chat's internal export command:

  • github.copilot.chat.debug.exportAllPromptLogsAsJson

Then it parses successful request metadata (metadata.usage) and keeps model-based cumulative totals in persistent extension storage.

Features

  • Activity Bar sidebar tab (Copilot Stats) with:
    • DASHBOARD (table-based overview: today/month/last month/projected year)
    • SESSION SUMMARY
    • REQUEST HISTORY (expandable request detail items)
    • DAILY SUMMARY / DAILY HISTORY (separate Daily page)
  • Status bar summary for top model usage
  • Model-based cumulative totals
  • Estimated API cost by model (based on public list pricing)
  • Global cumulative totals across all workspaces (live token data in current VS Code profile)
  • Recent request list (token breakdown per request)
  • Persistent state (globalState) across VS Code restarts
  • Commands for detail view, refresh, and reset

Commands

  • Copilot Token Tracker: Show Usage
    • Command ID: github-copilot-token-tracker.showUsage
    • Opens Output channel report (model totals, recent requests, totals)
  • Copilot Token Tracker: Refresh Usage
    • Command ID: github-copilot-token-tracker.refreshNow
    • Forces an immediate poll/export/parse cycle
  • Copilot Token Tracker: Reset Usage
    • Command ID: github-copilot-token-tracker.resetUsage
    • Clears all tracked usage data

Settings

  • copilotTokenTracker.pollIntervalMs
    • Default: 1500
    • Minimum: 500
  • copilotTokenTracker.statusBar.enabled
    • Default: true
  • copilotTokenTracker.maxProcessedRequestIds
    • Default: 5000
    • Minimum: 100
  • copilotTokenTracker.maxRecentRequests
    • Default: 20
    • Minimum: 1

Requirements

  • GitHub Copilot Chat must be installed and expose the internal export command above.
  • If the command is unavailable, the status bar shows Unavailable and polling retries automatically.

Notes and Limitations

  • Data source is an internal Copilot debug/export command and can change between Copilot versions.
  • Estimated costs use public API list pricing references for OpenAI/Anthropic/Google models (as-of implementation date).
  • Actual Copilot billing may differ from direct API list pricing.
  • Deduplication uses request ID priority:
    • requestId
    • serverRequestId
    • ourRequestId
    • fallback to log item ID
  • Usage counts aggregate successful requests only (ChatMLSuccess) and only for request types:
    • ChatCompletions
    • ChatMessages
    • ChatResponses
  • Live token scope is global per active VS Code profile/user data directory, not per workspace.
  • True retroactive all-time history before this extension started collecting is not available from this tracker.
  • If maxProcessedRequestIds is exceeded, very old request IDs are pruned; if those IDs reappear later they can be counted again.
  • Collector also attempts to read ccreq:latest.request.json as a best-effort supplemental source.
  • For richer live token capture, increase github.copilot.chat.debug.requestLogger.maxEntries in VS Code settings (Copilot internal request-log ring buffer size).

Development

  • Build: pnpm run compile
  • Watch: pnpm run watch
  • Test: pnpm run test
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft