cc-zhipu-hud: Instructions file for Claude Code

CLAUDE.md

cc-zhipu-hud CLAUDE.md is an instructions file for Claude Code from beiyuii/cc-zhipu-hud. It costs 1,083 tokens per session, scanned A, original, MIT.

Project instructions for cc-zhipu-hud, a TypeScript status display for Claude Code that shows token costs and Zhipu AI/GLM account balance. They describe its code, commands, tests, and data flow.

In plain words
What is it for?
Updating the status display, cost calculations, balance lookup, configuration, caching, tests, or npm publishing workflow.
Why use it?
They give an agent the project context needed to modify, test, build, or publish the tool without first working out its structure and commands.

Instructions file for Claude Code

Written for Claude Code: SessionEnd hook event. Also seen: reads .claude/ paths; mentions Claude Code.

This is beiyuii/cc-zhipu-hud's own configuration. It tells Claude Code how to work on cc-zhipu-hud itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cc-zhipu-hud configures →

Reuse

Borrowing it

Nothing to install: this file belongs to beiyuii/cc-zhipu-hud. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/beiyuii/cc-zhipu-hud/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/beiyuii/cc-zhipu-hud

Made for: Claude Code.

Wrote 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.

agentmods badge for cc-zhipu-hud CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/beiyuii/cc-zhipu-hud/claude-md/github.svg)](https://agentmods.dev/instructions/beiyuii/cc-zhipu-hud/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/beiyuii/cc-zhipu-hud/claude-md"><img src="https://agentmods.dev/badge/instructions/beiyuii/cc-zhipu-hud/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.

agentmods 80×15 button for cc-zhipu-hud CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/beiyuii/cc-zhipu-hud/claude-md"><img src="https://agentmods.dev/badge/instructions/beiyuii/cc-zhipu-hud/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,083 This file is loaded in full into every session.
When invoked 1,083 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.01083 $0.01083
Opus 5 $0.00541 $0.00541
Sonnet 5 $0.00217 $0.00217
Haiku 4.5 $0.00108 $0.00108

Measured 10d ago against content hash 5f2d5ce02c84, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

cc-zhipu-hud CLAUDE.md scanned grade A 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 10d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Zhipu AI: `open.bigmodel.cn/api/paas/v4/billing/quota` via curl (5-min retry)
CLAUDE.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

cc-zhipu-hud

Enhanced statusline for Claude Code with Zhipu AI/GLM balance tracking support.

Tech Stack

  • TypeScript (ESM), Node.js >= 22
  • Zero runtime dependencies (devDep: typescript)
  • Tests: node:test + node:assert/strict
  • Publishing: npm publish (manual, no CI/CD)

Commands

npm test        # Build (tsc) + run unit tests
npx tsc         # Build only
npm link        # Install locally for testing
npm publish     # Publish to npm

Project Structure

src/
├── cli.ts          # CLI entry point (install/uninstall/config/refresh/render)
├── statusline.ts   # Render logic, inline data refresh with unified TTL caching
├── collector.ts    # Scan ~/.claude/projects/**/*.jsonl for token usage
├── calculator.ts   # Per-model pricing and cost calculation
├── cache.ts        # Read/write cost cache and config (~/.cc-zhipu-hud/)
└── zhipu.ts        # Zhipu AI/GLM balance fetching
test/
├── statusline.test.ts  # Unit tests for pure formatting/color functions
├── calculator.test.ts  # Unit tests for pricing lookup and cost calculation
├── cache.test.ts       # Cache/config read/write roundtrip tests
├── collector.test.ts   # Cost collection with mock jsonl files
└── render.test.ts      # Render output format and edge cases

Data Flow

  1. Claude Code calls cc-zhipu-hud render on every turn, passing session JSON via stdin
  2. render() reads stdin JSON for session cost/model/context, reads transcript for token count
  3. Three data sources are refreshed inline with separate TTLs:
    • Local cost (~/.cc-zhipu-hud/cache.json): collectCosts() scans all .jsonl files (2-min TTL)
    • Usage/Balance API: detects proxy type and fetches accordingly
      • Zhipu AI: open.bigmodel.cn/api/paas/v4/billing/quota via curl (5-min retry)
      • Official: api.anthropic.com/api/oauth/usage via curl (5-min retry, token-aware)
    • ccclub rank (/tmp/sl-ccclub-rank): fetches ccclub.dev/api/rank via curl (5-min retry)
  4. install also sets SessionEnd/Stop hooks to run cc-zhipu-hud refresh (legacy, kept for cache warmth)

Read the full file on GitHub · 78 lines

Changes

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.

  1. 10d ago First seen · 78 lines · 1,083 tokens per session scan A 5f2d5ce02c84

Subscribe to this mod's changes

cc-zhipu-hud CLAUDE.md is an instructions file published in the GitHub repository beiyuii/cc-zhipu-hud (2 stars, last pushed 4mo ago), licensed MIT. It adds 1,083 tokens to every session, about $0.0054 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens