💳 Claude Prompt MeterSee exactly what every Claude Code prompt costs — right in your status bar.English · ไทย Per‑prompt token & cost breakdown, a session dashboard with a one‑year spend heatmap, automatic per‑model pricing, daily budgets, and a bilingual Thai / English UI. All from Claude Code's own local logs — no API key, no network, no telemetry.
The status bar, updated live as Claude Code works. Click it to open the dashboard. 📑 Table of contents
👋 What is this?Claude Code writes a detailed log of every session to
your machine (one Claude Prompt Meter reads those logs and turns them into numbers you can actually use: what each prompt cost, how much you've spent today, which prompts were expensive, and how your spend trends over the year. It never talks to the API — it just reads files Claude Code already wrote.
✨ Features
🖼️ The dashboard
Overview cards, a one‑year spend heatmap, a per‑prompt cost sparkline (click a bar to jump to its row), and a per‑prompt table with color‑coded model badges — all from your local logs. Open it in the editor or dock it in the sidebar. 📦 InstallationFrom the Marketplace
From a
|
| Command | What it does |
|---|---|
| Open Dashboard | Full dashboard in the editor (also: click the status‑bar meter, or the gauge icon in the Activity Bar). |
| Set Daily Budget | Enter a USD amount (leave blank to remove). Also reachable by clicking the budget card. |
| Reset Counter | Start counting this session from now (see How reset works). |
| Toggle Language (Thai / English) | Switch the UI language instantly. |
| Refresh | Re‑read the logs (rarely needed — it updates on its own). |
Everything updates live (within ~1.5 s) as Claude Code writes to the session log.
🧠 How it works
~/.claude/projects/<your-workspace>/<session-id>.jsonl
│
├─ reads token usage + model from each "usage" block
├─ groups roundtrips back into the prompt that triggered them
├─ prices each token type by the model that produced it
└─ renders the status bar, dashboard, heatmap & sparkline
The workspace's log folder is resolved automatically from the folder you have open, so the same build works on any machine and for any user — there is no path to configure.
💰 Pricing & models
Pricing is detected per prompt from the model recorded in the log, so a session that switches from Sonnet to Opus is costed correctly throughout. Rates (USD per 1M tokens):
| Model | Input | Output |
|---|---|---|
| Opus 4.8 / 4.7 / 4.6 | $5 | $25 |
| Sonnet 4.6 / 4.5 | $3 | $15 |
| Haiku 4.5 | $1 | $5 |
| Fable 5 / Mythos 5 | $10 | $50 |
| Legacy 3.x (Opus / Sonnet / Haiku) | — | — |
Cache‑read and cache‑creation tokens are priced at each model's standard cache rates. For unknown or custom models, the fallback rates in Settings are used.
⚙️ Settings
Settings → Extensions → Claude Prompt Meter
| Setting | Default | Description |
|---|---|---|
claudePromptMeter.budget.dailyUsd |
null |
Daily budget in USD; shown as a % in the tooltip and dashboard. |
claudePromptMeter.pricing.inputPerMillion |
3 |
Fallback input rate for unknown models. |
claudePromptMeter.pricing.outputPerMillion |
15 |
Fallback output rate. |
claudePromptMeter.pricing.cacheReadPerMillion |
0.3 |
Fallback cache‑read rate. |
claudePromptMeter.pricing.cacheCreatePerMillion |
3.75 |
Fallback cache‑write rate. |
💡 You normally don't need to touch pricing — known models are priced automatically. The fallback only kicks in for a model the extension doesn't recognize.
🔁 How reset works
Reset is non‑destructive and per‑session. It records a timestamp for the session you're viewing and simply hides the prompts before it, so the cost/budget counters start fresh from that point.
- ✅ Only affects the session you're looking at — every other session keeps its full totals.
- ✅ Never deletes or edits any log file.
- ✅ Survives reloads and restarts.
ℹ️ The extension can't create a new Claude session (only Claude Code does that on
/clear), so reset is a fresh count within the same session, not a new entry in the session dropdown.
🔒 Privacy
- No network calls. The extension never contacts the Anthropic API or any server.
- No telemetry. Nothing is collected or sent.
- Read‑only. It only reads Claude Code's local
*.jsonllogs; it never writes to them. - All settings (language, budget, resets) live in your own VS Code profile.
🖥️ Requirements & platform support
- VS Code 1.95 or newer.
- Claude Code — the data comes from its session logs under
~/.claude/projects.
⚠️ Platform support — please read. Development and testing have been on Windows. macOS and Linux are fully supported in the code (the log folder is resolved by matching the recorded working directory, which handles case‑sensitive filesystems), but they are not yet hardware‑tested. On macOS/Linux, if the meter shows “waiting…”, make sure the folder you opened is the same one you use with Claude Code. Reports are very welcome.
❓ FAQ
The status bar says “waiting…” — why? The open folder has no Claude Code session yet, or it isn't the folder you run Claude Code in. Open the project folder you actually use with Claude Code; the meter appears once a session log exists.
Do the numbers match my real Anthropic bill? They're computed from the same token counts Anthropic records in the logs, priced at the published per‑model rates — so they're an accurate estimate of usage‑based cost. They don't account for plan credits, discounts, or taxes.
Does it work without an API key? Yes. It reads local files only; there's nothing to authenticate.
Why doesn't the extension show an icon in the sidebar by default? It does — a small gauge icon in the Activity Bar opens the dashboard. The meter itself lives in the status bar (bottom‑right).
Can I use it with multiple projects / multiple users? Yes. It tracks whichever workspace you have open, and all state is per‑VS Code‑profile, so different users on the same machine stay separate.
📄 License
MIT © ryukenshin546-a11y