Claude Code & Codex Usage — VS Code extensionSee Claude Code and Codex tokens, estimated costs, sessions, and projects inside VS Code.
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
Estimates use Anthropic and OpenAI standard API prices. Claude Pro/Max and ChatGPT subscription charges follow your plan. InstallFrom the VS Code MarketplaceSearch the Extensions sidebar for "Claude Code Usage" (publisher: Install from the VS Code Marketplace → From a prebuilt
|
| 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:
claudeUsage.cliPathsetting if you've set one- The bundled
python/cli.pythat ships inside this.vsix(most installs hit this) - The
claude-usageshim onPATH(if you installed via Homebrew) - A
cli.pyin any open VS Code workspace folder (the legacy "open the cloned repo" path) - A sibling
cli.pyfrom 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, setCODEX_HOMEin 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.

