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.
curl -O https://raw.githubusercontent.com/WaterTian/cc-hud/main/CLAUDE.mdgit clone --depth 1 https://github.com/WaterTian/cc-hudWrote 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/watertian/cc-hud/claude-md)<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.
<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>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.00835 | $0.00835 |
| Opus 5 | $0.00417 | $0.00417 |
| Sonnet 5 | $0.00167 | $0.00167 |
| Haiku 4.5 | $0.00084 | $0.00084 |
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 9d 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.
- **tick 内零网络(官方后端)** — claude.ts 只读缓存,网络请求全部由 detached 刷新子进程完成;OAuth usage 接口的 WAF 会 403 拦截 Node TLS 指纹,需 curl 回退(2026-07 实测) What it actually says
CLAUDE.md — cc-hud 项目指令
项目概述
cc-hud — 精简的 Claude Code 单行状态栏插件,显示模型名称、上下文用量、活跃子代理、速率限制。
技术栈
| 层级 | 技术 |
|---|---|
| 语言 | 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 到 ~/.claude/bin/)
src/
index.ts — 入口:stdin → 解析 → 渲染 → 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))
claude.ts — 顶级模型周用量(OAuth usage API)
claude-refresh.ts — 分离式刷新子进程入口(tick 内零网络,后台拉取写缓存)
balance.ts / glm.ts / mmx.ts — DeepSeek / GLM / MiniMax 余额或配额采集
types.ts — 类型定义
scripts/launcher.cjs — 稳定路径 launcher(setup 复制到 ~/.claude/bin/cc-hud-launcher.cjs)
dist/ — 编译输出(提交到仓库)
tests/*.test.ts(.cjs) — node:test 单元测试(render / model / mmx / glm / claude / launcher)
数据流
Claude Code → stdin JSON → cc-hud → stdout → 状态栏
↘ transcript JSONL(尾部 64KB → 活跃 agent + 思考深度 effort)
性能与稳定性
- 无状态 — 每次调用都是独立进程,无内存泄漏风险
- 尾部读取 — 只读 transcript 最后 64KB,不全量解析
- 字符串预过滤 — 跳过不含 agent 数据的行,减少 ~90% JSON.parse
- 2s 硬超时 — setTimeout + unref(),异常时强制退出不阻塞 Claude Code
- 所有 IO try-catch — 失败静默降级,不崩溃
- tick 内零网络(官方后端) — claude.ts 只读缓存,网络请求全部由 detached 刷新子进程完成;OAuth usage 接口的 WAF 会 403 拦截 Node TLS 指纹,需 curl 回退(2026-07 实测)
环境
- Windows 11,运行时使用 Node.js,不要使用 Bun(内存崩溃问题)
- Claude Code 必须通过 npm 安装(
npm i -g @anthropic-ai/claude-code),不要使用原生安装器(native installer)- 原生安装器的
claude.exe内嵌 Bun 运行时,会触发pas panic: deallocation did fail崩溃 - npm 版使用系统 Node.js,稳定无此问题
- 原生安装器的
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.
- 9d ago First seen · 60 lines · 835 tokens per session scan A 60d536da8b94
cc-hud CLAUDE.md is an instructions file published in the GitHub repository WaterTian/cc-hud (8 stars, last pushed 1mo ago), licensed MIT. It adds 835 tokens to every session, about $0.0042 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.
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.
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.
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).
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).
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.
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.