Real-time status HUD for Claude Code: context usage, cost, cache hit rate, and task progress.
This is a fixed version that properly handles Windows paths with backslashes, colons, and spaces.
📦 安装方式
方式 1:VS Code 扩展面板(推荐)
- 打开 VS Code
- 按
Ctrl+Shift+X打开 Extensions 面板 - 搜索
claude-code-hud-fixed - 点击 Install 安装
方式 2:快速安装命令
在 VS Code 中按 Ctrl+P,粘贴以下命令并回车:
ext install LIMINXUE.claude-code-hud-fixed
方式 3:从 VSIX 文件安装
- 从 GitHub Releases 下载
.vsix文件 - 在 VS Code 中:Extensions 面板 →
...→ Install from VSIX - 选择下载的
.vsix文件
方式 4:命令行安装
code --install-extension LIMINXUE.claude-code-hud-fixed
使用方式
- 打开任意项目,启动 Claude Code
- HUD 会自动检测会话并显示数据
- 点击左侧 Activity Bar 的 🤖 图标打开 HUD 面板
- 底部状态栏会实时显示关键指标
🔗 链接
| 链接 | URL |
|---|---|
| Marketplace | https://marketplace.visualstudio.com/items?itemName=LIMINXUE.claude-code-hud-fixed |
| GitHub | https://github.com/BOYGAGAGA/claude-code-hud |
v1.5.6 更新日志 (2026-07-01)
🐛 修复
- 会话列表净化:标题优先读取 JSONL 中的
ai-title(与 Claude Code 显示一致),不再出现hi你是正常的吗/Base directory等首条消息片段 - 降级窗口收紧:无活跃会话时只展示最近 2 小时内的会话(原为 24h),避免列出大量历史会话
- 最大数量限制:会话列表上限从 8 个降至 5 个
v1.5.5 更新日志 (2026-07-01)
🐛 修复
- Context Window 数据修正:之前显示的是累计 input tokens(会超过100%),现在显示真实当前上下文用量(与 Claude Code
/context一致) - 上下文分项展示:新增 New Input / Cached / Free 三段式分解条,清晰看到每次请求的新增 token 和缓存命中比例
- 保留 Session 累计统计(Session In / Out),方便查看整场对话总消耗
v1.5.4 更新日志 (2026-06-30)
✨ 新交互
- 点击切换会话:多个会话时显示为可点击按钮,直接点标题切换,不再用下拉菜单
- 当前会话高亮显示(加粗+边框),一目了然
v1.5.3 更新日志 (2026-06-29)
✨ 智能任务进度
- 进度检测:自动识别任务内容中的进度标记,显示真实百分比
[3/10]→ 30%,(60%)→ 60%,已完成5/8→ 63%
- 动画进度条:
in_progress任务无具体进度时显示流动动画条(不再死板卡在 50%) - 有真实数据 → 真实%,无数据 → 动态流动动画
v1.5.2 更新日志 (2026-06-29)
🐛 修复
- 会话标题匹配 Claude Code 显示名称:读取 JSONL 中的
ai-title条目,显示与 Claude Code 一致的 AI 生成标题(如"评估Claude Code HUD扩展") - 会话数量过滤:优先显示活跃会话(有 PID 文件),避免显示已关闭的历史会话
- UI 文字颜色:自动跟随按钮提示文字改为白色,提高可读性
🔧 标题读取优先级
ai-title— Claude Code AI 生成的标题history.jsonl— 历史记录中的 display 字段- 首条用户消息 — 降级方案
v1.5.1 更新日志 (2026-06-28)
✨ 新功能
- 会话标题栏双行布局:主行(选择器+按钮)和副行(自动跟随提示),避免按钮被遮挡
- URL 清理:自动从会话标题中移除 URL,显示更简洁
- 系统消息过滤:跳过 IDE 通知、系统提醒等非用户消息
🐛 修复
- 会话选择器下拉菜单只显示活跃/最近会话
- 自动跟随按钮(🔄/📍)移至第二行,不再被遮挡
- GitHub 仓库地址更新为 https://github.com/BOYGAGAGA/claude-code-hud
v1.4.0 更新日志 (2026-06-27)
✨ 新功能
- 会话切换器:下拉菜单选择不同会话,不再只显示单一会话
- 多个会话时显示下拉选择框
- 单个会话时显示会话标题
- 点击 📌 可取消固定会话
🐛 修复
- Tasks 面板自动刷新:新一轮任务开始时自动清除旧任务
v1.3.4 更新日志 (2026-06-27)
🐛 修复
- Tasks 面板自动刷新:新一轮任务开始时,自动清除旧任务,只显示当前轮次
- 智能检测新任务:当超过半数任务为新内容时,判定为新一轮
v1.3.2 更新日志 (2026-06-27)
🎨 新增
- 扩展 Logo:添加自定义图标,提升 Marketplace 展示效果
v1.3.1 更新日志 (2026-06-27)
🐛 修复
- Agent 任务识别增强:支持更多 Agent 任务格式
Agent-X: task[Agent-X] taskAgent X: taskagent-x: task(不区分大小写)
v1.3.0 更新日志 (2026-06-27)
✨ 新功能
- 多 Agent 任务追踪:支持 Workflow 多 Agent 并行任务
- Agent 面板:独立显示每个 Agent 的任务进度
- 所有 Agent 的任务自动聚合到 Agents 面板
📊 Agent 面板示例
🤖 Agents (5/8)
┌─ Agent-A ──────────────────────────┐
│ Agent-A ██████████ 100% (2/2) │
│ ██████████ 100% 扫描文件结构 │
│ ██████████ 100% 分析目录层次 │
└────────────────────────────────────┘
┌─ Agent-B ──────────────────────────┐
│ Agent-B █████░░░░░ 50% (1/2) │
│ ██████████ 100% 收集项目信息 │
│ ░░░░░░░░░░ 0% 运行静态分析 │
└────────────────────────────────────┘
v1.2.0 更新日志 (2026-06-27)
✨ 新功能
- 自动识别模型上下文大小:MiMo = 1M, DeepSeek V4 = 1M
- 自动适配 API 价格:40+ 模型全覆盖
- DeepSeek V4 最新定价(2026-06-27 官方价格)
- MiMo-V2.5 最新定价(2026-06-24 官方价格)
🐛 修复
- Windows 路径编码问题(支持
\、:、空格)
🗑️ 移除
- 工具调用统计模块(简化界面)
v1.0.0 - 初始版本 (2026-06-27)
✨ 核心功能
- 实时监控 Claude Code 会话状态
- 上下文用量追踪
- 缓存命中率显示
- 会话费用计算
- 任务进度追踪
- 7 天费用统计
- 状态栏快捷显示
✨ 新功能
- 自动识别模型上下文大小:根据模型名称自动匹配正确的上下文窗口
- 自动适配 API 价格:根据模型自动使用正确的定价
- 支持 30+ 模型:覆盖主流国内外模型
🐛 修复
- 修复 Windows 路径编码问题(支持
\、:、空格) - 修复 MiMo-V2.5 系列上下文大小(128K → 1M)
- 修复 DeepSeek V4 系列定价(最新 2026-06-27 官方价格)
📊 支持的模型定价
Anthropic Claude
| 模型 | Input/1M | Output/1M | Context |
|---|---|---|---|
| Claude Opus 4 | $15.00 | $75.00 | 200K |
| Claude Sonnet 4 | $3.00 | $15.00 | 200K |
| Claude Haiku 3.5 | $0.80 | $4.00 | 200K |
DeepSeek (2026-06-27 最新)
| 模型 | Input/1M | Input(缓存)/1M | Output/1M | Context |
|---|---|---|---|---|
| deepseek-v4-flash | ¥1 ($0.14) | ¥0.02 ($0.003) | ¥2 ($0.28) | 1M |
| deepseek-v4-pro | ¥3 ($0.42) | ¥0.025 ($0.004) | ¥6 ($0.83) | 1M |
小米 MiMo (2026-06-24 最新)
| 模型 | Input/1M | Input(缓存)/1M | Output/1M | Context |
|---|---|---|---|---|
| mimo-v2.5-pro | $0.435 (¥3) | $0.0036 (¥0.025) | $0.87 (¥6) | 1M |
| mimo-v2.5 | $0.14 (¥1) | $0.0028 (¥0.02) | $0.28 (¥2) | 1M |
国产模型
| 厂商 | 模型 | Input/1M | Output/1M | Context |
|---|---|---|---|---|
| 通义千问 | qwen-max | $0.56 (¥4) | $2.22 (¥16) | 128K |
| 通义千问 | qwen-plus | $0.11 (¥0.8) | $0.28 (¥2) | 128K |
| 通义千问 | qwen-turbo | $0.04 (¥0.3) | $0.08 (¥0.6) | 128K |
| 智谱 GLM | glm-4 | ¥100 | ¥100 | 128K |
| 智谱 GLM | glm-4-flash | 免费 | 免费 | 128K |
| Minimax | abab6.5 | ¥10 | ¥10 | 200K |
| 百度文心 | ernie-4.0 | ¥120 | ¥120 | 128K |
| 百度文心 | ernie-speed | 免费 | 免费 | 128K |
| 月之暗面 | kimi-128k | ¥12.5 | ¥12.5 | 128K |
| 阶跃星辰 | step-2 | ¥5 | ¥5 | 16K |
| 商汤 | sensechat-5 | ¥0.9 | ¥0.9 | 128K |
| 百川 | baichuan4 | ¥10 | ¥10 | 128K |
| 零一万物 | yi-lightning | ¥1 | ¥1 | 128K |
| 讯飞星火 | spark-max | ¥5 | ¥5 | 128K |
| 讯飞星火 | spark-lite | 免费 | 免费 | 128K |
| 腾讯混元 | hunyuan-pro | ¥3 | ¥3 | 128K |
| 腾讯混元 | hunyuan-lite | 免费 | 免费 | 128K |
OpenAI
| 模型 | Input/1M | Output/1M | Context |
|---|---|---|---|
| GPT-4o | $2.50 | $10.00 | 128K |
| o1 | $15.00 | $60.00 | 200K |
| o3-mini | $1.10 | $4.40 | 200K |
🗑️ 移除
- 移除工具调用统计模块(简化界面)
Features
- Context Window — Progress bar + percentage showing current token consumption
- Cache Hit Rate — Hit rate progress bar with color coding (green/yellow/gray)
- Session Cost — Breakdown by Input/Output/Cache Write/Cache Read
- Session Bloat — Track conversation rounds and cost efficiency
- Tool Usage — Statistics for all tools used in the session
- Task Progress — Parse TodoWrite records to show task status
- Daily Spend — 7-day cost chart with budget warnings
- Status Bar — Real-time display in VS Code status bar
Installation
From VSIX file
- Open VS Code Extensions panel
- Click "..." → "Install from VSIX..."
- Select the
claude-code-hud-fixed-1.0.0.vsixfile
From command line
code --install-extension claude-code-hud-fixed-1.0.0.vsix
Usage
- Open a project in VS Code
- Start a Claude Code session
- The HUD will automatically detect the session and display stats
- Click the robot icon 🤖 in the Activity Bar to open the HUD panel
- Click the status bar item to jump to the HUD panel
Commands
Claude Code HUD: Show Panel— Open the HUD panelClaude Code HUD: Refresh— Force refreshClaude Code HUD: Preview Mode (Mock Data)— Show demo dataClaude Code HUD: Exit Preview Mode— Return to live data
Configuration
The extension creates a config file at ~/.claude/claude-code-hud.json with the following options:
{
"contextLimit": null, // null = auto-detect (Opus 4.x = 1M, others = 200K)
"refreshInterval": 3000, // Refresh interval in milliseconds
"inputCostPer1M": 3.0, // Input token cost per 1M tokens (USD)
"outputCostPer1M": 15.0, // Output token cost per 1M tokens (USD)
"cacheWriteCostPer1M": 3.75, // Cache write cost per 1M tokens (USD)
"cacheReadCostPer1M": 0.30, // Cache read cost per 1M tokens (USD)
"dailyCostWarning": null, // Daily cost warning threshold (yellow)
"dailyCostLimit": null // Daily cost limit (red)
}
Fixes in This Version
- Windows Path Encoding: Fixed path matching to handle
\,:, and spaces in Windows paths - Path Normalization: Improved project directory detection with proper encoding
License
MIT
by BOYGAGA