token-dashboard
Open the Token Optimizer dashboard in your browser (context usage, quality, savings). Use to view the dashboard.
By alexgreensh · 369 installs
npx skills add alexgreensh/token-optimizer --skill token-dashboard
Source repository · Upstream listing
Token Optimizer Dashboard
Answers what a session cost from the user's own words, and opens an up to date dashboard of context usage, quality, session history and skills. Open the dashboard only when the user asks to see it; a cost question never opens a browser.
Instructions
1. Resolve runtime and measure.py path :
2. A cost question ("what did the Garden session yesterday cost?", "how much were my TR sync sessions?", "cost of session <id "): run this instead of steps 3 4.
Pass the user's own words ( garden yesterday , tr sync , an id or its first 8 characters). Names match topic, slug and project, case insensitively, and all of them must match; today , yesterday and YYYY MM DD set the day. Add days N for "this week" (default 30), limit N to list more.
Answer from sessions[] : date, topic, cost usd.total , the main thread and subagent split when subagents ran, cost usd.on date when a day was asked and the session ran over several days, and partial reason when set. Several matches: give total cost usd and list them, asking which one only when it changes the answer.
State basis in one line: API list prices, so on a subscription it is what the work would have cost, not a bill.
No match: say so, show closest[] , and pass on note (a session is collected when it ends).
Never query trends.db or price tokens yourself: this is the dashboard's own number, read without writing.
3. Collect and open :
This collects the latest session data into the trends database, regenerates the dashboard HTML, and opens it in your default browser.
4. Tell the user the dashboard is open. Probe the daemon before mentioning any URL:
Probe daemon: python3 "$MEASURE PY" daemon status 2 /dev/null
If DAEMON RUNNING: lead with URL: http://localhost:24842/token optimizer (bookmarkable, auto updates), then mention the file fallback.
If DAEMON NOT RUNNING: do not print the localhost:24842 URL. Tell the user the dashboard opened as a file, and suggest python3 $MEASURE PY setup daemon (macOS and Windows) if they want a bookmarkable URL.
File path: never hardcode it. It is install dependent. Cite the Dashboard: line from the step 3 output.
For Codex when DAEMON NOT RUNNING: do not imply the Claude daemon is required; the generated file works, and Stop hooks refresh it when balanced hooks are installed.
Written for and checked on Claude Opus 5.5 and Sonnet 5.5, and GPT 5.6 on Codex.