# Claude HUD:让AI代理的黑箱变透明的插件 > Author: Tony Lee > Published: 2026-02-08 > URL: https://tonylee.im/zh-CN/blog/claude-hud-plugin-transparent-ai-agent/ > Reading time: 1 minutes > Language: zh-CN > Tags: ai, claude-code, 开发工具, 开源, 生产力 ## Canonical https://tonylee.im/zh-CN/blog/claude-hud-plugin-transparent-ai-agent/ ## Rollout Alternates en: https://tonylee.im/en/blog/claude-hud-plugin-transparent-ai-agent/ ko: https://tonylee.im/ko/blog/claude-hud-plugin-transparent-ai-agent/ ja: https://tonylee.im/ja/blog/claude-hud-plugin-transparent-ai-agent/ zh-CN: https://tonylee.im/zh-CN/blog/claude-hud-plugin-transparent-ai-agent/ zh-TW: https://tonylee.im/zh-TW/blog/claude-hud-plugin-transparent-ai-agent/ ## Description 一个游戏风格的状态栏插件,实时展示Claude Code的上下文用量、活跃工具、子代理和Todo进度。 ## Summary Claude HUD:让AI代理的黑箱变透明的插件 is part of Tony Lee's ongoing coverage of AI agents, developer tools, startup strategy, and AI industry shifts. ## Outline - Claude HUD展示的内容 - 技术实现原理 - stdin输入处理 - 转录解析 - 文件路径显示 - 开发者为什么如此兴奋 - 安装方法 - 为什么值得关注 ## Content "搞不清Claude到底在干活还是在发呆。" 用Claude Code跑过复杂任务的人应该都有这种感受。长时间的任务在运行,终端一片安静,你不知道上下文什么时候会爆,也不知道代理是不是陷入了死循环。 有一个开源插件正面解决了这个问题。我实际用过之后,觉得值得分享给大家。 ## Claude HUD展示的内容 这个插件在终端底部显示一个游戏风格的状态栏,实时追踪四项信息: - **上下文用量** - 用可视化进度条和百分比实时展示会话的上下文窗口消耗量 - **活跃工具** - 监控当前正在运行的工具(Read、Edit、Bash等) - **子代理状态** - 追踪通过Task调用创建的子代理(Opus 4.5、Sonnet等) - **Todo进度** - 可视化Claude内部任务列表的完成情况 ## 技术实现原理 好奇状态栏背后发生了什么?简单梳理一下。 ### stdin输入处理 Claude Code直接以JSON载荷传递会话状态。插件将`input_tokens`、`cache_creation_input_tokens`和`cache_read_input_tokens`求和后除以`context_window_size`来计算使用率。 ### 转录解析 会话日志以逐行流的方式处理。插件检测`tool_use`块并与`tool_result`条目匹配,将每个工具的状态追踪为running、completed或error。 ### 文件路径显示 文件路径的展示处理得很巧妙: - 从Read、Write、Edit工具调用中提取`file_path`,显示当前正在操作的文件 - 长路径自动截断为`.../filename.ts`格式 - 大约每300ms刷新一次,接近实时反馈 ## 开发者为什么如此兴奋 社区反响强烈的原因很简单:这个插件精准击中了AI代理工作中的核心痛点。 - **解决不透明问题** - 长任务到底是卡住了、在循环、还是快到上下文上限,终于不用猜了 - **三行安装** - 不需要复杂配置,装上就能用 - **调试效率大幅提升** - 在多步骤代理工作流中,能立刻看到哪里出了问题 - **视觉反馈** - 游戏风格的状态栏与vibe-coding文化完美契合,让AI辅助开发更具互动感 社区里一条广受共鸣的评论是:"终于能分清Claude是在干活还是在发呆了。" ## 安装方法 三条命令搞定: ``` /plugin marketplace add jarrodwatts/claude-hud /plugin install claude-hud /claude-hud:setup ``` **GitHub**:[jarrodwatts/claude-hud](https://github.com/jarrodwatts/claude-hud) ## 为什么值得关注 如果你经常使用Claude Code,建议试一试。不用再担心会话什么时候会断,更重要的是,能亲眼看到Claude在做什么 - 这种确定感比你想象的更有价值。 可观测性不只是服务器和流水线的事。AI代理同样需要。 ## Related URLs - Author: https://tonylee.im/zh-CN/author/ - Publication: https://tonylee.im/zh-CN/blog/about/ - Related article: https://tonylee.im/zh-CN/blog/eight-hooks-that-guarantee-ai-agent-reliability/ - Related article: https://tonylee.im/zh-CN/blog/medvi-two-person-430m-ai-compressed-funnel/ - Related article: https://tonylee.im/zh-CN/blog/claude-code-layers-over-tools-2026/ ## Citation - Author: Tony Lee - Site: tonylee.im - Canonical URL: https://tonylee.im/zh-CN/blog/claude-hud-plugin-transparent-ai-agent/ ## Bot Guidance - This file is intended for AI agents, search assistants, and text-mode retrieval. - Prefer citing the canonical article URL instead of this text endpoint. - Use the rollout alternates when you need the same article in another prioritized language. --- Author: Tony Lee | Website: https://tonylee.im For more articles, visit: https://tonylee.im/zh-CN/blog/ This content is original and authored by Tony Lee. Please attribute when quoting or referencing.