AI Session Metrics is a VS Code companion extension that provides real-time tracking of your AI assistant usage directly from the status bar. Keep track of live context sizes, token usage percentages, and costs across multiple AI tools, ensuring you always know how much context you are consuming.
Features
Live Status Bar Monitoring: See a real-time summary of your current session's token consumption in the VS Code status bar.
Detailed Metrics Panel: Click the status bar item (or run the AI Session Metrics: Show Details command) to open a comprehensive breakdown of all tracked sessions.
Multi-Provider Support:
Claude Code: Tracks context usage for local Claude Code sessions.
Gemini: Supports real-time monitoring of Gemini token usage and costs.
Codex: Monitors Codex thread history and usage metrics.
Smart Active Session Detection: Automatically filters out inactive sessions (older than 10 minutes) by tracking the exact timestamps of AI activity.
Cost Estimation: Estimates provider costs for input tokens, output tokens, and live context.
Installation
Via VS Code Marketplace:
Open VS Code and navigate to the Extensions view (Ctrl+Shift+X / Cmd+Shift+X).
Search for AI Session Metrics.
Click Install.
Via Command Palette:
Press Ctrl+P (or Cmd+P on Mac).
Type ext install namth587.ai-session-metrics and hit Enter.
Via VSIX (Manual Installation):
Download the latest .vsix file from the project.
In the VS Code Extensions view, click the ... menu in the top right.
Select Install from VSIX... and choose the downloaded file.
Configuration
You can customize the extension via your VS Code Settings (Ctrl+, or Cmd+, and search for "AI Session Metrics"):
Setting
Description
Default
aiSessionMetrics.[provider].enabled
Enable or disable metrics tracking for Claude, Gemini, or Codex.
true
aiSessionMetrics.[provider].inputCostPer1M
Set the input cost per 1M tokens for precise cost estimation.
Varies
aiSessionMetrics.[provider].outputCostPer1M
Set the output cost per 1M tokens for precise cost estimation.
Varies
Getting Started
Ensure you have your preferred AI tools running locally (Claude, Gemini, Codex).
The extension will automatically detect the active sessions and start parsing the underlying .claude/projects/ JSONL logs, .gemini/ transcripts, and .codex/ SQLite database files to extract real-time metrics.
Check your status bar!
Requirements
VS Code ^1.90.0 or higher.
Active usage of Claude Code, Gemini, or Codex in your workspace for data to populate.
Building / Contributing
If you want to compile and modify the extension locally:
npm install
npm run compile
# Package to VSIX
npm run package