Skip to content

feat(vscode): VS Code extension — live spend in status bar#40

Open
jakduch wants to merge 1 commit into
josepe98:mainfrom
jakduch:feat/vscode-extension
Open

feat(vscode): VS Code extension — live spend in status bar#40
jakduch wants to merge 1 commit into
josepe98:mainfrom
jakduch:feat/vscode-extension

Conversation

@jakduch
Copy link
Copy Markdown
Collaborator

@jakduch jakduch commented May 23, 2026

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/data endpoint. Click the indicator to open the dashboard, or run Claude Usage: Refresh Now from 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.py in 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

  • All calcCost() calls pass 6 arguments: (model, inp, out, cache_read, cache_creation, cache_1h)
  • JavaScript template literals use bare backticks (`), not escaped ones (\`)
  • No JS variables referenced before they are defined
  • No new third-party dependencies introduced

Tests

  • python3 -m unittest discover -s tests -v — all passing
  • python3 -m unittest tests.test_browser -v — all passing
  • New behaviour is covered by at least one test

Scope

  • This is a single concern — one feature or fix per PR
  • Only touches existing files (dashboard.py, scanner.py, cli.py, pricing.py, cowork.py, tests/) — or I've explained below why a new file is needed

New files explained: the extension lives entirely under a new vscode-extension/ directory because it is a separately-packaged VS Code artifact (its own package.json, tsconfig.json, and .vscodeignore are required by the VS Code packaging tooling and cannot live at repo root). It adds zero new runtime dependencies to the Python dashboard — devDependencies (typescript, vitest, @types) are TS build/test tooling local to the extension subdir, not deps shipped with the dashboard. A new test file tests/test_vscode_extension.py covers the extension's structural contract from the Python test suite, so a future rename inside vscode-extension/ that breaks the README install instructions will fail python3 -m unittest discover without anyone needing Node locally.

@jakduch jakduch force-pushed the feat/vscode-extension branch from 65bb17b to ad772b6 Compare May 24, 2026 19:26
@josepe98 josepe98 closed this May 25, 2026
@josepe98 josepe98 reopened this May 25, 2026
@josepe98 josepe98 closed this May 25, 2026
@josepe98 josepe98 reopened this May 25, 2026
@josepe98 josepe98 closed this May 25, 2026
@josepe98 josepe98 reopened this May 25, 2026
@josepe98 josepe98 closed this May 25, 2026
@josepe98 josepe98 reopened this May 25, 2026
@jakduch jakduch force-pushed the feat/vscode-extension branch from e99a934 to 76c2f48 Compare May 26, 2026 20:39
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).
@jakduch jakduch force-pushed the feat/vscode-extension branch from 76c2f48 to a0e3aab Compare May 26, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants