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 835 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.md; mentions Claude Code.

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 835 This file is loaded in full into every session.
When invoked 835 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.00835 $0.00835
Opus 5 $0.00417 $0.00417
Sonnet 5 $0.00167 $0.00167
Haiku 4.5 $0.00084 $0.00084

Measured 9d ago against content hash 60d536da8b94, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 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 实测)
CLAUDE.md · 60 lines

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,稳定无此问题
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. 9d 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 (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.

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

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

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