Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>Claude Code & Codex Usage by Paweł HurynNew to Visual Studio Code? Get it now.
Claude Code & Codex Usage by Paweł Huryn

Claude Code & Codex Usage by Paweł Huryn

Paweł Huryn

|
3,256 installs
| (1) | Free
See Claude Code and Codex token counts, estimated costs, sessions, and projects inside VS Code. Usage data stays on your machine.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Claude Code & Codex Usage — VS Code extension

License: MIT

See Claude Code and Codex tokens, estimated costs, sessions, and projects inside VS Code.

Hourly distribution, models and top projects

The extension reads local Claude Code transcripts and Codex rollouts and embeds the Python dashboard in the VS Code sidebar. Your usage data stays on your machine. The extension sends an anonymous event when you open the sidebar, subject to your telemetry settings. Privacy details.

Captures usage from the Claude Code CLI, the official Claude Code VS Code extension, dispatched Code sessions, and Codex CLI rollouts. When Codex usage is present, use the Tool filter to view either tool or both.


What it shows

  • Claude Code and Codex side by side: a Tool filter shows either tool or both, and the session, project and branch tables name the tool on each row
  • Daily token usage and average hourly distribution charts, with Anthropic's peak hours shaded for Claude Code
  • Daily cache hit rate and the share of estimated cost spent on cache writes
  • Cost by model, project, and project + branch tables, plus Recent Sessions — sortable, paged, and CSV-exportable
  • Subagent attribution — a Subagent Tokens by Type chart and a Top Subagent Dispatches table that break dispatched Task/Agent usage out from your main sessions
  • Model multi-select, a Tool filter and a date-range dropdown to scope everything at once
  • A sticky section nav for jumping between sections, and collapsible chart/table cards that remember what you've folded away across reloads

Estimates use Anthropic and OpenAI standard API prices. Claude Pro/Max and ChatGPT subscription charges follow your plan.


Install

From the VS Code Marketplace

Search the Extensions sidebar for "Claude Code Usage" (publisher: PawelHuryn), or open it directly:

Install from the VS Code Marketplace →

See in Open VSX Registry →

From a prebuilt .vsix (no build step)

Every GitHub Release attaches a ready-built .vsix. Download it, then either drag it onto the VS Code Extensions view, or run:

code --install-extension claude-usage-phuryn-<version>.vsix

Build and install from source

Use Node.js 22 or newer to build from source. Clone the repo and run the install script for your platform. On each build, the script runs npm ci --include=dev to install the locked build dependencies, builds a .vsix with npm run package, and installs it via code --install-extension. To install a prebuilt .vsix with a script, pass its path as the first argument.

macOS / Linux / WSL (bash):

git clone https://github.com/phuryn/claude-usage
cd claude-usage/vscode-extension
./scripts/install.sh

Windows (PowerShell or Git Bash):

git clone https://github.com/phuryn/claude-usage
cd claude-usage/vscode-extension
powershell -ExecutionPolicy Bypass -File ./scripts/install.ps1

Requirements

  • Python 3.8 or newer on your PATH. Almost everyone running Claude Code already has Python installed; if not, see python.org/downloads. On Windows make sure to check "Add Python to PATH" during the installer.

That's the only dependency. The Python sources (cli.py, scanner.py, dashboard.py) are bundled inside the extension — no separate clone or Homebrew install needed.


Usage

  1. Click the gauge icon in the activity bar (left sidebar of VS Code).
  2. The extension starts the dashboard server on a free local port and embeds it in a sidebar webview.
  3. Filter by model, tool or date range — same UI as the standalone web dashboard.

Cost by project, with the tool for each row

Commands

Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

Command What it does
Claude Usage: Open Dashboard Reveal the sidebar and start the server (also fires automatically when you click the activity-bar icon)
Claude Usage: Rescan Transcripts Refresh the iframe; the dashboard's own Rescan button runs an incremental scan that adds new usage without touching existing history
Claude Usage: Restart Server Kill and respawn the Python process (use after changing settings)
Claude Usage: Show Logs Open the extension's output channel — useful when something doesn't work

Settings

Setting Default Description
claudeUsage.pythonPath (auto-discover) Path to a Python 3.8+ interpreter. Leave empty to auto-detect (claude-usage on PATH first, then python3, then python).
claudeUsage.cliPath (bundled) Path to a custom cli.py (or its parent directory). Empty = use the bundled copy that ships with the extension.
claudeUsage.port 0 Port for the local dashboard server. 0 = OS picks a free one.
claudeUsage.telemetry.enabled true Send an anonymous sidebar-opening event when the editor allows usage telemetry. Set to false to opt out immediately.

How discovery works

When you click the icon, the extension resolves how to run the dashboard in this order:

  1. claudeUsage.cliPath setting if you've set one
  2. The bundled python/cli.py that ships inside this .vsix (most installs hit this)
  3. The claude-usage shim on PATH (if you installed via Homebrew)
  4. A cli.py in any open VS Code workspace folder (the legacy "open the cloned repo" path)
  5. A sibling cli.py from the extension dir (dev mode, when running from source via F5)

If none of those find anything, you'll get a friendly message in the sidebar — most often "Python 3.8+ is required" with a platform-specific install hint.


Privacy

The extension reads local Claude Code transcripts and Codex rollouts and serves the dashboard on 127.0.0.1. Your transcripts, token counts, costs, sessions, and projects stay on the machine running the extension. The webview loads Chart.js from jsDelivr and verifies its integrity.

When usage telemetry is enabled, opening the official extension's sidebar sends a random install ID and editor environment to Aptabase in the EU. Disable claudeUsage.telemetry.enabled to opt out. The extension also respects the editor's usage telemetry setting. See the fields and network requests in the privacy guide.


Troubleshooting

  • "Python 3.8 or newer required" — install from python.org and reload VS Code (Ctrl+Shift+P → Developer: Reload Window). On Windows make sure "Add Python to PATH" is checked in the installer.
  • Sidebar stays blank or shows "starting…" — run Claude Usage: Show Logs. The extension logs the resolved Python path, the install mode, the spawn command, and any stdout/stderr from the server.
  • Dashboard renders but shows "No usage recorded" — Run a Claude Code or Codex session, then rescan. The default Codex directory is ~/.codex/sessions/. For a custom location, set CODEX_HOME in the environment where the extension runs.

Source

The Python tool, this extension, and a Homebrew formula all live at github.com/phuryn/claude-usage. Bug reports and feature discussions: Issues, Discussions.

Made by The Product Compass Newsletter.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft