Skip to content
| Marketplace
Sign in
Visual Studio Code>Data Science>Prompt MetricsNew to Visual Studio Code? Get it now.
Prompt Metrics

Prompt Metrics

Eng. Mohamed Bayomi

|
7 installs
| (0) | Free
Live token, LoC and context-window stats for every GitHub Copilot Chat prompt
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Prompt Metrics

Live token, LoC and context-window stats for every GitHub Copilot Chat prompt — right inside VS Code.

Ever wonder how many tokens that "quick refactor" actually burned? Or how close you are to filling the context window? Prompt Metrics sits next to Copilot Chat and shows you the truth — in real time, with a colorful themed panel.

icon

Features

📊 Live status bar

At a glance: total session tokens, lines added / removed, context %.

📊 12.4k tok · +320/-45 · ctx 6.2%

🧠 Context window gauge

See exactly how much of your model's context window is used. Supports Claude (Opus/Sonnet), GPT-4o, GPT-4.1, GPT-5, o-series — auto-picks the right limit per model.

📅 Current session

  • Prompt tokens, response tokens, total tokens
  • Lines of code added / removed (parsed from Copilot's edit tool calls)
  • Files touched, tool calls, turn duration

♾️ Lifetime stats

Aggregated across every Copilot Chat session you've ever had on this machine.

📜 Per-turn table

Drill down to every prompt in the current session with previews, token counts, LoC deltas, and durations.

How it works

Prompt Metrics reads Copilot Chat's local transcript JSONL files (the same data Copilot writes for itself) and uses tiktoken for accurate token counts. No telemetry. No data leaves your machine.

Requirements

  • VS Code 1.85+
  • GitHub Copilot Chat extension (this extension reads its transcript files)
  • Python 3.10+ — used internally for parsing & token counting

On first launch the extension will automatically install tiktoken via pip install --user tiktoken. If pip is unavailable, it falls back to a len(text)/4 token approximation.

If Python is not installed, you'll get a notification with a link to python.org.

Usage

  1. Install the extension
  2. Wait for the 📊 PM item to appear in the status bar (bottom-right)
  3. Click it (or run Prompt Metrics: Open Panel from the command palette) to open the rich side panel
  4. Use Copilot Chat as normal — stats update every 3 seconds

Commands

Command Action
Prompt Metrics: Open Panel Opens the metrics panel
Prompt Metrics: Refresh Force-refresh data
Prompt Metrics: Install/Repair Dependencies Re-run the Python dependency bootstrap

Settings

Setting Default Description
promptMetrics.pythonPath (auto) Override Python interpreter
promptMetrics.model claude-opus-4 Model hint for context-window limit (claude-sonnet-4, gpt-4o, gpt-4.1, gpt-5, o1, …)
promptMetrics.contextLimit 200000 Manual context window override in tokens

Privacy

Prompt Metrics is fully local. It reads files from:

  • Windows: %APPDATA%\Code\User\workspaceStorage\<hash>\GitHub.copilot-chat\transcripts\
  • macOS: ~/Library/Application Support/Code/User/workspaceStorage/.../
  • Linux: ~/.config/Code/User/workspaceStorage/.../

Nothing is sent to any server. Nothing is uploaded. Disable the extension to stop reading the transcripts immediately.

Known limitations

  • Context % is a lower bound. Copilot also sends a system prompt, tool schemas, and pulled-in file context that this extension cannot see. Treat the percentage as a minimum used.
  • LoC counts are derived from tool-call arguments (create_file, replace_string_in_file, multi_replace_string_in_file, edit_notebook_file). Edits done outside Copilot's tools aren't counted.
  • Linux/macOS support is experimental — primarily tested on Windows.

License

MIT — Mohamed Bayomi

Contributing

Issues and PRs welcome at the GitHub repository.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft