Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>Happy AI — Copilot Credit CoachNew to Visual Studio Code? Get it now.
Happy AI — Copilot Credit Coach

Happy AI — Copilot Credit Coach

Happy Mates

|
14 installs
| (0) | Free
See exactly how your GitHub Copilot AI credits are spent — per message, session and model — and get timely, data-backed advice (compact now, start fresh, switch model) to spend less.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Happy AI — Copilot Credit Coach

See where your GitHub Copilot AI credits go — and spend fewer of them.

GitHub Copilot bills chat and agent work in AI credits (1 credit = $0.01), priced per token and per model. In agent mode a single message can trigger dozens of model rounds, and every round re-reads the entire conversation. Costs climb quietly as a session grows.

Happy AI reads the session logs Copilot Chat already keeps on your machine and turns them into a live picture of your spending, plus concrete, quantified advice on when to compact, when to start fresh, and when a cheaper model would do.

Nothing leaves your computer. No account, no telemetry, no network calls.

What you get

Live status bar

⚡ 1.2k cr · 340k ctx — credits spent in the current session and how big its context has become. Turns orange/red when a tip needs attention. Hover for today / month / latest session and one-click actions.

Dashboard (Happy AI: Open Credit Dashboard)

  • Totals for today, last 7 days, this month and all indexed history — in credits and dollars.
  • Averages per message: overall, last 30 days and for the current session; median and max.
  • Month pacing against your plan's allowance (Pro 1,500 · Pro+ 7,000 · Max 20,000, or a custom budget) with an end-of-month projection.
  • Latest session drill-down: credits per turn, context growth line, prompt composition (system / tool definitions / messages / tool results), rounds per message, cost trend.
  • Credits per day, by model (7 d / 30 d / all) with the price of each model, most expensive sessions and by workspace.
  • Export CSV of every turn for your own analysis.

Proactive, quantified tips

Each tip is derived from your data and estimates the saving:

Tip Trigger What it tells you
Compact now Context ≥ 120k tokens (configurable) Cost per round for re-reading the context, what compaction costs once, expected saving per message and after how many messages it pays back
Session getting expensive ≥ 40 messages, ≥ 3 h, or the last 5 messages cost ≥ 2× the first 5 Suggests finishing the step and starting a fresh chat with a short hand-over
Cold cache You resumed a large session after > 5 min idle The first round re-writes the prompt cache at the (much higher) write price — estimated extra cost, and how to avoid it
Tool results heavy Tool output ≥ 40 % of the prompt Read line ranges, pipe through head/grep, delegate exploration to a subagent
Tool definitions heavy Tool schemas ≥ 12 % of every round Deselect unused MCP servers / tool sets for this chat
Quick questions on premium models Short prompts, ≤ 2 tool calls, on very-high-priced models What the same week would have cost on a medium model
Auto discount Manual picks of models that are 10 % cheaper via Auto Credits left on the table this month
Terminal auto-turns Background commands waking the agent How much those unattended turns cost
Budget pace Plan set and projection exceeds allowance Projected overage in dollars

Warnings appear as notifications (rate-limited, mutable, fully optional) with direct actions: Compact now puts /compact in the chat input, Start fresh chat opens a new session.

How it works

Copilot Chat stores every session as a JSON log under VS Code's user data folder (…/User/workspaceStorage/*/chatSessions/*.jsonl). Since usage-based billing, each turn records copilotCredits, promptTokens, completionTokens, a prompt-composition breakdown, the model, tool calls and timings. Happy AI indexes those files incrementally (a persistent cache keeps restarts fast), watches them for changes, and reads Copilot's own models.json for current per-token prices — falling back to a built-in price snapshot.

Estimates for compaction and cold-cache costs use the published cache-read / cache-write / input prices per model and your session's recent rounds-per-message. They are estimates, not invoices — the dashboard footer shows which price source is in use.

Settings

Setting Default Purpose
happyAi.plan none pro / proPlus / max / custom — enables month pacing
happyAi.monthlyCreditAllowance 0 Allowance for custom
happyAi.showDollars true Show USD next to credits
happyAi.statusBar.enabled / .mode true / session Status bar on/off; show session, today or month
happyAi.notifications.enabled true Proactive warnings
happyAi.notifications.cooldownMinutes 30 Minimum gap between repeats of the same warning
happyAi.thresholds.compactPromptTokens 120000 When to suggest compaction
happyAi.thresholds.criticalPromptTokens 300000 When the suggestion becomes a warning
happyAi.thresholds.sessionMessages / .sessionHours 40 / 3 Long-session warning
happyAi.cacheTtlMinutes 5 Assumed prompt-cache lifetime for cold-cache estimates
happyAi.historyDays 365 Only index sessions modified within this window
happyAi.additionalSessionDirectories [] Extra chatSessions folders to index

Commands

  • Happy AI: Open Credit Dashboard
  • Happy AI: Show Saving Tips
  • Happy AI: Compact Current Chat (/compact)
  • Happy AI: Start a Fresh Chat
  • Happy AI: Export Usage as CSV
  • Happy AI: Rescan Copilot Sessions / Rebuild Index (Full Rescan)

Privacy

Happy AI only reads files inside your VS Code user-data folder and writes one cache file to its own extension storage. Message previews (first 140 characters) are kept in that cache so sessions can be labelled; nothing is transmitted anywhere.

Development

npm install
npm run build        # bundle to dist/extension.js
npm test             # node:test unit tests (parser, stats, advisor)
npm run typecheck
npm run package      # .vsix via @vscode/vsce

Press F5 to launch an Extension Development Host. Logs: Output → Happy AI.

Requirements

VS Code ≥ 1.104 with GitHub Copilot Chat. Credit data is only present for sessions created after Copilot switched to usage-based billing; older sessions show messages but no credits.


Made by Happy Mates. MIT licensed.

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