🪙 Token-Track
Track your GitHub Copilot token usage and costs — directly from local logs.
Token-Track is a set of IDE extensions for VS Code and Visual Studio that parse your local Copilot debug logs to give you real-time visibility into token consumption and estimated costs. No API access, no billing permissions, no data sent anywhere — everything stays on your machine.
✨ Features
- 📊 Real-time Dashboard — Beautiful charts showing daily costs, model usage breakdown, and token analytics
- 🪙 Status Bar — Live cost estimate in your IDE status bar (click to open dashboard)
- 💰 Cost Calculator — Accurate estimates based on GitHub AI Credits pricing ($0.01/credit)
- 📈 Historical Trends — Track your usage over days, weeks, and months
- 🚨 Budget Alerts — Set a monthly budget and get warned when approaching limits
- 📤 Export Data — Download your usage data as CSV or JSON
- 🔒 100% Local — No data leaves your machine. Everything is parsed and stored locally
- ⚡ Auto-Setup — Logging is automatically enabled when you install the extension
📦 Installation
VS Code
- Open Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Token-Track"
- Click Install
- That's it! The extension auto-enables Copilot debug logging on first activation
Visual Studio
- Go to Extensions > Manage Extensions
- Search for "Token-Track"
- Click Download and restart Visual Studio
- The extension auto-enables Copilot trace logging on first load
🚀 Quick Start
- Install the extension
- Use Copilot as you normally would (Chat, Agent Mode, completions, etc.)
- Click the 🪙 icon in the status bar to see your estimated cost
- Open the Dashboard via the Command Palette:
Token-Track: Open Dashboard
📊 Dashboard
The dashboard provides:
| Feature |
Description |
| Summary Cards |
Today / This Week / This Month costs and token counts |
| Cost Timeline |
Line chart showing daily spend over time |
| Model Breakdown |
Donut chart of usage per AI model |
| Token Split |
Stacked bar chart of Input vs Output vs Cached tokens |
| Request History |
Searchable, sortable table of all Copilot requests |
| Budget Tracker |
Progress bar showing spend vs your monthly budget |
⚙️ Configuration
VS Code Settings
{
// Auto-scan logs on interval (default: true)
"token-track.autoScan": true,
// Scan frequency in seconds (default: 60)
"token-track.scanIntervalSeconds": 60,
// Monthly budget in USD (default: 10.00 for Pro plan)
"token-track.monthlyBudget": 10.00,
// Display currency (default: "USD")
"token-track.currency": "USD",
// Override default model pricing (per 1M tokens)
"token-track.customPricing": {},
// How long to keep usage history in days (default: 90)
"token-track.retentionDays": 90
}
💰 Pricing Reference
Token-Track uses GitHub's official AI Credits pricing (1 Credit = $0.01 USD):
| Model |
Input (per 1M) |
Cached (per 1M) |
Output (per 1M) |
| GPT-5 mini |
$0.25 |
$0.025 |
$2.00 |
| GPT-5.3 Codex |
$1.75 |
$0.175 |
$14.00 |
| GPT-5.4 |
$2.50 |
$0.25 |
$15.00 |
| GPT-5.4 (Long Context) |
$5.00 |
$0.50 |
$22.50 |
| GPT-5.4 mini |
$0.75 |
$0.075 |
$4.50 |
| GPT-5.4 nano |
$0.20 |
$0.02 |
$1.25 |
Note: Prices can be customized in extension settings. Code completions and Next Edit suggestions are free and not tracked.
⚠️ Important Disclaimers
- Estimates Only — Token counts come from Copilot debug logs, which may differ slightly from actual GitHub billing. All costs are labeled as "estimated."
- Internal Log Format — The extension relies on Copilot's internal debug log format, which may change between updates. We handle schema changes gracefully with fallbacks.
- Privacy — No data is ever sent outside your machine. All processing is 100% local.
🔧 How It Works
VS Code
- On activation, the extension enables
github.copilot.chat.agentDebugLog.fileLogging.enabled
- It uses
github.copilot.chat.debug.exportAllPromptLogsAsJson to read session logs
- It also watches the JSONL log directory for real-time updates
- Token counts are extracted from
metadata.usage in the log entries
- Costs are calculated using the bundled pricing table
Visual Studio
- On load, the extension enables Copilot Trace logging via settings
- It watches
%TEMP%\VSGitHubCopilotLogs\ for new .log files
- Log files are parsed line-by-line, extracting JSON blocks with
usage data
- Token counts and costs are calculated identically to the VS Code version
🛠️ Development
VS Code Extension
cd packages/vscode-extension
npm install
npm run build # Build extension
npm run watch # Build in watch mode
npm test # Run unit tests
npm run package # Create .vsix package
Visual Studio Extension
cd packages/vs-extension
dotnet restore
dotnet build # Build VSIX
dotnet test # Run unit tests
📝 License
MIT — see LICENSE
🤝 Contributing
Contributions welcome! Please open an issue or PR.
- Fork the repo
- Create a feature branch
- Make your changes
- Run tests
- Submit a PR