Happy AI — Copilot Credit CoachSee 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.
What you getLive status bar
Dashboard (
|
| 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 DashboardHappy AI: Show Saving TipsHappy AI: Compact Current Chat (/compact)Happy AI: Start a Fresh ChatHappy AI: Export Usage as CSVHappy 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.