Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>PromptmeterNew to Visual Studio Code? Get it now.
Promptmeter

Promptmeter

Mrugank Vora

|
2 installs
| (0) | Free
Pre-flight token count and cost estimation for Cursor / VS Code. Supports Claude, GPT-4o, Cursor Composer, and more.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Promptmeter

Pre-flight token count and cost estimation for Cursor / VS Code — before you hit send.

Features

  • Live status bar — token count and estimated cost updates as you type, on every file
  • Clipboard auto-watcher — copy your prompt anywhere → cost estimate appears instantly (no button press)
  • Sidebar panel — model picker, cursor mode selector, output size override, cost breakdown, pool burn tracker
  • Cursor mode presets — Ask / Edit / Agent / Debug / Plan — each with tuned output token and step estimates
  • Output size override — Minimal / Low / Auto / Large / XL — fine-tune output token estimate on top of mode default
  • Cursor-native models — Composer 1.5, Composer 1, and Auto (plan) all supported
  • Auto mode shadow pricing — shows what a turn would cost, with 2.6–3.6× Cursor overhead range
  • Attach files — pick specific files to include in token count (simulates @file context)
  • Smart folder scan — top 30 most-recently-modified files (simulates Cursor codebase retrieval) or full folder scan
  • Cache cost row — shows estimated cost with Cursor prompt caching vs cold
  • Max mode surcharge — toggle +20% for Cursor overage billing
  • Cursor hooks — logs every agent turn to ~/.cursor-preflight/usage.log automatically
  • Usage Log tab — turn counts by model, project, and day; monthly pool burn tracker
  • Live prices — fetched from OpenRouter at startup, falls back to hardcoded table offline

Supported Models

Model Input $/1M Output $/1M
Cursor Composer 1.5 $3.50 $17.50
Cursor Composer 1 $1.25 $10.00
Cursor Auto covered covered
Claude Sonnet 4.5/4.6 $3.00 $15.00
Claude Opus 4.5/4.6 $15.00 $75.00
Claude Haiku 4.5 $0.80 $4.00
GPT-4o $2.50 $10.00
GPT-4o Mini $0.15 $0.60
o1 $15.00 $60.00
Gemini 2.0 Flash $0.10 $0.40
+ 300+ via OpenRouter live feed

Install

# One-time: install the VS Code packager
npm install -g @vscode/vsce

# Package the extension
cd token-preflight
vsce package --no-dependencies

# Install in Cursor
cursor --install-extension promptmeter-0.2.0.vsix

# Or in VS Code
code --install-extension promptmeter-0.2.0.vsix

Restart Cursor. You'll see:

  • A speedometer icon in the left activity bar
  • A token counter in the bottom-right status bar
  • A 📋 clipboard status bar item (appears after first copy)
  • A ✓ hooks / ⊘ hooks indicator

Keyboard Shortcut

Shortcut Action
Cmd+Shift+T (text selected) Estimate selection
Cmd+Shift+T (nothing selected) Estimate clipboard

Workflow

Draft prompt (file, editor, or anywhere)
        ↓
Copy it  →  📋 status bar updates in 1.5s
        ↓
Sidebar auto-fills + estimates
        ↓
Cost OK?  →  paste into Cursor agent box  →  send
Cost high? →  trim prompt  →  repeat
        ↓
After agent finishes  →  hook logs the turn

Setup Cursor Hooks (Usage Log)

  1. Open the sidebar panel (speedometer icon)
  2. Click Usage Log tab
  3. Click ⚙ Setup Cursor Hooks
  4. Done — every agent turn is now logged to ~/.cursor-preflight/usage.log

Or run from Command Palette: Promptmeter: Setup Cursor Hooks

Settings

Setting Default Description
tokenPreflight.defaultModel claude-sonnet-4-5 Default model
tokenPreflight.warnThresholdUsd 0.01 Warn if cost exceeds this
tokenPreflight.watchClipboard true Auto-estimate on clipboard change
tokenPreflight.maxModeSurcharge false Apply Cursor +20% Max mode markup
tokenPreflight.agentSteps 1 Default agent steps multiplier

Token Accuracy

Model family Method Typical accuracy
Claude Character-based BPE approximation ±5–8%
GPT-4o / o1 Character-based BPE approximation ±3–5%
Cursor Composer Same as Claude (same tokenizer family) ±5–8%
Gemini Character-based approximation ±6–10%

For exact Claude token counts, use Anthropic's count_tokens API (free, rate-limited separately from inference).

Privacy

  • No data leaves your machine except the OpenRouter price fetch (GET request, no prompt content)
  • Usage log is stored locally at ~/.cursor-preflight/usage.log
  • Clipboard text is processed entirely in-process; never sent anywhere
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft