token-monitor
AGENTS.md2.6k starsChanged 2 months agoMITView on GitHub
This is the entry point for project guidance shared by every coding agent (Claude Code, Codex, Cursor, …). It is loaded automatically; the documents it routes to are not, so anything an unrelated change can break is listed under Tripwires here, with the full reasoning in the linked document. Automated verification is npm run verify; CI (.github/workflows/ci.yml) runs lint + test on push/PR across Node 22 & 24. The toolchain (ESLint 10 + the node:test glob) needs Node 22.13+ and…
Trending
Quiet since October.about the whole repository
Who's talking about Javis603/token-monitor
- Wei-Shaw/sub2api“用量查询:支持智谱 GLM 团队套餐(Team Plan)额度查询”GitHub · Aug 27, 2026 · 4 reactions
- @github-trending-js.bsky.social“📦 Javis603 / token-monitor ⭐ 1,734 (+38) 🗒 JavaScript Local-first desktop widget for tracking token …”Bluesky · Aug 26, 2026 · 2 likes
- @github-trending-js.bsky.social“📦 Javis603 / token-monitor ⭐ 2,512 (+37) 🗒 JavaScript Local-first desktop widget for tracking token …”Bluesky · Sep 30, 2026 · 1 likes
- The-Minion-oOo/token-monitor-android“Review Token Monitor v0.60.0”GitHub · Sep 21, 2026 · 1 reactions
- appflare/catalog“chore(token-monitor): bump to v0.66.0”GitHub · Oct 4, 2026
The biggest 5 of 20 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 20
Talked about on GitHub and Bluesky (20 times).
On GitHub · 18
- Aug 27, 2026用量查询:支持智谱 GLM 团队套餐(Team Plan)额度查询 — Wei-Shaw/sub2api4 reactions · 7 comments
- Sep 21, 2026Review Token Monitor v0.60.0 — The-Minion-oOo/token-monitor-android1 reaction · 2 comments
- Oct 4, 2026chore(token-monitor): bump to v0.66.0 — appflare/catalog0 reactions · 1 comment
- Oct 2, 2026chore(token-monitor): bump to v0.65.0 — appflare/catalog0 reactions · 2 comments
- Oct 1, 2026Factory (Droid) provider — robinebers/openusage0 reactions · 2 comments
13 more on GitHub
- Sep 30, 2026chore(token-monitor): bump to v0.64.0 — appflare/catalog0 reactions · 1 comment
- Sep 30, 2026Add Token_Monitor — AppImage/appimage.github.io0 reactions · 1 comment
- Sep 28, 2026Review Token Monitor v0.63.1 — The-Minion-oOo/token-monitor-android0 reactions
- Sep 28, 2026chore(token-monitor): bump to v0.63.1 — appflare/catalog0 reactions · 1 comment
- Sep 27, 2026feat(window): add Windows edge auto-hide and readable glass — EthanYoQ/token-monitor0 reactions · 1 comment
- Sep 27, 2026feat(usage): recover Codex and CC-Switch history — EthanYoQ/token-monitor0 reactions · 1 comment
- Sep 26, 2026Overview 사용량: Antigravity 는 agy /usage 로, Muse Spark 는 턴 중 usage/changed 로 읽기 (설계 메모) — jeong-sik/masc0 reactions · 4 comments
- Sep 19, 2026[quota-watch] 2026-09-19 — Claude CLAUDE_CONFIG_DIR hiç okunmuyor; Codex kendi auth.json'a token yazıyor; yeni bir oauth/profile ucu var — erayendes/mimir0 reactions · 4 comments
- Sep 14, 2026Review Token Monitor v0.57.0 — The-Minion-oOo/token-monitor-android0 reactions · 2 comments
- Jul 9, 2026Standalone iOS/Android companion app: live limits on your phone, no Mac required — digitaljohn/claude-stats0 reactions
- Jul 8, 2026AI 栏展示 Codex 配额、重置与订阅状态 — duxweb/codux0 reactions · 2 comments
- Jul 6, 2026Refresh dashboard usage cockpit — timmyagentic/quota-monitor0 reactions
- Jul 4, 2026Deploy to Cloudflare button: source import silently fails — created repo has only README + wrangler config, worker stuck on Hello World placeholder — cloudflare/developer-platform0 reactions · 4 comments
On Bluesky · 2
- Aug 26, 2026📦 Javis603 / token-monitor ⭐ 1,734 (+38) 🗒 JavaScript Local-first desktop widget for tracking token usage, costs, and limits across 32+… — @github-trending-js.bsky.social2 likes and reposts
- Sep 30, 2026📦 Javis603 / token-monitor ⭐ 2,512 (+37) 🗒 JavaScript Local-first desktop widget for tracking token usage, costs, and limits across 43+… — @github-trending-js.bsky.social1 likes and repost
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 30
Update the matching document in the same change when its contract moves, and delete stale claims rather than preserving history.
- Very specific: line 37
Hub build marker: Run npm run update:hub-build once after the final Hub/shared change.
- Very specific: line 38
tokscale binary: Only app, agent and packaging entry points run ensure:tokscale.
- Very specific: line 75
Never add an AI Co-Authored-By trailer.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md 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
AGENTS.md
This is the entry point for project guidance shared by every coding agent (Claude Code, Codex, Cursor, …). It is loaded automatically; the documents it routes to are not, so anything an unrelated change can break is listed under Tripwires here, with the full reasoning in the linked document.
Commands
npm start # launch the Electron widget (= npm run widget / npm run dev)
npm run hub # start the Node hub on port 17321
npm run agent # start the headless collector→hub agent
npm run agent:once # one-shot collect+post, then exit (useful for cron/launchd)
npm test # run the node:test suite (node --test "tests/**/*.test.js")
npm run lint # ESLint flat config (eslint.config.js)
npm run verify # lint + test (single local entry point)Automated verification is npm run verify; CI (.github/workflows/ci.yml) runs lint + test on push/PR across Node 22 & 24. The toolchain (ESLint 10 + the node:test glob) needs Node 22.13+ and DSH session decoding needs zlib.zstdDecompressSync (Node 22.15+), which is why engines.node is >=22.15.0.
To dry-run the agent without posting: npm run agent:once -- --dry-run.
Where guidance lives
| Changing… | Read first |
| a boundary shared by the widget, agent, Hub or Worker; the collector, limits runtime, credentials or wire record | docs/architecture.md |
anything under src/shared/providers/<id>/ or src/electron/providers/<id>/ | docs/providers/README.md, then the note whose ids: front matter lists that id if one exists — grep -lE '^ids:.*[[, ]<id>[],]' docs/providers/*.md. Most providers have no note; the README and the code/tests are then authoritative |
| adding or renaming a tracked client or limits provider | docs/providers/README.md (both registration checklists) |
| the device wire shape or Hub endpoints | docs/API.md |
Update the matching document in the same change when its contract moves, and delete stale claims rather than preserving history.
Tripwires
Each line is a constraint that a change elsewhere has broken before, or would break silently.
- Worker isolation.
worker/cannot import above itself. Editsrc/shared/, never the@generatedcopies underworker/src/shared/, then runnpm run sync:worker; CI fails on drift. Modules in that closure stay free of Node built-ins. →docs/architecture.md(Entry points) - Hub build marker. Run
npm run update:hub-buildonce after the final Hub/shared change; never hand-edit generated Worker metadata.limits/providers.jsis in the Hub core, so adding, reordering or renaming a limits provider moves the marker too. →docs/architecture.md(Generated and registered state) - tokscale binary. Only app, agent and packaging entry points run
ensure:tokscale; install, hub, lint, test and verify must never download it. →docs/architecture.md(Generated and registered state) - Serial scans, exact deltas. Full ticks scan today/month/allTime serially; watch ticks scan
--todayonly and apply an exact delta. Do not parallelise the scans or turn the delta into an estimate. →docs/architecture.md(Collector pipeline) - No watch cooldown. The product promises 3–5 s updates; a mid-tick watch event re-arms the debounce. Do not add a cooldown, and do not watch the self-synced tokscale cache dirs (they re-trigger forever). →
docs/architecture.md(Watching) - Client ids are partition keys. Each tracked-client id must be a fixed point of
normalizeClientName(), every tokscale alias must filter back to its parent, and the filter must never emitsynthetic. →docs/providers/README.md(Partition invariants) - Limits refresh triggers. Local token usage never triggers a limits refresh, and
burn-ratestays out ofCOOLDOWN_BYPASS_REASONS. →docs/architecture.md(Limits collector) - Electron transport. Provider calls take the injected transport. Under Chromium never set a
Hostheader, keepcredentials: 'omit', and expect a cross-originRefererwith a path to be cancelled. →docs/architecture.md(Outbound transport) - Credentials stay in main. Renderer settings are default-deny; a raw credential crosses only through an explicit allowlist. New fixed credentials declare a
storePathin the provider'saccount.js(CREDENTIAL_SETTING_PATHSderives from it) — never a literal entry incredentialStore.js, never a provider-specific store. Limits account leaves must stay require-free; renderer form DTOs expose display/action metadata, never store paths, resolvers or secrets. →docs/architecture.md(Settings and credentials) - Public stats stay public. The subscription version stamp is added by
statsWithSubscriptionVersion()on authenticated paths only; folding it intogetStats()leaks through the unauthenticated route. →docs/architecture.md(Subscriptions) - Balance quotas. Key money display off
windows[].metric === 'credits'throughlimits/balanceDisplay.js, never a provider whitelist; display-only percentages stay out of the wire shape. →docs/architecture.md(Balance quotas) - Compatibility surfaces. Settings keys, env vars, CLI flags, Hub endpoints and the wire shape have external users. Treat changes as breaking and plan the migration.
Conventions
- Consider best practices first. When picking an approach — library vs hand-roll, pattern vs custom, framework default vs override — start by checking the ecosystem convention, not by optimizing for "fewer deps" or "less code". If a hand-rolled solution is genuinely better, argue that after weighing the convention.
- Don't add dependencies or new tooling without discussing it first (in the issue or PR description).
- Keep documentation close to its scope and current. This file holds cross-cutting commands, tripwires and conventions; subsystem reasoning belongs in
docs/architecture.mdand provider knowledge indocs/providers/. Document non-obvious constraints and gotchas, not descriptions the code already makes obvious. Avoid hardcoded counts and exhaustive lists (prefer a command likels src/shared/over a hand-maintained one); verify claims against the code before writing them; delete anything that has gone stale — an outdated note is worse than none.
Commit messages
Format: <type>(<scope>): <subject> — conventional-commit types (feat / fix / refactor / docs / chore / perf / test / …), with a scope when the change targets a clear subsystem (fix(hermes):, fix(collector):, feat(limits):); leave it off for cross-cutting or general changes. When a change belongs to a single provider, scope it by that provider (fix(opencode):, fix(codex):) rather than by the subsystem it happens to live in. Aim for a subject ≤ ~72 chars that describes the actual change. Add a body only when the diff doesn't make the why obvious — rationale, rejected alternatives, behaviour-preserving notes, linked issues; trivial changes stay single-line. Write body paragraphs as continuous lines, not hard-wrapped.
Do:
fix(dashboard): balance stat card widths
feat(wsl): scan usage from running WSL distros
docs(i18n): add Japanese READMEDon't — vague subjects, or internal review/agent jargon (P0/P1, "review findings", "hardening pass"):
fix: address P0 review findings ❌
fix: hardening pass round 2 ❌
fix: various improvements ❌Never add an AI Co-Authored-By trailer. Do keep the genuine human Co-authored-by: trailer on a multi-author squash (e.g. a maintainer follow-up on a contributor PR) and keep the (#NN) PR-number suffix GitHub appends to squash subjects.
Pull requests
- PR titles follow the commit-message convention above — they become the squash-merge subject.
- In the description: summarize the behaviour change, note the commands you ran (
npm run verifyat minimum), attach screenshots/GIFs for UI changes, and link the related issue.
Authoring GitHub content via gh
Write PR/issue bodies and comments to a file and pass it, rather than inline heredocs: gh issue comment --body-file <path>, gh api -X PATCH … -F body=@<path>. Inline --body "$(cat <<EOF … EOF)" mangles backtick escaping and renders as a literal \` in GitHub markdown. Same spirit for prose: write paragraphs as continuous lines and let GitHub wrap them — don't hard-wrap at 80 columns.
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.

