claude-hud README

项目的 README,来自 github.com/jarrodwatts/claude-hud。合并为一个 markdown 文件:README.md。

Claude HUD

A Claude Code plugin that shows what's happening: context usage, rate limits, active tools, running agents, and todo progress, always visible below your input.

License Stars

Claude HUD in action

🌐 English | 中文文档

Install

Inside Claude Code, run:

/plugin marketplace add jarrodwatts/claude-hud
/plugin install claude-hud
/reload-plugins
/hud

/hud checks your setup and points your status line at the HUD, after asking you. It needs Node.js 22.18 or later; if yours is older, /hud finds a newer one on your machine or helps you install one.

Prefer the terminal?
claude plugin marketplace add jarrodwatts/claude-hud
claude plugin install claude-hud@claude-hud

Then run /reload-plugins and /hud inside a session.

Updates: Claude Code doesn't auto-update third-party plugins by default. To turn it on, run /plugin, open Marketplaces, select claude-hud, and choose Enable auto-update. Or update by hand with claude plugin marketplace update claude-hud and claude plugin update claude-hud@claude-hud, then /reload-plugins. You don't need to set it up again.

What You See

The default is two lines:

[Opus] │ my-project git:(main*)
Context █████░░░░░ 45% │ Usage ██░░░░░░░░ 25% (resets in 1h 30m)

Optional lines include tools, agents and todos, plus about a hundred other options:

◐ Edit: auth.ts | ✓ Read ×3 | ✓ Grep ×2        ← tools
◐ explore [haiku]: Finding auth code (2m 15s)    ← agents
▸ Fix authentication bug (2/5)                   ← todos

Change It, Fix It, Report It

Ask Claude, or type /hud and say what you want: "show tool activity", "use the compact layout", "the HUD is blank", "the context bar looks wrong". Claude looks up the options, shows you a preview, and saves the change once you approve it. /hud also undoes the last change, replays the last real render to explain what you see, and, for a real bug, writes a scrubbed report that you read in full before anything is filed.

Settings live in ~/.claude/plugins/claude-hud/config.json (under $CLAUDE_CONFIG_DIR if set). To turn the HUD off for one session, start Claude Code with CLAUDE_HUD_DISABLE=1.

Security

The HUD's logic runs in a locked-down Node process. Node's permission model blocks it from starting programs, reading your credentials, and writing anywhere but its own data folder. An import fence keeps Node's network modules and globals out of its reach; that fence blocks every way out found so far, and is tested against each one on every change. A small separate file runs the fixed git, jj and memory commands it needs. The HUD reads Claude Code's stdin, the session transcript, Claude config files, and git or jj metadata for the current directory, and calls no undocumented APIs.

--extra-cmd runs a shell command on every refresh and puts its output on the first line. It is ignored unless CLAUDE_HUD_ALLOW_EXTRA_CMD=1 is set in the HUD's environment. Treat it as arbitrary code execution and never use a command from an untrusted source.

Requirements

Development

git clone https://github.com/jarrodwatts/claude-hud
cd claude-hud
npm ci && npm test

See CONTRIBUTING.md.

License

MIT. See LICENSE.

Star History

Star History Chart

claude-hud (jarrodwatts/claude-hud)

正在搜索数据库…

这是什么?Claude HUD 是一个 Claude Code 插件,它会在输入框下方始终显示一个实时状态栏,展示上下文用量、正在使用的工具、运行中的子代理以及待办任务的进度。
这是独立应用,还是运行在 Claude Code 内部?它是一个完全运行在 Claude Code 会话内部的插件,使用 Claude Code 原生的 statusline API,不需要单独的窗口或终端复用器。
我该如何安装和设置?在 Claude Code 实例中,先添加插件市场,再安装插件,然后运行 /claude-hud:setup 来配置状态栏。无需重启,在你发送下一条消息后即可生效。
运行它除了 Claude Code 还需要别的东西吗?在 Windows 上需要一个 JavaScript 运行时,设置时支持的是 Node.js LTS 版本。在 Linux 上没有额外依赖,但较旧版本的 Claude Code 可能会遇到 /tmp 文件系统问题。
安装时有哪些需要注意的坑?在较旧版本 Claude Code 的 Linux 上,可能会遇到 EXDEV 错误,原因是 /tmp 是独立的 tmpfs 文件系统。该问题已在上游修复;或者你可以在安装前设置 TMPDIR 作为临时解决办法。如果 Windows 上的设置找不到 JavaScript,可能需要先安装 Node.js 运行时。
HUD 布局有哪些预设?内置三种预设:Full(显示全部内容,包括工具、代理、待办、git、用量和耗时)、Essential(活动行加 git 状态)以及 Minimal(仅显示模型名称和上下文进度条)。
HUD 可以显示中文标签吗?可以。简体和繁体中文标签需要主动开启,可通过 /claude-hud:configure 设置,或设置 language 选项(zh/zh-Hans 为简体,zh-TW/zh-Hant 为繁体);默认是英文。
它能实时显示子代理和工具的活动吗?可以。它会解析会话记录,显示 Claude 正在使用哪些工具(读取/编辑/搜索)以及哪些子代理正在运行;每次交互后会重新渲染,并以 300 毫秒进行防抖处理。
我能查看会话费用和用量限制吗?可以。通过可选的显示开关,可以展示 Claude 订阅用户的用量限制、会话费用(优先使用 Claude Code 原生的费用数据,缺失时回退到本地估算),甚至还能显示跨会话的每日累计花费。
大小
3.8 MB
星标
29.2K
时长
11个月
提交 · 90 天