Claude Code plugin governance routing:v2.1.195 修复 consent 与 hook 边界

Claude Code plugin governance routing 在 v2.1.195 修复 plugin consent、hook exact-match 与 background-agent durability,影响 coding-agent fleet。

TheRouter Newsroom来源 Anthropic Claude Code
Claude Code plugin governance routing policy board 展示 plugin consent、exact-match hooks、background agents 与 remote startup checks

Claude Code plugin governance routing 在 v2.1.195 变成了一次真实的升级治理问题。这次 release 没有发布新模型,而是修复 plugin consent path、hook matcher 精度和 background-agent durability。也正因为如此,它对 operator 很重要。对通过 AI gateway 或 enterprise developer fleet 运行 coding agent 的团队来说,Claude Code plugin governance routing 现在要回答的是:升级之后,每个 plugin、hook、Remote session 和 long-running agent 是否仍然保留同样的 trust boundary。

发生了什么

Anthropic 官方 Claude Code v2.1.195 release 在 6 月 26 日发布,核心是一组 fleet-control 修复。对 operator 最重要的变化单独看都不大,但组合起来很关键:

  • 仅通过项目 .claude/settings.json 启用的 external plugin,现在在每条 loader path 上都需要 explicit install consent。
  • 带连字符的 hook matcher,例如 code-reviewer 或 mcp__brave-search,不再意外执行 substring-match。现在它们会 exact-match;如果团队有意匹配某个 hyphenated MCP server 下的所有 tools,应使用 mcp__brave-search__.* 之类的 pattern。
  • 当 plugin 的 plugin.json name 与 marketplace entry name 不一致时,/plugin Enable 和 Disable 现在可以正常工作。
  • 由新版 Claude Code 写入的 background job 不会再从 claude agents 中消失或丢失数据。
  • Crashed background task 重新打开时会进入 restart,而不是展示空白屏;control socket 启动失败时,unreachable background-agent daemon 也不会阻塞 restart。
  • Remote session startup 在 container 启动期间会显示 provisioning checklist。
  • CLAUDE_CODE_DISABLE_MOUSE_CLICKS 可以在 fullscreen mode 下禁用 mouse click、drag 和 hover,同时保留 wheel scroll。

这次 release 延续了过去一周的 control-plane 更新,包括 Claude Code shell classifier routing 和 Claude Code MCP reliability routing。v2.1.195 收窄的是另一组 surface:plugin trust、hook targeting、background-agent persistence 和 Remote startup evidence。

为什么对 AI 工程团队重要

Plugin 不只是一个方便的功能包。在 enterprise coding-agent stack 中,它可能携带 skills、hooks、MCP server 假设、commands 和 workspace-specific behavior。如果某个 project setting 能在某条 loader path 上绕过 explicit consent 启用 external plugin,operator 就存在 policy gap。如果 hook matcher 因 substring 行为意外命中 hyphenated name,gateway 可能过度应用或漏掉 safety control。如果 background job 在版本边界后消失,audit trail 和 cost attribution 都会变得不可靠。

因此,Claude Code plugin governance routing 会把升级 checklist 从“CLI 能不能启动”改成“我们能不能证明每个 workspace 都执行了同样的 plugin 与 hook policy”。这个答案会直接影响那些在 production repository、customer data 或 deployment credential 上使用 coding agent 的团队。

Hook 变化尤其重要。很多团队用 hooks 强制执行 linting、secret scan、command approval 或 MCP access policy。Exact-match 行为比意外 substring-match 更安全,但它也可能暴露出一些过去依赖旧行为的配置。升级后,operator 应该检查每个 hyphenated hook target,并决定它应该只匹配一个 tool、一个 agent,还是某个 MCP server namespace 下的所有 tools。

路由与运维视角

把 v2.1.195 升级当成 policy migration。先从 plugin provenance 开始。每个 external plugin 都应该有 owner、source、version、install-consent record 和 workspace scope。Project-level setting 很有用,但不能变成绕过 fleet-level approval 的静默通道。

然后审计 hook matcher。把它们分成三类:

  1. Exact tool hooks:面向单个命名 tool 或 reviewer,hyphenated identifier 应只匹配该 target。
  2. Namespace hooks:面向 MCP server,类似 mcp__brave-search__.* 的 pattern 必须是有意使用且有文档记录的。
  3. Deny or approval hooks:面向可能修改代码、读取 secret、部署 infrastructure 或打开 network egress 的 commands。

Background agent 需要单独的 lane。Coding-agent gateway 应为 session ID、workspace、plugin set、hook policy version、running command、owner 和 last visible state 保留 durable record。v2.1.195 的修复会降低消失概率,但当 background task 跨过 update、crash 或 Remote container restart 时,operator 仍然需要独立证据。

对 TheRouter 读者来说,这个模式不只适用于 Claude Code。一旦 coding agent 变成长时间运行、带 plugins 与 hooks 的进程,只有 model router 已经不够。真正的 operational unit 是 session:model choice、tool surface、plugin provenance、hook policy、remote host 和 background lifecycle 应该一起被 route。

TheRouter 用户应关注或尝试什么

在把 v2.1.195 推到所有 developer machine 或 Remote host 之前,先做 staged upgrade。

使用这份 checklist:

  • 盘点通过 .claude/settings.json 启用的 external plugins,并确认每条 loader path 都出现 explicit install consent。
  • 搜索 hook configs 中的 hyphenated identifiers,决定每一项应该 exact-match 还是 namespace-wide。
  • 为 high-risk hooks 增加 regression tests:secret scanning、deployment approval、package install approval 和 MCP tool allowlists。
  • 重新打开升级前后创建的 background jobs,并确认 claude agents 仍显示 state、owner 和可恢复的 task data。
  • 在 disposable workspace 中测试 crashed background task 与 failed control socket path。
  • 验证 Remote provisioning checklist 是否提供足够证据,让 operator 区分 slow startup 和 broken setup。
  • 把这次升级与更宽的 TheRouter docs 模型联系起来:agent routing policy 应包含 tools、plugins、hooks 和 background lifecycle,而不只是 provider selection。

实际结论很简单:Claude Code plugin governance routing 把一些看似细小的 release-note fixes 变成了 fleet-control requirement。如果你的 coding agents 可以加载 plugins、匹配 hooks,并在后台持续工作,那么你的 gateway policy 就需要像路由 model calls 一样,路由并审计这些 surface。

帮助与联系