### 整体摘要
文档新增了关于在 Spinner(加载指示器)旁显示实时 Token 计数的说明,该功能用于监控当前对话轮次的输出消耗;同时更新了状态行文档,明确区分了该实时计数与 Verbose 模式下上下文计数器的差异。
### 关键主题
* **细粒度成本可视化**: 新增 UI 功能,实时显示当前轮次的输出 Token 量(包括流式文本、思考过程、工具调用及前台 Subagent 的输出)。
* **统计概念澄清**: 明确界定了三种不同的 Token 维度:`当前轮次输出`(Spinner 旁)、`会话总用量`(/usage)以及`上下文大小`(Verbose 模式)。
* **UI 交互细节**: 详细说明了该计数的重置时机(每轮开始或对话压缩时)及隐藏条件(无输出、终端过窄或屏幕阅读器模式)。
### 影响程度
**Medium**
* **理由**: 这是一个非破坏性的功能增强。它为开发者提供了即时的反馈机制,有助于更直观地理解单次操作(特别是工具调用和长任务)的资源消耗,从而优化 Prompt 或工作流。
### 开发者行动项
* 利用 Spinner 旁的实时计数来快速评估特定工具调用或 Subagent 的 Token 开销。
* 注意该计数仅统计**输出**(下行流量),不包含 Prompt 和历史记录等**输入**(上行流量)。
* 结合 `/usage` 命令查看全貌,利用该新功能排查具体的“昂贵”轮次。
* 在窄终端窗口下使用时,需知悉该计数可能会自动隐藏。
💭 Model Reasoning
1. **Analyze the Request**:
* **Role**: World-class programmer analyzing documentation changes.
* **Format**: Markdown, concise, insightful, Chinese language.
* **Input**: Two pages changed (`costs.md`, `statusline.md`). `costs.md` adds a new section about live token counting. `statusline.md` updates a description of the token counter to differentiate it from the new feature in `costs.md`.
* **Output structure**: Overall Summary, Key Themes, Impact Level, Action Items.
2. **Analyze the Diff**:
* **`costs.md`**:
* Added a new section: "Read the token count beside the spinner".
* **Feature**: Displays a live, approximate token count next to the spinner during execution (e.g., `Deciphering… (10m 27s · ↓ 5.5k tokens)`).
* **Scope**: Only covers *output* of the current turn (text, tool calls, thinking, subagents).
* **Exclusions**: Inputs (prompt, history, context).
* **Behavior**: Resets per turn/compaction. Hidden if no output yet, row too narrow, or screen reader mode.
* **Differentiation**: Clarifies this differs from `/usage` (whole session) and verbose mode (context size).
* **`statusline.md`**:
* Updated bullet point about "verbose mode token counter".
* **Change**: Explicitly states the verbose mode counter shows *context size* (based on last API response) and contrasts it with the *per-turn count beside the spinner* (linking to `costs.md`).
3. **Synthesize Analysis**:
* **What changed**: A new UI feature showing real-time token generation for the *current turn*, and a clarification to distinguish this from the existing "verbose mode" context size counter.
* **Why it matters**: Developers often worry about token costs and rate limits. Seeing how many tokens are generated *per turn* helps diagnose long-running operations or expensive tool usage instantly, without waiting for the session to finish or checking the `/usage` command. It clarifies the difference between "Context size" (what you send) and "Output size" (what you get back).
4. **Drafting the Response (in Chinese)**:
* *Overall Summary*: 文档新增了一项实时监控功能,即在 Spinner 旁边显示当前轮次的输出 Token 计数,并更新了状态行文档以区分该功能与 Verbose 模式下的上下文计数器。
* *Key Themes*:
* **实时成本可视化**: 引入了“Spinner 旁的 Token 计数”,帮助开发者即时监控当前轮次的输出流量。
* **概念澄清**: 明确区分了三种不同的 Token 计量方式:当前轮次输出、整个会话总用量(`/usage`)以及上下文大小。
* **用户体验优化**: 针对终端宽度和无障碍模式增加了显示细节说明,确保 UI 精细化。
* *Impact Level*:
* **Level**: Medium.
* **Reasoning**: 虽然不是破坏性变更,但新增的实时反馈对关心成本和性能的开发者非常有价值,能更直观地理解单次请求的资源消耗。
* *Action items*:
* 利用新的 Spinner 计数功能实时监控单次操作(如 Subagent 调用)的输出 Token 消耗。
* 理解“当前轮次输出”与“上下文大小”的区别,以便更准确地分析成本来源。
* 在较窄的终端窗口中注意该计数可能会被隐藏。
5. **Refining the Language**: Ensure professional, concise Chinese phrasing.
* "Spinner 旁" -> "加载指示器旁" or keep "Spinner" as it's a common term among devs. I'll use "Spinner" but maybe explain slightly or just use it as it fits the context.
* "Current turn" -> "当前轮次".
* "Context size" -> "上下文大小".
6. **Final Polish**:
* **Summary**: 新增了对 Spinner 旁 Token 计数的文档说明,该功能实时显示当前轮次的输出量;同时更新了状态行文档,以明确区分该实时计数与 Verbose 模式下的上下文计数器。
* **Themes**:
* **精细化成本监控**: 新增 UI 元素展示单次对话轮次的输出 Token 量(包括思考、工具调用等)。
* **概念辨析**: 清晰界定了“轮次输出”、“会话总量”和“上下文大小”三种 Token 统计维度的区别。
* **UI 适配细节**: 说明了计数显示的隐藏条件(如无输出、窗口过窄、屏幕阅读器模式)。
* **Impact**: Medium. 这是一个非常有用的可观测性增强,能帮助开发者即时评估工具调用的开销,但不会影响现有代码逻辑。
* **Actions**:
* 观察该实时计数以评估特定工具或 Subagent 的运行开销。
* 结合 `/usage` 命令和该实时计数,全面分析 Token 消耗结构。
* 留意该计数仅统计输出(下行数据),不含输入(Prompt/History)。
7. **Final Check against constraints**: Markdown format? Yes. Concise? Yes. Chinese? Yes. Max 5 action items? Yes.
8. **Generate Output**.