Copilot Token Meter
Live token consumption for GitHub Copilot agent sessions, inside VS Code:
- Status bar:
In 2.96M · Out 132k · Think 86k for the latest session (or today). Hover for the full breakdown,
click to open the sidebar.
- Token Meter sidebar (activity bar): Current session, Today, Last 7 days, Last 30 days, All time, Recent sessions
and Daily. Each shows input (fresh / cache read / cache write), output, reasoning, AI credits and model calls, plus a
per-model breakdown. Sessions drill down into turns, individual model calls and sub-agents.
What the numbers mean
| Metric |
Meaning |
| Input |
Prompt tokens sent to the model per call: fresh (uncached) + cache read + cache write. The whole context is re-sent on every call, so this is usually the largest number. |
| Output |
Tokens generated by the model. |
| Reasoning ("Think") |
Reasoning / thinking tokens reported by the model. Most models count them within Output; Gemini reports them separately. |
| AI credits |
Credits billed by Copilot for the calls (total_nano_aiu ÷ 10⁹). |
Per-call values come from the billing breakdown Copilot records (token_details_json), falling back to the flat token
columns when it is missing.
Data source and privacy
The extension reads ~/.copilot/session-store.db, the SQLite store where the Copilot CLI and agent host record every
model call (assistant_usage_events) and session (sessions). It opens the file read-only, polls it every few
seconds and never sends anything anywhere. It uses VS Code's built-in node:sqlite, so there are no dependencies.
Only model calls recorded in that store are counted. Copilot Chat usage logged elsewhere (for example the Chat panel's
debug logs) is not included.
The store is an internal Copilot file, not a public API. If a future Copilot release changes it, the sidebar shows an
explanatory message instead of numbers.
Requirements
- VS Code 1.103 or later (the first release whose runtime includes
node:sqlite).
- The GitHub Copilot CLI or the VS Code agent host, which write
~/.copilot/session-store.db.
- The meter shows in regular VS Code windows. The dedicated Agents window only loads a restricted set of extensions.
Settings
| Setting |
Default |
Description |
copilotTokenMeter.databasePath |
"" |
Store path; empty means ~/.copilot/session-store.db. |
copilotTokenMeter.refreshIntervalSeconds |
5 |
Polling interval. |
copilotTokenMeter.statusBarScope |
latestSession |
latestSession or today. Also toggled from the sidebar title bar. |
copilotTokenMeter.recentSessionCount |
20 |
Sessions listed under Recent sessions. |
copilotTokenMeter.dailyHistoryDays |
14 |
Days listed under Daily. |
Commands (Token Meter: in the Command Palette): Refresh, Show Token Usage, Toggle Status Bar Scope, Open Settings.
To hide the status bar item, right-click the status bar and untick Copilot Token Meter.
Development
Requires Node.js 22.13 or later (for node:sqlite).
npm test # unit tests (node:test)
npm run test:integration # runs the extension in an isolated VS Code instance against a fixture store
npm run package # builds copilot-token-meter-<version>.vsix
code --install-extension copilot-token-meter-0.1.0.vsix --force
npm run publish # publishes to the Marketplace (after `npx @vscode/vsce login YoussefSaleh`)
test:integration uses %LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe; set VSCODE_EXECUTABLE to use another
build.
Disclaimer
Copilot Token Meter is an independent project. It is not affiliated with, endorsed by or supported by GitHub or
Microsoft. GitHub Copilot is a trademark of GitHub, Inc.