### 文档变更分析
#### 1. 总体摘要
本次文档更新主要针对 Claude Code 的会话恢复与上下文行为进行了重要澄清和修复,明确了 SSH 会话和自定义提示词的限制,同时为 Mod 开发者引入了新 API 并统一了控制台命名。
#### 2. 关键主题
* **上下文行为变更(重要)**:文档明确指出,在使用 `--system-prompt` 或自定义子代理时,系统将**不再**自动包含 Git 状态快照。这对自动化脚本和自定义代理的行为有直接影响。
* **SSH 会话限制与说明**:新增了针对 SSH 会话的限制文档,包括无法在 Browser 面板中预览应用(需端口转发),以及创建 PR 需在**远程机器**上预先安装并认证 `gh` CLI。
* **Mod 扩展性与可观测性**:引入了新的 Mod API(如 `virtualText`, `$.ui.view`)和 OpenTelemetry 指标(如 `gen_ai` 属性),并支持 Agent 模型的解析与修正。
* **关键 Bug 修复**:Changelog 2.1.300 版本修复了高优先级问题,包括会话恢复时因压缩导致的消息丢失、云会话因策略读取超时而挂起,以及 Agent hooks 模型解析失败等。
* **品牌与链接统一**:产品名称由 "Developer Console" 正式统一为 "Claude Console",并更新了所有相关的链接路径和说明文本。
* **桌面应用 `autoPort` 逻辑**:细化了端口占用时的处理逻辑,明确了脚本硬编码端口与 `PORT` 环境变量的优先级行为。
#### 3. 影响等级:中
**理由**:
虽然本次更新多为文档澄清和 Bug 修复(修正了会话恢复时数据丢失等严重稳定性问题),但关于“自定义提示词不再包含 Git 快照”的行为变更属于功能性调整,可能破坏现有脚本或工作流的预期结果,需要开发者注意。此外,SSH 相关的新增说明帮助开发者规避潜在的配置陷阱。
#### 4. 开发者行动项
* **审查自定义提示词配置**:如果你使用了 `--system-prompt`、`--bare` 模式或自定义 Sub-agents,请确认是否依赖自动注入的 Git 状态,如有需要需手动添加上下文。
* **配置 SSH 远程环境**:若在 SSH 会话中使用 Desktop 的 PR 创建功能,请确保在远程机器上手动安装并登录 `gh` CLI,Desktop 不会在 SSH 模式下提示安装。
* **更新内部文档与脚本**:将所有指向 "Developer Console" 的引用更新为 "Claude Console"。
* **利用新 Mod 特性**:Mod 开发者可尝试使用 `virtualText` 和 `$.ui.view({ agentId })` 增强插件 UI 和交互体验。
* **检查端口启动逻辑**:如果你依赖 `autoPort` 的默认行为(未设置),请确认你的启动脚本是否读取 `PORT` 环境变量,否则在端口被占用时服务器可能无法启动。
💭 Model Reasoning
1. **Analyze the Request:**
* **Role:** World-class programmer analyzing documentation changes.
* **Task:** Analyze a batch of 11 changed pages from Claude Code/API documentation.
* **Output:** Concise, insightful analysis in markdown, focusing on developer impact.
* **Language:** Chinese.
* **Format:**
1. Overall Summary (1-2 sentences).
2. Key Themes (bullets).
3. Impact Level (Low/Medium/High/Breaking) + reasoning.
4. Action Items (max 5 bullets).
2. **Analyze the Individual Diffs:**
* **Page 1: `claude-code-on-the-web.md`**
* Change: Updated "Network secrets" description. Removed mention of "Pro and Max plans" limitations for Anthropic-hosted environments and removed "Team and Enterprise plans don't have them yet".
* Meaning: Network secrets feature is likely now available or at least documented without specific plan restrictions for Anthropic-hosted environments (or the specific plan restriction text was outdated/removed for clarity).
* Dev Impact: Feature availability might have changed (broadened).
* **Page 2: `desktop.md`** (Major changes)
* Change 1: "Bypass permissions" mode clarification. Now allows archiving sessions without asking, but "deleting" a session (new specific action mentioned?) might still require it, or just clarification on "archiving". *Correction*: It says "except for... desktop actions such as deleting a session, though not [archiving one]". This implies *archiving* is auto-approved in Bypass mode, but *deleting* might still ask or vice versa?
* *Re-reading carefully*: "except for... desktop actions such as deleting a session, though not [archiving one]." -> It means deleting asks, archiving doesn't? Or archiving asks, deleting doesn't? The previous text said "Before archiving any session, Claude asks you first." The new text says "You get an approval card before Claude archives a session, except in Auto mode and Bypass permissions mode...".
* *Later change*: "You get an approval card before Claude archives a session, except in Auto mode and Bypass permissions mode, where Claude can archive a session without one."
* Change 2: Browser pane limitations in SSH sessions. Can't open apps there; need port forwarding.
* Change 3: PR monitoring in SSH sessions. Needs `gh` installed on the remote machine.
* Change 4: `autoPort` behavior logic updated. Complex logic about hardcoded ports vs. `PORT` env var. Now defaults to free port if unset, except specific script scenarios.
* Change 5: Environment inheritance on macOS/Windows (minor wording change).
* **Page 3: `headless.md`**
* Change: Clarification on `--bare` mode behavior. Clarification that using `--system-prompt` replaces the default prompt *and* starts without the git status snapshot.
* Dev Impact: Critical if using `--bare` or `--system-prompt` expecting git context.
* **Page 4: `sub-agents.md`**
* Change: Similar to `headless.md`. Custom subagents with prompts start without git status snapshot.
* Dev Impact: Consistency with `--system-prompt`.
* **Page 5 & 6: `intro.md` & `pricing.md`**
* Change: "Developer Console" -> "Claude Console".
* Change: Billing link text update.
* Dev Impact: Branding consistency. Nothing functional.
* **Page 7: `api/overview.md`**
* Change: Links updated to include explicit URLs in parentheses (e.g., `platform.claude.com/playground`).
* Dev Impact: None functional, just better referencing.
* **Page 8 & 9: `api/models/list.md` & `api/beta/files/upload.md`**
* Change: Added `"telemetry-destinations-2026-08-11"` to beta headers.
* Dev Impact: API change/Preview feature.
* **Page 10: `api/rate-limits.md`**
* Change: Links updated. Wording tweaks.
* Dev Impact: None functional.
* **Page 11: `CHANGELOG.md.md`** (Crucial for context)
* Version `2.1.300`.
* Added `virtualText`, `$.ui.view({ agentId })`, `dir` prop for mods.
* Added `cache_creation_5m_tokens` / `1h_tokens` to telemetry.
* Added OpenTelemetry GenAI attributes.
* Added `/advisor` on AWS.
* **Behavioral Changes/Fixes**:
* Cloud sessions network policy bug fix.
* `autocompact` warning fix.
* `SessionEnd` hooks fix.
* Subagents in `/tasks` fix.
* **Agent hooks `model` fix**: "agent hooks ignoring their `model`: aliases like `haiku` now resolve...".
* **Headless/Agent SDK resume fix**: "resuming a headless or Agent SDK session losing the recent messages a compaction had kept...". This is a significant bug fix for long-running sessions.
* **Cloud sessions hanging fix**: "cloud sessions hanging 5 minutes per turn when the organization's policy can't be read".
3. **Synthesize and Group Themes:**
* **Theme 1: SSH & Desktop Behavior.** Significant updates on how desktop/SSH sessions work regarding browser panes, PR creation, and port handling (`autoPort`).
* **Theme 2: Headless & Subagents Context.** Clarification on what context is lost (git status snapshot) when using custom prompts (system prompts or subagents).
* **Theme 3: Branding & UI.** "Developer Console" is now "Claude Console". Links updated.
* **Theme 4: Bug Fixes & Stability (Changelog).** The changelog reveals critical fixes for session resumption (compaction issues), cloud sessions hanging, and agent model resolution.
* **Theme 5: Mod/Extensibility.** New mod features (`virtualText`, `agentId` view).
4. **Determine Impact Level:**
* *Is it Breaking?* No explicit breaking changes mentioned in docs (like API removal), but the behavior change regarding git status snapshot for custom prompts is a functional change users might notice.
* *Is it High?* The changelog mentions fixes for "losing recent messages" on resume. That's High for users relying on long sessions. The `autoPort` change is Medium.
* *Conclusion:* **Medium-High**. It's mostly clarifications and fixes, but the fixes address data loss issues (session resume) and the context behavior change for custom prompts affects automation.
5. **Draft Action Items:**
* Check `--bare` / `--system-prompt` usage if you rely on git context being auto-included.
* Update internal docs if using "Developer Console" (now "Claude Console").
* If using SSH sessions with Claude Desktop, configure `gh` on remote if using PR features.
* If using Mod development, check out new `virtualText` and `$.ui.view` features.
* Verify behavior for `autoPort` if your servers depend on specific port availability logic.
6. **Drafting the Content (in Chinese):**
* *Summary*: 本次更新主要集中在修正 Claude Code 在会话恢复、SSH 模式及子代理行为上的功能细节,同时引入了 Mod 开发的新特性,并统一了产品名称。
* *Themes*:
* **Context & Behavior Refinement**: Clarified that custom system prompts (CLI or Sub-agents) exclude the default git status snapshot. Updated `autoPort` logic.
* **Desktop & SSH Limitations**: Documented constraints for Browser pane and PR creation in SSH sessions.
* **Modding & Extensibility**: New Mod features (`virtualText`, `agentId` view) and telemetry updates.
* **Critical Bug Fixes**: Changelog 2.1.300 fixes session resume data loss (compaction issues) and cloud session hangs.
* **Branding**: "Developer Console" renamed to "Claude Console".
* *Impact*: Medium. While mostly fixes and clarifications, the change in git context injection for custom prompts alters behavior, and the session resume bug fix is critical for stability.
* *Action Items*:
* Review usage of `--system-prompt` or custom subagents to ensure you aren't relying on the now-missing git status snapshot.
* Ensure GitHub CLI (`gh`) is installed on remote machines if using PR creation in SSH sessions.
* Update internal documentation/wiki references from "Developer Console" to "Claude Console".
* If developing Mods, explore the new `virtualText` and `$.ui.view` APIs.
* Verify dev server startup scripts regarding the new `autoPort` behavior.
7. **Refining the Output:**
* Ensure markdown format is clean.
* Check translation tone (professional, developer-focused).
* Make sure to link the changelog insights to the specific doc changes (like the git snapshot explanation).
*Self-Correction on Impact*: The change regarding "git status snapshot" in `headless.md` and `sub-agents.md` is subtle but important. If a user's workflow depends on the prompt automatically including the git diff, and they switch to a custom prompt, it breaks. This needs to be highlighted.
*Self-Correction on `autoPort`*: The documentation change in `desktop.md` regarding `autoPort` is quite detailed. It clarifies edge cases. This is good to mention.
8. **Final Polish (Chinese):**
* Summary: 本次文档更新主要涉及 Claude Code 的会话行为修正、SSH 限制说明、Mod 开发新特性以及产品名称统一。变更日志 2.1.300 显示了关键的数据丢失修复。
* Themes: 上下文行为变更(Git 快照缺失)、SSH 会话限制、Mod 扩展能力、关键 Bug 修复、品牌统一。
* Impact: Medium。
* Action Items: Review prompt usage, setup remote env for SSH, update branding refs, explore new mod features, check port logic.
9. **Construct Final Output.** (Proceeding to generate response).