Claude Code Prism
English · 中文
English
Why This Exists
If you use Claude Code in the terminal, you probably know claude-hud — a status line plugin that shows token usage, cost, and context window in real time. It works great for the CLI.
But if you use Claude Code for VS Code (or Cursor), none of that works. The VS Code extension gives you a chat sidebar, but there's no way to see how many tokens you've burned, what the session is costing you, or how close you are to the context limit. You're spending real money with every message, and you can't see the meter running. That's stressful.
On top of that, Claude Code CLI has a rich set of / commands (/cost, /compact, /model, etc.) that simply don't exist in the VS Code GUI. We wanted those too.
Inspired by claude-hud, we built Claude Code Prism — a standalone companion extension that brings the same HUD experience and CLI-level insights into Claude Code for VS Code. It's designed as a separate plugin on purpose: it never touches the Claude Code for VS Code extension itself. When Anthropic ships an update to Claude Code for VS Code, nothing breaks. Claude Code Prism sits alongside it, adding what's missing without getting in the way.
Prerequisites
Claude Code for VS Code must be installed and running. Claude Code Prism is a companion extension — it enhances Claude Code for VS Code but does not work on its own.
Screenshot
How It Works
Claude Code for VS Code (running)
│
│ Claude Code Prism monitors session metadata
▼
Extracts only operational metrics:
│
├── token counts (input / output / cache)
├── model name + pricing lookup
└── session duration
│
▼
Status Bar: [model] [tokens] [████░░ ctx%] [$cost]
No API keys. No network requests. No telemetry. Does not read your conversation content. Everything stays on your machine.
Features
| Feature |
Description |
| Real-time status bar |
Model, tokens, cost, and context window — always visible, zero clicks |
| Auto session detection |
Finds the active session for your current workspace automatically |
| Live updates |
Updates the instant Claude generates — not polling |
| Context window bar |
████████░░ 78% — turns yellow at 65%, red at 85% |
| Cost breakdown |
Claude Code Prism: Session Cost opens a detailed per-category report |
| Export handoff |
Delegates to Claude Code Exporter if installed |
Quick Start
- Make sure Claude Code for VS Code is installed
- Install Claude Code Prism from the VS Code Marketplace
- Open a project and start a Claude Code session — check your status bar
Commands
| Command |
Keybinding |
Description |
Claude Code Prism: Session Cost |
Ctrl+Shift+Alt+C |
Detailed cost breakdown |
Claude Code Prism: Export Session |
Ctrl+Shift+Alt+E |
Export or open the session file |
Claude Code Prism: Status |
— |
Full status panel |
Claude Code Prism: Toggle HUD |
— |
Enable/disable the status bar |
Settings
| Setting |
Default |
Description |
claudePrism.enabled |
true |
Enable/disable the HUD |
claudePrism.showTokens |
true |
Show token count |
claudePrism.showCost |
true |
Show session cost |
claudePrism.showModel |
true |
Show current model name |
claudePrism.showContextBar |
true |
Show context window usage bar |
claudePrism.refreshInterval |
1000 |
Refresh interval in ms |
claudePrism.claudeProjectsDir |
"" |
Custom Claude projects directory |
See Also
| Extension |
Description |
| Claude Code Exporter |
Auto-export Claude Code conversations to Markdown — searchable, portable session history |
Compatibility
中文
为什么做这个插件
如果你在终端里用 Claude Code,你大概知道 claude-hud ——一个状态行插件,实时显示 token 用量、费用和上下文窗口。CLI 下用着很舒服。
但如果你用的是 Claude Code for VS Code(或 Cursor),这些全都用不了。VS Code 扩展给了你一个对话侧边栏,但你看不到烧了多少 token、这次会话花了多少钱、离上下文上限还有多远。每条消息都在花真金白银,表盘却是黑的。这让人心里没底。
除此之外,Claude Code CLI 有一整套 / 命令(/cost、/compact、/model 等等),在 VS Code 的 GUI 里根本不存在。我们也想要这些。
受 claude-hud 启发,我们做了 Claude Code Prism ——一个独立的伴生插件,把同样的 HUD 体验和 CLI 级别的运行洞察带进 Claude Code for VS Code。它刻意设计成独立插件:绝不碰 Claude Code for VS Code 扩展本身。Anthropic 更新 Claude Code for VS Code 的时候,什么都不会坏。Claude Code Prism 安安静静地待在旁边,补上缺失的部分,不碍事。
前置条件
需要先安装 Claude Code for VS Code。Claude Code Prism 是伴生插件——增强 Claude Code for VS Code 的体验,但无法独立运行。
截图
工作原理
Claude Code for VS Code(运行中)
│
│ Claude Code Prism 监控会话元数据
▼
仅提取运行指标:
│
├── token 统计(输入 / 输出 / 缓存)
├── 模型名 + 定价查询
└── 会话时长
│
▼
状态栏: [模型] [token数] [████░░ 上下文%] [$费用]
无需 API Key。无网络请求。无遥测。不读取你的对话内容。 一切数据留在本地。
功能
| 功能 |
说明 |
| 实时状态栏 |
模型、token、费用、上下文窗口——始终可见,零点击 |
| 自动识别会话 |
自动匹配当前工作区对应的活跃会话 |
| 实时更新 |
Claude 生成的瞬间就更新,不是轮询 |
| 上下文进度条 |
████████░░ 78% — 65% 变黄,85% 变红 |
| 费用明细 |
Claude Code Prism: Session Cost 命令打开逐类别的详细报表 |
| 导出联动 |
如果安装了 Claude Code Exporter,一键委托导出 |
快速开始
- 先安装 Claude Code for VS Code
- 从 VS Code Marketplace 安装 Claude Code Prism
- 打开项目,开始一个 Claude Code 会话——看状态栏
命令
| 命令 |
快捷键 |
说明 |
Claude Code Prism: Session Cost |
Ctrl+Shift+Alt+C |
费用明细 |
Claude Code Prism: Export Session |
Ctrl+Shift+Alt+E |
导出或打开会话文件 |
Claude Code Prism: Status |
— |
完整状态面板 |
Claude Code Prism: Toggle HUD |
— |
开关状态栏 |
设置项
| 设置 |
默认值 |
说明 |
claudePrism.enabled |
true |
启用/禁用 HUD |
claudePrism.showTokens |
true |
显示 token 数 |
claudePrism.showCost |
true |
显示费用 |
claudePrism.showModel |
true |
显示模型名 |
claudePrism.showContextBar |
true |
显示上下文窗口进度条 |
claudePrism.refreshInterval |
1000 |
刷新间隔(毫秒) |
claudePrism.claudeProjectsDir |
"" |
自定义 Claude 项目目录 |
相关扩展
兼容性
The HUD that Claude Code for VS Code doesn't have — yet.
Claude Code for VS Code 还没有的那块仪表盘。