### 整体摘要
此次文档更新主要集中在 **v2.1.191** 版本的功能发布与逻辑澄清,重点提升了用户体验(如会话恢复、减少认证步骤)、增强了系统鲁棒性(MCP 重试机制),并放宽了配置语法的灵活性(如 Hook 匹配器)。
### 关键主题
* **v2.1.191 版本特性:** 多项核心改进均与此版本号相关,包括会话恢复、网络重试和语法增强。
* **用户体验(UX)优化:**
* **会话恢复:** 支持通过 `/resume` 恢复 `/clear` 之前的会话状态。
* **认证流程:** SSH 或无头环境下自动检测无浏览器并打印 URL,不再强制需要 `--no-browser` 标志。
* **交互提示:** 交互模式下搜索提示更友好,沙箱域名批准后当前会话不再重复提示。
* **稳定性与鲁棒性:**
* **MCP 连接:** 对 MCP 服务器连接后的能力发现请求(如 `tools/list`)增加了自动重试机制。
* **配置回退:** 明确了当 `availableModels` 配置无效时的降级行为,避免意外锁死。
* **语法与配置灵活性:** Hook 匹配器(matcher)现在支持逗号分隔符和周围空格,使配置更易读;`sandbox.credentials` 的无效条目处理逻辑与其它安全字段保持一致。
### 影响级别
**Medium**(中等影响)
* **理由:** 虽然没有破坏性变更,但新增的会话恢复能力、自动化的认证检测和 MCP 重试机制显著改善了工具的可靠性和易用性。配置语法的放宽也降低了编写 Hook 的门槛。
### 开发者行动项
* **更新 Hook 配置:** 利用新增的逗号和空格支持,简化现有的 Hook 匹配器定义。
* **测试 SSH 登录流程:** 验证在远程环境中移除 `--no-browser` 标志后,`claude mcp login` 是否能按预期工作。
* **利用会话恢复:** 在用户培训或文档中提及 `/resume` 可用于挽救误触 `/clear` 后的对话上下文。
* **检查沙箱凭证规则:** 确认 `sandbox.credentials` 配置符合新的条目剥离逻辑,确保安全策略按预期生效。
💭 Model Reasoning
1. **Analyze the Request:**
* **Role:** World-class programmer analyzing documentation changes.
* **Task:** Analyze a batch of 9 documentation page diffs.
* **Output Format:** Markdown, concise, insightful.
* **Language:** Chinese (as requested: "请用中文回复").
* **Structure:** 1. Overall Summary, 2. Key Themes, 3. Impact Level, 4. Action Items.
2. **Analyze the Input Diffs (Page by Page):**
* **`amazon-bedrock.md`:**
* *Change:* Clarified merge behavior when listing a specific Mantle model ID (e.g., `anthropic.claude-haiku-4-5`) alongside its alias (`haiku`). Added explanation that they resolve to the same family and only the specific entry is kept.
* *Significance:* Clarification on model selection logic in settings.
* **`checkpointing.md`:**
* *Change:* Added new section "Rewind past a cleared conversation".
* *Feature:* v2.1.191 allows resuming the session active *before* a `/clear` command via a specific menu entry.
* *Significance:* UX improvement for session recovery.
* **`discover-plugins.md`:**
* *Change:* Refined text regarding the "Not used recently" plugin group.
* *Detail:* Clarified the duration condition: "haven't invoked in at least two weeks, over a span of at least 10 sessions".
* *Significance:* Precision in how "unused" is calculated.
* **`hooks.md`:**
* *Change:* Updated table for `matcher` field evaluation.
* *Feature:* v2.1.191 supports spaces, commas, and optional surrounding whitespace in exact string lists (separated by `|` or `,`).
* *Constraint:* `FileChanged` and `StopFailure` events still only accept `|` as a separator.
* *Significance:* Easier configuration syntax for hooks.
* **`interactive-mode.md`:**
* *Change:* Updated `/` command in NORMAL mode navigation table.
* *Feature:* v2.1.191 adds a hint in the empty search prompt.
* *Significance:* UX improvement/hint visibility.
* **`mcp.md`:**
* *Change 1:* Added v2.1.191 retry logic for capability discovery requests (`tools/list`, `prompts/list`, `resources/list`) post-connection.
* *Change 2:* Updated `claude mcp login` behavior. It now detects if a browser is unavailable (SSH/Linux no-display) automatically, printing the URL without needing `--no-browser`. `--no-browser` forces the prompt even if a browser is found.
* *Significance:* Reliability improvement for MCP connections and authentication flow.
* **`model-config.md`:**
* *Change 1:* Clarified text about `enforceAvailableModels` behavior when the list is non-empty but invalid (enforcement is skipped, Default resolves to account default).
* *Change 2:* Text polish ("Both restrictions apply together" instead of "The two mechanisms compose").
* *Change 3:* Text polish ("shown as a normal error" instead of "surfaces as a normal error").
* *Significance:* Clarity updates on error handling and policy enforcement.
* **`sandboxing.md`:**
* *Change 1:* Clarified `sandbox.credentials` text regarding grouping.
* *Change 2:* v2.1.191 update to Domain restrictions: approving a domain allows it for the *rest of the session*, preventing repeated prompts.
* *Significance:* UX improvement (fewer prompts) and documentation clarity.
* **`settings.md`:**
* *Change:* Added row in "Security-enforcement fields" table for `sandbox.credentials`.
* *Feature:* v2.1.191 behavior: invalid entries are stripped with a warning; valid subset enforced. Wholly invalid value dropped with warning.
* *Significance:* Consistency in how invalid security settings are handled (fail-open or partial enforcement).
3. **Synthesize Findings:**
* **Common Thread:** The version **v2.1.191** appears repeatedly. This update focuses on UX refinements (fewer prompts, better hints), robustness (MCP retries, better settings validation), and syntax flexibility (hooks).
* **Specific Features:** Session recovery after `/clear`, automatic browser detection for auth, improved domain approval persistence, relaxed syntax for hook matchers.
4. **Drafting the Content (in Chinese):**
* *Overall Summary:* The updates primarily introduce features and clarifications for version v2.1.191, focusing on improving user experience (session recovery, fewer prompts), enhancing system robustness (MCP retries), and refining syntax (hooks).
* *Key Themes:*
* **v2.1.191 Feature Release:** Several new capabilities land here.
* **UX Enhancements:** `/resume` to recover cleared sessions, persistent domain approvals, browser detection for auth.
* **Reliability & Robustness:** Retries for MCP discovery, better handling of invalid security settings.
* **Syntax Flexibility:** Hooks now support comma separators and whitespace.
* *Impact Level:* **Medium**. The changes improve quality of life and configuration management, but don't appear to introduce breaking changes for existing workflows. The logic updates are additive or clarify edge cases.
* *Action Items:*
* Review `sandbox.credentials` configuration for new validation logic.
* Simplify hook matchers using new comma/space syntax.
* Update user guides to mention the new `/resume` capability for cleared sessions.
5. **Refining the Output (Self-Correction during drafting):**
* *Check:* Did I miss anything?
* *Observation:* The `interactive-mode` change is minor (a hint). The `model-config` changes are mostly text clarifications. The `mcp` login change removes the need for a manual flag in many cases.
* *Tone:* Professional, "world-class programmer".
* *Language:* Ensure natural-sounding Chinese technical terms (e.g., "Hook matchers" -> "Hook 匹配器", "Fallback" -> "回退", "Sandbox" -> "沙箱").
6. **Final Polish (Markdown Structure):**
* **Summary:** 此次更新主要集中在 **v2.1.191** 版本的功能发布与文档澄清,增强了用户体验(如会话恢复、减少认证步骤)、提升了系统鲁棒性(MCP 重试机制),并放宽了配置语法(如 Hook 匹配器)。
* **Themes:**
* **版本 v2.1.191 新特性:** 多项核心改进与此版本相关。
* **用户体验优化:** 新增从 `/clear` 命令后恢复会话的功能,沙箱域名批准后的会话级持久化,以及 SSH 环境下的浏览器自动检测。
* **语法与配置灵活性:** Hook 匹配器现在支持逗号分隔符和空格,简化配置。
* **稳定性增强:** MCP 服务器连接后的能力发现请求增加了重试机制;对无效安全配置的处理更加优雅。
* **Impact:** **Medium**(中等影响)。大多数更改属于体验增强和配置逻辑澄清,不具备破坏性变更,但能显著提升日常开发效率和系统稳定性。
* **Action Items:**
* 利用新版 Hook 语法简化匹配器配置(支持逗号和空格)。
* 了解 `sandbox.credentials` 在 v2.1.191 中对无效条目的处理逻辑变更。
* 体验并文档化 `/resume` 在恢复已清除会话时的使用场景。
7. **Final Output Generation.** (Proceed to generate output based on step 6).