Ado· @adocomplete · X·AI 评分57
Anthropic 开发者关系人员介绍 Claude Code 的 mod 插件机制
AI 导读
Anthropic 开发者关系团队成员 Ado Kukic 介绍 Claude Code 的 mod:一种插件,用 JavaScript 事件处理器在 Claude Code 内运行,每个处理器收到 ($, e, next),可监听事件、改写事件或自行响应,无需构建步骤。与 hooks 的不同在于各处理器共享变量,例如一个处理器统计工具调用次数、另一个画出该计数;注册的 slash 命令可立即执行函数,无需模型轮次。
正文 · 原文
A mod is a plugin with a JavaScript file of event handlers that run inside Claude Code. Each one gets ($, e, next): watch the event, rewrite it, or answer it yourself. No build step.
Why it feels different from hooks: handlers share variables. Count tool calls in one, draw the count in another. A slash command you register runs your function at once, with no model turn.
来源:Ado · x.com