Borrowing it
Nothing to install: this file belongs to cwf818/topgauge. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/cwf818/topgauge/main/CLAUDE.mdgit clone --depth 1 https://github.com/cwf818/topgaugeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/cwf818/topgauge/claude-md)<a href="https://agentmods.dev/instructions/cwf818/topgauge/claude-md"><img src="https://agentmods.dev/badge/instructions/cwf818/topgauge/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/cwf818/topgauge/claude-md"><img src="https://agentmods.dev/badge/instructions/cwf818/topgauge/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.09021 | $0.09021 |
| Opus 5.5 | $0.03608 | $0.03608 |
| Sonnet 5.5 | $0.01804 | $0.01804 |
| Haiku 4.5 | $0.00902 | $0.00902 |
Grade B, and why
topgauge CLAUDE.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- `.gitignore` excludes `.claude/settings.json` (which contains the live token in this project) and `~/.claude/settings.json` is the user's file — never modify it programmatically without preserving all other keys. How it starts
The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this is
A Claude Code statusline plugin (creditgauge, formal name CreditGauge-CC) that renders MiniMax token-plan usage (5-hour and weekly windows) or DeepSeek account balance, picked by ANTHROPIC_BASE_URL. The plugin ships its own installer (scripts/install.sh) that hooks into Claude Code's statusLine slot and (optionally) chains any pre-existing statusline (e.g. ccstatusline, claude-hud) as the upstream. When ANTHROPIC_BASE_URL does not point at a supported provider, the plugin hides itself and passes upstream output through unchanged.
The plugin is shipped as a single-plugin marketplace: the repo root IS the marketplace, and .claude-plugin/plugin.json declares the plugin. Install with /plugin marketplace add cwf818/creditgauge then /plugin install creditgauge@creditgauge, then run /creditgauge:install to wire it into settings.json. Uninstall with /creditgauge:uninstall (a self-contained cleanup that works even after the cache and marketplace are gone).
v1.0.0 — Renamed from topgauge to creditgauge (hard cut, no compat shim). Full mapping in CHANGELOG; provider strings (minimax / MiniMax / DeepSeek etc.) are unchanged.
v0.7.0 — Renamed from tokenplan-usage-hud to topgauge (state-dir migration + legacy dual-strip one release).
Commands
npm install # install dev deps (esbuild, typescript, tsx, @types/node)
npm run typecheck # tsc --noEmit
npm test # node:test via tsx (64 tests across api/render/cache/composition)
npm run build # esbuild → dist/index.js (single self-contained ESM bundle, target=node18)
npm run dev # esbuild --watch
There is no separate lint step; typecheck covers it. Tests run with built-in node:test + tsx — no vitest/jest dependency.
Architecture
src/
index.ts # entry — stdin drain, provider dispatch, cache, render, compose, loadConfig()
types.ts # Provider union + transport-free config/data types
api.ts # dynamic plugin loader + canonical Quota/Balance exports
plugins/data.ts # plugin ABI and canonical Quota/Balance shapes
plugins/parsers.ts # built-in field-mapping parsers
plugins/minimax/ # standalone Quota plugin source
plugins/deepseek/ # standalone BALANCE plugin source
# v0.8.36+ — m_windowMemUsage is the RAM-usage sibling of
# m_memUsage (which renders absolute bytes "Mem:X.XG/Y.YG" with
# a fixed cyan tint). m_windowMemUsage renders a bar+percent
# chunk (parallel of m_windowContext) — `▓▓▓▓▓░░░ 62%` — by
# wrapping getMemUsage()'s 0..100 ratio in a synthetic Window
# and routing through formatOneChunk / formatOneChunkColored.
# The value color is driven by colorFor(pct, "used") so
# thresholds.percentBands drives the hue. NO label prefix.
# Opt-in; not in any default lineTemplate.
render.ts # v1.0 READ-ONLY against tickState.pending: pctBar + ANSI color thresholds + renderProviderLine (sole public entry; the legacy formatLine / formatBalanceLine shims were dropped in v0.9.x); NO setAvg/setPrevTick/setLastSpeed calls (those moved to data-processor.ts)
data-processor.ts # v1.0 processTick + setPrevTick + setAvg + setLastSpeed/ApiMs/TokenHitRate + computeAndCacheTickDeltaPure + getDeltaForRender — owns ALL writes to tickState.pending
cache.ts # TTL + stale-on-error (Map<key, {at, value}>) — TTL passed in by index.ts from configStore
config.ts # config loader/store and provider facade
config.providers.ts # provider defaults, type validation, effective mappings
config.template.ts # line-template defaults and template-only types
composition.ts # reads CREDITGAUGE_UPSTREAM env, prepends (preserving ANSI/multi-line) and appends line
tick-state.ts # v1.0 per-tick in-memory Store: beginTick / mark / commit; backing the data-processor's writes + the single commit() flush
__fixtures__/ # remains.real.json, balance.real.json, balance.multi.json, …
session-parse.ts # parseTokenSnapshot — stdin JSON → TokenSnapshot (extracted from index.ts so unit tests don't drag index side effects)
token-store.ts # append-only JSONL state file at state/<projectHash>/<sessionId>.jsonl for sum/avg modules (v0.4.x+; v0.8.0 adds readAllSamples cross-project scan)
*.test.ts # node:test unit tests
.claude-plugin/
plugin.json # plugin manifest (name, version, commands, homepage)
marketplace.json # single-plugin marketplace wiring
commands/
install.md # /creditgauge:install slash command (Pattern B2 — loader-executes-script via `!`-fenced block + ${CLAUDE_PLUGIN_ROOT}; scoped allowed-tools)
uninstall.md # /creditgauge:uninstall slash command (Pattern B2)
clean.md # /creditgauge:clean slash command (Pattern B2)
clean-cache.md # /creditgauge:clean-cache slash command (Pattern B2)
scripts/
wrapper.sh # bash wrapper: CREDITGAUGE_UPSTREAM_CMD → CREDITGAUGE_UPSTREAM → us
install.sh # settings.json patcher (install/restore/dry-run; uninstall is its own command in v0.9.x+)
uninstall.sh # self-contained uninstaller (used by :uninstall and dev:uninstall)
clean.sh # trim old .bak.<ts> files, keeping only the most recent per file
lib/edit-settings.mjs # ESM helper used by install.sh
dev-uninstall.sh # DEV-ONLY thin shim → exec uninstall.sh
index.js # gitignored, esbuild bundle, the actual entry point
settings.example.json # template (NEVER commit a real settings.json)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 270 lines · 9,021 tokens per session scan B ee3a43d65633
topgauge CLAUDE.md is an instructions file published in the GitHub repository cwf818/topgauge (2 stars, last pushed 3mo ago), licensed MIT. It adds 9,021 tokens to every session, about $0.0361 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
topgauge CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| topgauge CLAUDE.mdcwf818/topgauge | Instructions file | 2 | 3mo ago | MIT | B | 9,021 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |