Copilot Usage Viewer
See your GitHub Copilot usage, and clean up old chat sessions without losing your stats.
Copilot Usage Viewer reads the chat session logs that VS Code keeps on your machine and turns them into a usage dashboard: an activity heatmap (2D and 3D) with KPI cards and a per-model breakdown. When session files pile up, the built-in Cleanup removes them with a dry-run preview first, while your usage history stays intact.
Runs locally. The extension reads local session files but retains only usage metadata. It does not store or transmit your prompts or Copilot's replies, and makes no network calls.

Getting started
- Install the extension.
- Click the status-bar item (bottom-right) to open the report panel. It scans your local logs with no configuration needed.

Everything else is available from the panel header (Refresh / Export / Cleanup) or the Command Palette (Copilot Usage: …).
| Action |
Effect |
| Click the status bar item |
Open the report panel |
| Panel Refresh |
Re-scan the local log files |
| Panel Export |
Save day/model rollup as Excel (.xlsx) |
| Panel Cleanup |
Preview and clean up ghost, empty, or archived chat sessions and logs |
| Panel period buttons |
Switch the aggregation range |
Copilot Usage: Show Report |
Open the report panel |
Copilot Usage: Refresh |
Re-scan |
Copilot Usage: Clean Up Chat Sessions |
Run cleanup (with dry-run preview) |
Why this extension
- Cleanup keeps your analytics. The extension persists usage stats to a concurrency-safe local cache (
usage-log.jsonl) as it scans sessions. Delete every old session file and your heatmap and model stats still survive. Reclaim disk space and keep your history.
- Dry-run preview. Cleanup shows you everything it will remove before touching any file.
- Fully local. Your data stays on your machine. No login, no cloud dashboard.
Features
Usage dashboard
- Status bar. Live turns/credits summary for your chosen period (this month, today, last 7 days, or total).
- Report panel
- GitHub-style daily activity heatmap for the last 12 months with a 2D / 3D toggle
- KPI cards: Turns / Sessions / Credits
- Model breakdown table (share and turns per model)
- Period filter: All / Year / Month / 30d / 7d / Today / Custom range
- Excel export. Save the daily rollup as an
.xlsx file.

Safe chat-session cleanup
VS Code accumulates chat session files, editing-session folders, transcripts, and Copilot logs over time. Cleanup removes the ones you no longer need:
- Ghost sessions. State DB entries whose session file no longer exists.
- Aged-out / archived sessions. No longer visible in the chat sidebar.
- Empty sessions. Created but never used.
- Copilot extension logs.
Three safeguards protect your data:
- Dry-run preview first. Before removing anything, a preview document lists every file and session marked for removal, and everything that will stay, with the reason.
- Fail-closed execution. If a required VS Code state entry is missing, corrupt, or in an unknown format, that workspace is skipped with a scan warning. The offline worker processes only the workspace, session IDs, and paths approved in the preview.
- Honest about limitations. VS Code must be closed to edit session state, so cleanup spawns a helper process, quits VS Code, applies the plan, and relaunches. Fatal worker errors are recorded and still enter the relaunch path. The extension skips sessions that VS Code has not flushed to disk. The preview states all of this upfront.
Settings
| Key |
Default |
Description |
copilotUsageViewer.refreshIntervalSeconds |
60 |
How often the status bar refreshes (seconds). |
copilotUsageViewer.scanAllVariants |
false |
Scan Stable, Insiders, and VSCodium together. |
copilotUsageViewer.statusBarMetric |
"thisMonth" |
Which period to show in the status bar (thisMonth / today / last7d / total). |
copilotUsageViewer.storageLocation |
"" |
Custom directory for the persistent usage cache. Set this to keep history across reinstalls. |
Privacy & security
- No prompt/reply retention. The extension reads local session files and retains only the timestamp, model, credits or multiplier, workspace display name, session ID, and request ID/index needed for aggregation and deduplication. Prompt and reply text is not stored or transmitted.
- No network calls. The extension reads and writes local files only.
- Local persistent cache. These usage fields are stored as plain-text JSONL under VS Code's global storage (configurable with the machine-scoped
copilotUsageViewer.storageLocation setting).
- Temporary cleanup preview. Session titles are used only in the local dry-run preview so deletion targets can be reviewed. The preview file is removed after confirmation or cancellation, and stale preview files are removed on the next activation.
How cleanup works (details)
VS Code stores chat session state in state.vscdb SQLite databases, caches them in memory, and rewrites them on shutdown. It provides no public API for deleting chat sessions. Any direct edits to those databases while VS Code runs get overwritten on exit. So Cleanup:
- Scans all workspaces and builds a deletion plan (no files removed yet).
- Shows the plan as a preview document and asks for confirmation.
- Spawns a detached helper process, quits VS Code, waits for it to exit, applies the plan, and relaunches VS Code.
Cleanup skips pinned sessions, non-empty sessions still visible in the sidebar, sessions not yet flushed to disk, and Copilot CLI sessions. A verified empty "New Chat" entry may be removed after the offline worker revalidates that it still contains zero requests.
Known limitations
- Local only. The extension reads files from the local filesystem. It does not work in Remote SSH, Remote Tunnels, or GitHub Codespaces environments.
- Startup activation. The extension activates on every VS Code startup to show the status bar item. The initial scan may take several seconds with a large history; subsequent scans reuse an in-memory mtime cache to minimize parsing and I/O.
- Undocumented storage format. VS Code's chat session format is not a public API and may change without notice in future releases.
Build from source
npm install
npm run compile
npx vsce package # → copilot-usage-viewer-*.vsix
Disclaimer
This is an unofficial community extension and is not affiliated with, endorsed by, or sponsored by GitHub or Microsoft. "GitHub Copilot" is a trademark of GitHub, Inc. The extension reads undocumented local storage formats that may change in future VS Code releases.
License
MIT