feat(vscode): VS Code extension — live spend in status bar#40
Open
jakduch wants to merge 1 commit into
Open
Conversation
65bb17b to
ad772b6
Compare
e99a934 to
76c2f48
Compare
Polls the dashboard's /api/health + /api/data and renders today / month totals in the status bar. Click opens the dashboard in the default browser. Pure TypeScript, zero runtime deps. Adds: - vscode-extension/ subfolder with package.json, tsconfig, extension.ts, pricing mirror of pricing.py, README, .vscodeignore, vitest tests. - tests/test_vscode_extension.py structural smoke test so future contributors don't silently break the layout (193 tests still pass).
76c2f48 to
a0e3aab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this add and why do you believe it belongs in this dashboard?
A tiny VS Code extension that pins today's Claude Code spend (plus an MTD secondary) to the editor's status bar, sourced from the dashboard's existing
/api/dataendpoint. Click the indicator to open the dashboard, or runClaude Usage: Refresh Nowfrom the command palette. Polling cadence and dashboard URL are user-settable.This belongs in the dashboard repo, not a separate one, because it is a zero-context-switch surface for the same data the dashboard already serves. While you are coding — exactly when token spend is being generated — the running cost is one glance away in the status bar; you never alt-tab to a browser tab to remember what today is costing you. The extension is a thin client: no new pricing logic, no new storage, no new API. It mirrors
pricing.pyin TypeScript only so the status bar can keep rendering during a brief dashboard restart, and a Python structural test guards the layout so dashboard refactors don't silently break it.Checklist
Code correctness
calcCost()calls pass 6 arguments:(model, inp, out, cache_read, cache_creation, cache_1h)`), not escaped ones (\`)Tests
python3 -m unittest discover -s tests -v— all passingpython3 -m unittest tests.test_browser -v— all passingScope
dashboard.py,scanner.py,cli.py,pricing.py,cowork.py,tests/) — or I've explained below why a new file is needed