Copilot Token Tracker
May 8, 2026 ยท View on GitHub

Command-line interface for analyzing GitHub Copilot token usage from local session files. Works anywhere Copilot Chat stores its session data โ no VS Code required.
๐ฆ npm: @rajbos/ai-engineering-fluency
Quick Start
# Run directly with npx (no install required)
npx @rajbos/ai-engineering-fluency stats
# Or install globally
npm install -g @rajbos/ai-engineering-fluency
ai-engineering-fluency stats
Commands
stats โ Session Overview
Show discovered session files, sessions, chat turns, and token counts.
ai-engineering-fluency stats
ai-engineering-fluency stats --verbose # Show per-folder breakdown
ai-engineering-fluency stats --json # Machine-readable JSON output
GitHub Copilot Token Tracker - Session Statistics
==================================================
Editor Breakdown:
Code (VS Code) 42 files โ 318 sessions โ 4,821 turns โ 2.1M tokens
Code - Insiders 8 files โ 61 sessions โ 892 turns โ 401K tokens
OpenCode 3 files โ 18 sessions โ 204 turns โ 87K tokens
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Total 53 files โ 397 sessions โ 5,917 turns โ 2.6M tokens
With --json, outputs a machine-readable payload suitable for scripting:
{
"totalFiles": 53,
"processedFiles": 50,
"emptyFiles": 3,
"totalTokens": 2600000,
"totalThinkingTokens": 0,
"totalInteractions": 5917,
"byEditor": {
"vscode": { "files": 42, "tokens": 2100000, "interactions": 4821 },
"vscode-insiders": { "files": 8, "tokens": 401000, "interactions": 892 },
"opencode": { "files": 3, "tokens": 87000, "interactions": 204 }
},
"lastUpdated": "2025-01-15T10:30:00.000Z"
}
usage โ Token Usage Report
Show token usage broken down by time period.
ai-engineering-fluency usage
ai-engineering-fluency usage --models # Show per-model breakdown
ai-engineering-fluency usage --cost # Show estimated cost
GitHub Copilot Token Tracker - Token Usage
==========================================
Period Input Tokens Output Tokens Total Tokens
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Today 8,432 12,104 20,536
Last 7 days 52,871 74,209 127,080
Last 30 days 218,540 301,883 520,423
All time 1,841,200 2,312,650 4,153,850
--models breakdown (last 30 days):
gpt-4o 312,540 tokens
claude-3.5-sonnet 98,203 tokens
o3-mini 71,801 tokens
gemini-2.0-flash 37,879 tokens
environmental โ Environmental Impact
Show the environmental impact of your Copilot usage (COโ emissions, water usage, tree equivalents).
ai-engineering-fluency environmental
ai-engineering-fluency env # Short alias
GitHub Copilot Token Tracker - Environmental Impact
====================================================
Based on your last 30 days of usage (520,423 tokens):
COโ emissions ~ 0.42 kg COโe
Water usage ~ 0.63 L
Tree equivalent ~ 0.02 trees/year needed to offset
All figures are estimates based on published AI energy-use research.
fluency โ Fluency Score
Show your Copilot Fluency Score across multiple categories (Prompt Engineering, Context Engineering, Agentic, Tool Usage, Customization, Workflow Integration).
ai-engineering-fluency fluency
ai-engineering-fluency fluency --tips # Show improvement tips
GitHub Copilot Token Tracker - Fluency Score
============================================
Overall stage: Collaborator โโโโโโโโโโโโโโโโ Stage 3 of 4
๐ฌ Prompt Engineering Collaborator โโโโโโโโโโโโโโโโ
๐ Context Engineering Explorer โโโโโโโโโโโโโโโโ
๐ค Agentic Collaborator โโโโโโโโโโโโโโโโ
๐ง Tool Usage Strategist โโโโโโโโโโโโโโโโ
โ๏ธ Customization Explorer โโโโโโโโโโโโโโโโ
๐ Workflow Integration Collaborator โโโโโโโโโโโโโโโโ
Run with --tips to see how to advance each category.
diagnostics โ Search Locations & Stats
Show all locations searched for session files, whether each path exists, and per-location stats.
ai-engineering-fluency diagnostics
GitHub Copilot Token Tracker - Diagnostics
==========================================
Searching for session files...
โ /home/user/.config/Code/User/workspaceStorage 42 files found
โ /home/user/.config/Code/User/globalStorage 3 files found
โ /home/user/.config/Code - Insiders/User/workspaceStorage 8 files found
โ /home/user/.config/Code - Exploration/... (path does not exist)
โ /home/user/.local/share/opencode 3 files found
โ /home/user/.config/Cursor/... (path does not exist)
Total: 56 files across 3 editors
Data Sources
The CLI scans the same session files as the VS Code extension:
- VS Code (Stable, Insiders, Exploration) workspace and global storage
- VSCodium and Cursor editor sessions
- VS Code Remote / Codespaces sessions
- Copilot CLI agent mode sessions
- OpenCode sessions (JSON and SQLite)
- Claude Code sessions (Anthropic CLI/IDE extension, actual API token counts)
- Gemini CLI sessions (JSONL, actual token counts from assistant events)
- Claude Desktop Cowork sessions (Windows only, local agent mode sessions with actual API token counts)
Requirements
- Node.js 18 or later
- GitHub Copilot Chat session files on the local machine
Development
# From the repository root
npm run cli:build # Build the CLI
npm run cli:stats # Run stats command
npm run cli:usage # Run usage command
npm run cli:environmental # Run environmental command
npm run cli:fluency # Run fluency command
npm run cli:diagnostics # Run diagnostics command
npm run cli -- --help # Run any CLI command
License
MIT โ see LICENSE for details.