cc-hud: Instructions file for Claude Code

CLAUDE.md

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

Project instructions for cc-hud, a Claude Code status-bar plugin that shows the model, context usage, active sub-agents, and rate limits in one line.

In plain words
What is it for?
Use them when developing, testing, or configuring cc-hud and its Node.js or TypeScript code.
Why use it?
They explain the project structure, data flow, runtime requirements, and tests so the agent can change the status display without breaking its input or output handling.

Instructions file for Claude Code

Written for Claude Code: Claude Code plugin machinery. Also seen: reads .claude/ paths; mentions .claude-plugin; mentions CLAUDE.md.

This is WaterTian/cc-hud's own configuration. It tells Claude Code how to work on cc-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-hud configures →

Reuse

Borrowing it

Nothing to install: this file belongs to WaterTian/cc-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/WaterTian/cc-hud/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/WaterTian/cc-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-hud CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/watertian/cc-hud/claude-md"><img src="https://agentmods.dev/badge/instructions/watertian/cc-hud/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,735 This file is loaded in full into every session.
When invoked 1,735 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.01735 $0.01735
Opus 5.5 $0.00694 $0.00694
Sonnet 5.5 $0.00347 $0.00347
Haiku 4.5 $0.00173 $0.00173

Measured 4d ago against content hash 9c16c8efc2d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cc-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 4d 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.

http.ts — JSON GET:配了代理只走 curl(Node fetch 不认代理,先试就会带着 token 直连),curl 失败不回退;无代理时原生 fetch 优先,传输失败或 WAF 403 回退 curl
CLAUDE.md · 83 lines

How it starts

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

CLAUDE.md — cc-hud 项目指令

项目概述

cc-hud — 精简的 Claude Code 单行状态栏插件,显示模型名称、思考深度(effort)、上下文用量、活跃子代理、速率限制(5h / 7d / spend cap)、顶级模型周用量、工作区(目录 · 分支)与会话费用。

技术栈

层级 技术
语言 TypeScript(strict)
运行时 Node.js ≥ 18
构建 tsc(ESM, ES2022)
依赖 零外部依赖,仅 Node.js 内置模块
测试 node --test(内置测试运行器)
配色 Catppuccin Mocha(ANSI 256 色)

项目结构

.claude-plugin/plugin.json  — 插件清单
commands/setup.md           — 安装配置命令(v0.5.0+ 写 launcher 到 <cfg>/bin/;cfg = $CLAUDE_CONFIG_DIR 或 ~/.claude)
src/
  index.ts                  — 入口:stdin → 解析 → 渲染 → stdout(全程只写一次 stdout,异常路径也输出最简行)
  stdin.ts                  — 解析 stdin JSON(非普通对象一律视为 {})
  transcript.ts             — 读 transcript JSONL 尾部 64KB,提取活跃 agent + 思考深度(effort)
  render.ts                 — 单行紧凑渲染(1/8 精度进度条 + ANSI 颜色;自由文本先剥控制字符)
  model.ts                  — 模型名美化(claude-opus-4-7[1m] → Opus 4.7 (1M))
  git.ts                    — 工作区段:目录名 + 分支 + 脏标记(800ms 预算,--no-optional-locks;status 失败 = 未知,不当 clean)
  claude.ts                 — 顶级模型周用量(OAuth usage API):tick 只读缓存,网络全在 refresh.ts
  refresh.ts                — 分离式刷新子进程入口(node refresh.js <kind>,8s 预算,拉取后写缓存)
  cache.ts                  — 缓存约定:~/.cache/cc-hud/<name>.json、TTL / 冷却 / stale 判定、原子写、spawn 刷新子进程
  http.ts                   — JSON GET:配了代理只走 curl(Node fetch 不认代理,先试就会带着 token 直连),curl 失败不回退;无代理时原生 fetch 优先,传输失败或 WAF 403 回退 curl
  env.ts                    — 布尔环境变量开关("" / "0" / "false" 视为关)
  balance.ts / glm.ts / mmx.ts  — DeepSeek / GLM / MiniMax 余额或配额采集(缓存未命中时 tick 内拉取,1.2s 预算)
  types.ts                  — 类型定义
scripts/launcher.cjs        — 稳定路径 launcher(setup 复制到 <cfg>/bin/cc-hud-launcher.cjs;找不到插件时打印一行提示而非空白)
dist/                       — 编译输出(提交到仓库,CI 校验与 src 同步)
tests/*.test.ts(.cjs)       — node:test 单元 + 端到端测试(render / model / transcript / git / http / cache / env / claude / balance / glm / mmx / launcher / index)
.claude-plugin/marketplace.json — marketplace 入口(`/plugin marketplace add WaterTian/cc-hud` 读它;发版时和 plugin.json 一起 bump)
.github/workflows/ci.yml    — CI:ubuntu / windows / macos × node 22 / 24 测试矩阵 + dist 同步检查 + node 18 / 20 运行时 smoke
scripts/ds-balance-cache.sh — DeepSeek 余额写成一行文件给 CC_HUD_EXTRA_FILE 的示例脚本
scripts/mmx-debug.mjs       — MiniMax 配额接口调试脚本(不进 src)
preview.html / cc-hud-preview.{svg,png} — README 顶部预览图源文件与产物(图变了再改 README 里的 ?v= 缓存参数)

Read the full file on GitHub · 83 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. 4d ago Changed · +24 tokens per session 9c16c8efc2d9
  2. 10d ago Changed · +23 lines · +876 tokens per session d0563916956b
  3. 2mo ago First seen · 60 lines · 835 tokens per session scan A 60d536da8b94

Subscribe to this mod's changes

cc-hud CLAUDE.md is an instructions file published in the GitHub repository WaterTian/cc-hud (9 stars, last pushed 4d ago), licensed MIT. It adds 1,735 tokens to every session, about $0.0069 per session on Opus 5.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

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 · 9,715 tokens

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,461 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens