token-dashboard
Skill9 starsChanged 4 months agoMITView on GitHub
Read-only current-session and UTC-week token telemetry dashboard for Pi, Claude Code, Codex, and optional OpenRouter management analytics.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- alexgreensh/token-optimizertheir own version, first seen Jun 2, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- alexgreensh/token-optimizer★ 2.5ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository74 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architectSkill
- artifact-hygieneSkill
- backlog-groomSkill
- beads-check-dolt-migrationSkill
- beads-migrate-to-doltSkill
- beads-setupSkill
- beadsSkill
- breakdownSkill
- browser-screenshotSkill
- circleci-statusSkill
- clean-codeSkill
- complete-taskSkill
- confluenceSkill
- contract-checkSkill
- contract-testSkill
- create-prSkill
- delegate-workSkill
- developSkill
- diagnose-bugSkill
- do-i-need-thisSkill
- eas-build-errorSkill
- handoffsSkill
- handoffs-tidySkill
- image-studioSkill
- implement-solutionSkill
- jira-commentSkill
- jira-ticketSkill
- landscapeSkill
- model-update-checkSkill
- name-sessionSkill
- nextSkill
- outstanding-workSkill
- pedantic-reviewSkill
- peer-sessionSkill
- pickupSkill
- pi-spendSkill
- plan-daySkill
- plan-to-backlogSkill
- project-briefSkill
- pr-statusSkill
- ready-to-mergeSkill
- ready-to-releaseSkill
- rebaseSkill
- release-maintenanceSkill
- release-managerSkill
- release-statusSkill
- reply-commentsSkill
- review-commentsSkill
- review-prSkill
- sanity-checkSkill
- second-opinionSkill
- setup-multirepo-gitSkill
- skills-reviewSkill
- stack-branchSkill
- start-ticketSkill
- thoughtboxSkill
- tidy-settingsSkill
- todaySkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Do not replace the collector with ad-hoc transcript reads or provider calls.
- Distinctive: line 42
Do this even when the Bash tool card already contains the same output or Pi collapses earlier lines.
- Distinctive: line 43
Do not summarize, paraphrase, reformat, truncate, or replace stdout with a success message.
- Very specific: line 45
Use a json fence for --json and a plain-text fence otherwise.
- Distinctive: line 49
After the verbatim block, add an Analysis section of two to four concise bullets (at most 120 words total):
- Distinctive: line 59
Do not call high token volume good or bad without workload context.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Token Dashboard
Show read-only token telemetry for the current session and current UTC calendar week. The week starts
Monday at 00:00 UTC. This skill has no /usage alias and does not modify transcripts or settings.
Usage
/token-dashboard # terminal dashboard; optional OpenRouter analytics when configured
/token-dashboard --offline # local telemetry only; guarantees no network
/token-dashboard --json # normalized schema v1 JSON
/token-dashboard --json --offline # machine-readable local-only report
/token-dashboard --session-id ID # explicitly select a known local session; the ID is never emittedResolve scripts/token_dashboard.py relative to this SKILL.md, then run the executable with the
user's arguments. Pi can load the managed Claude/Codex skill directory through its configured skills
path, and the collector remains compatible with Pi telemetry:
/path/to/token-dashboard/scripts/token_dashboard.py --offline
/path/to/token-dashboard/scripts/token_dashboard.py --jsonDo not replace the collector with ad-hoc transcript reads or provider calls. Never call this skill
/usage.
Output contract
The final response must paste the collector's complete stdout verbatim in a fenced code block.
Do this even when the Bash tool card already contains the same output or Pi collapses earlier lines.
Do not summarize, paraphrase, reformat, truncate, or replace stdout with a success message. Preserve
all Current session, Week, and Sources rows, including unavailable and partial diagnostics.
Use a json fence for --json and a plain-text fence otherwise. Do not alter the block itself.
Analysis contract
After the verbatim block, add an Analysis section of two to four concise bullets (at most 120 words total):
- summarize current-session requests and recorded total; when both counters are available, identify cache-read share as telemetry rather than cost;
- identify the largest week-to-date rows whose
totalis available, without treating rows with an unavailable total as zero; - explain partial, estimated, or unavailable data using the reported source diagnostics; and
- mention one actionable setup issue, such as a missing OpenRouter management key, only when present.
Do not call high token volume good or bad without workload context. Do not describe local telemetry as
billing, spend, quota, or subscription allowance. Respect subset semantics: reasoning is already part
of output where marked, and cached input may already be part of input where marked. If the harness
requires a Next: line, append it after the analysis.
Setup and source authority
The stdlib-only collector reads these telemetry roots recursively:
- Claude Code:
~/.claude/projects/**/*.jsonl; only top-level assistantmessage.usageis authoritative. Parent, subagent, and extra-agent transcripts are globally deduplicated. - Pi:
~/.pi/agent/sessions/**/*.jsonl; official assistant-message usage is authoritative. Parent sessions and linked nested child runs are deduplicated. - OpenAI Codex:
~/.codex/sessions/**/*.jsonl; rolloutevent_msg/token_countcumulative counters are authoritative and converted to duplicate-suppressed deltas. - OpenRouter, optionally: Management Analytics API metadata plus one UTC-week query. Set
SECRET_API_KEY_PROJECTand storeopenrouter_managementwithsecret-api-key; an explicitOPENROUTER_MANAGEMENT_API_KEYremains supported.OPENROUTER_API_KEYis inference-only and is never sent.
The collector never reads auth files. It does not emit or persist credentials, prompts, responses,
tool output, raw transcript lines, session/message IDs, file paths, or raw API error bodies.
OpenRouter requests use the fixed https://openrouter.ai origin, reject redirects, bound response
size and timeout, and do not retry. --offline performs no network request even when a management
key exists.
See telemetry sources and authority for upstream evidence, retention, authentication, period semantics, exactness definitions, and the prior-art decision.
Reading the report
Terminal output always has Current session, Week, and Sources sections. Generated and period times use readable UTC labels. Each usage section states its scope, period, timezone, and selection once, followed by a compact table containing source, harness, provider, model, agent, exactness, request count, and nullable token counters. Source status is tabular; complete diagnostics wrap below it. Control characters in displayed model and agent values are replaced. Unavailable sources remain visible and do not make healthy sources fail.
JSON output uses normalized schema version 1 with:
generatedAtandperiodsforcurrent-sessionandweek;- UTC start/end boundaries, completeness, and current-session selection precision;
sourceswith status, exactness, detail, and authority;- flat
usagerows with nullableinput,output,cacheRead,cacheWrite,reasoning, andtotalcounters, controlled unavailable reasons, and subset/exclusivity semantics.
Current-session selection uses --session-id when supplied. Otherwise it detects an active Pi,
Claude Code, or Codex harness from supported runtime environment evidence and selects only that
harness. Pi parent and nested child-run sessions are linked by their official directory layout and
parentSession metadata when present. Without active-harness evidence, only the single globally
newest local session is selected and labelled estimated; unrelated per-harness sessions are not
combined.
Limitations
- Local JSONL telemetry is not provider billing, subscription quota, or an authoritative allowance. Claude, Pi, and Codex subscription allowance can be unavailable.
- OpenRouter analytics is API telemetry for returned metrics, not subscription quota. Metric availability is negotiated from the live metadata response; truncated or skipped rows are partial.
- Missing counters stay
null; the collector does not invent zero. Claude does not record reasoning or a portable total in the accepted usage rows. Pi reasoning is a subset of output. Codex cached input and reasoning are subsets of input and output respectively. - Malformed or oversized rows, missing timestamps, incompatible duplicate snapshots, rejected symlinks, read failures, missing roots, network failures, and sanitized 401/403/429 responses degrade only the affected source.
- Version 1 supports UTC only and offers no timezone option.
See also
/pi-spendfor Pi's recorded per-response cost estimates by day, week, and month. Cost is out of scope here by design: only Pi records it, and this skill stays token-only across all four sources.
Maintainer validation
python3 -m unittest discover -s skills/token-dashboard/tests -p 'test_*.py' -v
make validate-skills
make test-validate-skills
make clean-codeTests use temporary telemetry roots and mocked OpenRouter requests; they send no real network traffic and contain no live credentials.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

