Github Copilot Report
A VS Code extension that turns your local GitHub Copilot chat history into a usage report — showing the tokens and AIC (AI Credits) used next to every prompt, letting you filter by the current week or month, and exporting a detailed Excel workbook.
Everything runs 100% locally. No data ever leaves your machine.
Built on top of the excellent copilot-chat-history-search by @jeevananthamp16, extended with token/AIC accounting, time filters and Excel export.
Screenshots
The sidebar: pick a time range, read the live Chats · Prompts · Tokens · AIC · USD totals, and browse Recent Chats where every prompt is annotated with its token · AIC · $ usage.
Features
- Sidebar activity-bar view with two panels:
- Filter & Search (webview) — time-range dropdown, live totals, and content/title search.
- Recent Chats (tree) — your chats grouped by day, each prompt annotated with its usage.
- Token / AIC / USD per prompt. Every user prompt shows a badge like
▲ 35k ▼ 252 · 10.9 AIC · $0.11:
▲ input (prompt) tokens · ▼ output (completion) tokens · AIC · estimated USD cost.
- Time filter. Choose This Week (Mon–Sun) or This Month — defaults to the current month. There is also an All time option.
- Excel export. One click exports everything in the current filter to an
.xlsx with a Summary sheet (totals, by-model, by-day) and a Prompts sheet (one row per prompt with tokens & AIC).
- Copy to clipboard. The 📋 Copy button (left of Export) copies the filtered table as tab-separated text — paste it straight into Excel or Google Sheets.
- Pick your columns. On export you tick which fields to include. The necessary ones — #, Session, Model, Prompt, AIC, USD (est.), Input/Output/Total Tokens, Date — are pre-selected in that order; optional ones (Workspace, Response) are one click away. Your choice is remembered and shared by both Copy and Export. The Summary sheet also breaks USD down by model and by day, and prints the
1 AIC = $x rate it used.
What is "AIC"? And the USD estimate
GitHub Copilot's usage-based billing charges each request in AICs (AI Credits). This extension reports AIC exactly the way ailmind/github-copilot-chat-usage does — straight from the credits Copilot actually billed, never from a token × published-rate guess.
AIC per prompt is read in this priority order, all sourced from the request's own record in the .jsonl session file:
- The
nanoAiu (a.k.a. copilotUsageNanoAiu) field Copilot writes once it has billed the request: AIC = nanoAiu / 1e9.
- If that field isn't present yet, the human-readable usage line Copilot writes into
result.details once billing is reconciled — e.g. "Raptor mini • 2.0 credits" — is parsed for the credit amount.
If neither is present, the prompt's AIC/USD is shown as — (unknown) rather than an estimate, and the session/period total is marked with a + to flag it as a lower bound. There is no per-model pricing table or formula involved — this avoids ever showing a number that doesn't match what GitHub actually bills.
USD estimate. GitHub draws your budget down at a fixed rate of 1 AI credit = $0.01 USD (a $10 budget = 1,000 credits — see GitHub's usage‑based billing docs):
USD = AIC × usdPerAic (usdPerAic defaults to 0.01)
Model display names (e.g. "Claude Sonnet 4.6" instead of claude-sonnet-4-6) are cosmetic only and don't affect AIC/USD — they're read from your chat data when present, with a built-in fallback table for known models.
How it reads your data
The extension parses the Copilot chat session files VS Code stores locally:
%APPDATA%\Code\User\workspaceStorage\<id>\chatSessions\*.jsonl (Windows)
~/Library/Application Support/Code/User/... (macOS)
~/.config/Code/User/... (Linux)
Each .jsonl is a delta log; the extension reconstructs each request and joins it with the
result metadata (promptTokens, outputTokens, resolvedModel) that Copilot writes for it.
Session titles are read from state.vscdb when the sqlite3 CLI is available; otherwise the
first prompt is used as the title. Token/AIC data does not depend on sqlite3 — it comes
straight from the .jsonl files.
Settings
| Setting |
Default |
Description |
githubCopilotReport.defaultFilter |
month |
Time range applied on startup: week, month, or all. |
githubCopilotReport.storagePath |
"" |
Custom path to the VS Code User folder (for Insiders/portable). |
githubCopilotReport.maxResults |
200 |
Max search results. |
githubCopilotReport.fuzzyThreshold |
0.4 |
Fuzzy search threshold (0 = exact … 1 = anything). |
githubCopilotReport.usdPerAic |
0.01 |
USD value of one AIC. Drives the $ estimate shown next to every AIC figure. GitHub's rate is 1 AIC = $0.01; change only if your plan differs. Takes effect after a Refresh. |
Where the conversion-rate numbers live (what to edit)
These are the numbers that decide the AIC → USD math. If you ever need to correct or tune them, this is exactly where:
| What it controls |
Change it at runtime (no rebuild) |
Change the built-in default (code) |
AIC → USD rate (the money knob, 1 AIC = $0.01) |
Setting githubCopilotReport.usdPerAic |
DEFAULT_USD_PER_AIC in src/modelPricing.ts |
Actual credits divisor (nanoAiu / 1e9) |
— |
NANO_AIU_PER_AIC in src/modelPricing.ts |
Which fields count as billed credits (nanoAiu, copilotUsageNanoAiu, the "X credits" text) |
— |
extractNanoAiu() / parseCreditsFromDetails() in src/chatHistoryProvider.ts |
After changing a setting, click ↻ Refresh in the panel to re-index with the new rate. After changing code, run npm run compile and reload the Extension Host.
Usage
- Open the Copilot Report icon in the activity bar.
- Pick a time range in the dropdown (defaults to This Month).
- Browse Recent Chats; expand a chat to see each prompt with its token/AIC badge.
- Click the ⬇ Excel button (or the export icon in the tree title bar) to save the report.
Keyboard: Ctrl+Alt+H (Cmd+Alt+H on macOS) to search.
Development
npm install
npm run compile # bundle to out/extension.js (esbuild)
npm run watch # rebuild on change
Press F5 in VS Code to launch an Extension Development Host.
Acknowledgments
This extension stands on the shoulders of two great open-source projects — thank you 🙏 It combines and builds on ideas from both:
- copilot-chat-history-search by @jeevananthamp16 — the foundation for reading and searching VS Code's local Copilot chat session files.
- github-copilot-chat-usage by @ailmind — this extension's AIC/USD accounting (
extractNanoAiu() in src/chatHistoryProvider.ts) mirrors that project's credit extraction logic field-for-field: the actual billed credits (nanoAiu / copilotUsageNanoAiu, or the "X credits" text in result.details) and the 1 AIC = $0.01 USD rate. No token × price estimate is used — a prompt without recorded credits shows — rather than a guess.
The chat-history search & parsing come from the first; the AIC → USD accounting model is a direct port of the second. This project merges the two and adds time filters, per-prompt token/AIC/USD badges, and Excel export.
License
MIT