cc-hud

skill
Security Audit
Warn
Health Warn
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Warn
  • process.env — Environment variable access in dist/balance.js
  • network request — Outbound network request in dist/balance.js
  • process.env — Environment variable access in dist/glm.js
  • network request — Outbound network request in dist/glm.js
  • process.env — Environment variable access in dist/index.js
  • process.env — Environment variable access in dist/mmx.js
  • network request — Outbound network request in dist/mmx.js
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Compact Claude Code statusline — zero-dep, crash-free on Windows · 精简 Claude Code 状态栏

README.md

cc-hud preview

CC-HUD

A compact, single-line statusline plugin for Claude Code
Crash-free, zero-dependency status bar — model · context · agents · rate limits · reset countdown

Model  →  Context  →  Agents  →  Rate Limits
everything you need, nothing you don't.

npm version   npm downloads   install   zero deps   node >= 18   MIT


Why CC-HUD?

The Problem

Claude Code's native installer bundles Bun, which has a known memory allocator bug on Windows (oven-sh/bun#25082), causing frequent pas panic crashes. Statusline plugins like jarrodwatts/claude-hud run on every tick, amplifying memory pressure and making crashes far more likely.

The Solution

CC-HUD is a crash-free alternative — pure Node.js, zero dependencies, stateless per-call, ~60ms execution, 2s hard timeout. Designed to keep your status bar running without taking Claude Code down.

为什么做 CC-HUD?

问题

Claude Code 原生安装器内嵌 Bun,在 Windows 上存在已知内存分配器 bug(oven-sh/bun#25082),频繁触发 pas panic 崩溃。而 jarrodwatts/claude-hud 等状态栏插件每次 tick 都会执行,加剧内存压力,使崩溃更加频繁。

解决方案

CC-HUD 是不会崩溃的替代方案 — 纯 Node.js、零依赖、无状态调用、~60ms 执行、2s 硬超时。让状态栏稳定运行,不拖垮 Claude Code。

[!TIP]
Windows users: Use npm i -g @anthropic-ai/claude-code instead of the native installer to avoid Bun crashes entirely.

Windows 用户: 建议用 npm i -g @anthropic-ai/claude-code 代替原生安装器,彻底规避 Bun 崩溃。


Features

█▌

Context Bar
1/8-precision blocks
80-level granularity

Color
Catppuccin Mocha
dual-tone gradient

Agents
Running subagents
with type & model

%

Rate Limits
5h / 7d usage
+ reset countdown

0

Dependencies
Zero. Node.js
built-ins only

Install

Inside Claude Code:

/plugin marketplace add WaterTian/cc-hud
/plugin install cc-hud@cc-hud
/reload-plugins
/cc-hud:setup        # only if no statusLine is configured yet

Done — no restart needed; /reload-plugins hot-loads the HUD.

[!NOTE]
/cc-hud:setup writes the statusLine entry into ~/.claude/settings.json. Skip it if you already have a statusLine configured (e.g. via cc-bot, an older install, or hand-edited settings).

Upgrade

/plugin marketplace update cc-hud
/reload-plugins
Via npm (manual)
npm i -g cc-hud

Add to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "npx cc-hud",
    "padding": 2
  }
}
From source
git clone https://github.com/WaterTian/cc-hud.git
cd cc-hud && npm install && npm run build

Add to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "node /absolute/path/to/cc-hud/dist/index.js",
    "padding": 2
  }
}

How It Works

Claude Code ─── stdin JSON ──→ cc-hud ──→ stdout ──→ status bar
             │  (model, context, rate_limits.resets_at)
             ↘ transcript JSONL (tail 64KB → active agents)
Stateless
Fresh process per call
zero memory leaks
Fast
~60ms execution
within 300ms debounce
Safe
2s hard timeout
all IO try-catch

Balance Display (DeepSeek)

When using DeepSeek as the backend (ANTHROPIC_BASE_URL set to https://api.deepseek.com/anthropic), cc-hud automatically shows your account balance — zero configuration required.

[DeepSeek V4 Pro] ██░░░░░░░░ 20% │ ¥13.44

Balance is cached locally for 5 minutes. On cache miss, cc-hud fetches the latest balance from DeepSeek's API. Works with dscode, deepseekcode, or any launcher that sets ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.

For other backends (GLM, custom endpoints), set CC_HUD_EXTRA_FILE env var to a file whose first line is the text to display. See scripts/ds-balance-cache.sh for a reference cache implementation.


Quota Display (MiniMax)

When using MiniMax M3 as the backend (ANTHROPIC_BASE_URL set to https://api.minimaxi.com/anthropic), cc-hud automatically shows your Token Plan quota — zero configuration required.

[MiniMax M3] █▎░░░░░░░░ 13% │ 5h:17% (1.1h) │ 7d:2% (6.4d)

Token Plan usage (5h interval + weekly) is fetched from MiniMax's /v1/token_plan/remains endpoint, cached locally for 5 minutes. Model names are beautified automatically: MiniMax-M3MiniMax M3, MiniMax-M3[1m]MiniMax M3 (1M), abab-6.5s-chatABAB 6.5s Chat.

Works with mmcode or any launcher that sets ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.


Balance Display (GLM)

When using GLM as the backend (ANTHROPIC_BASE_URL set to https://open.bigmodel.cn/api/anthropic or https://api.z.ai/api/anthropic), cc-hud automatically shows your account balance — zero configuration required.

[GLM 5.2] ████▏░░░░░ 41% (1M) │ ¥88.50

Balance is cached locally for 5 minutes. On cache miss, cc-hud fetches the latest balance from GLM's account API. Works with glmcode, ZCode, or any launcher that sets ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.

Model names are beautified automatically: glm-5.2GLM 5.2, glm-5.2[1m]GLM 5.2 (1M), glm-5-turboGLM 5 Turbo, glm-4.5-airGLM 4.5 Air.


Development

npm run build      # compile
npm test           # 57 tests

Star History

Star History Chart

MIT License © Water

Reviews (0)

No results found