Anthropic 发布 Claude Code Mods
Customize Claude Code with mods
Claude Code 扩展性的重要一步,Mods 机制让开发者能深度定制工作流,做 AI 工程化的同学值得重点关注其 API 设计。
Customize Claude Code with mods
使用 mods 自定义 Claude Code
Change how Claude Code behaves and looks with a few lines of TypeScript.
只需几行 TypeScript 代码,即可更改 Claude Code 的行为和外观。
- Category
- Product announcements
- Product
- Claude Code
- Date
- October 1, 2026
- Reading time
- 5
- min
- Share
- Copy link
- https://claude.com/blog/claude-code-mods
- 分类
- 产品公告
- 产品
- Claude Code
- 日期
- 2026年10月1日
- 阅读时间
- 5
- 分钟
- 分享
- 复制链接
- https://claude.com/blog/claude-code-mods
Today we're introducing mods, small TypeScript functions that change how Claude Code works. A mod can rewrite a prompt, add new UI, replace a built-in feature, or add entirely new functionality. You can write a mod yourself, or ask Claude Code to write one for you. Mods ship inside plugins, so you install and share them like any plugin. They work in the Claude Code CLI and desktop app.
今天我们推出 mods,这是一种小型的 TypeScript 函数,可改变 Claude Code 的工作方式。mod 可以重写提示词、添加新的用户界面、替换内置功能或增加全新的功能。你可以自己编写 mod,也可以要求 Claude Code 为你编写一个。mods 随插件一起发布,因此你可以像安装和分享任何插件一样安装和分享它们。它们在 Claude Code CLI 和桌面应用中均可运行。
Mods run with the same access to your machine as Claude Code itself. They aren’t sandboxed, and you should only install mods from sources you trust, the same way you'd install any code on your computer.
mods 拥有与 Claude Code 本身相同的对机器的访问权限。它们不受沙箱限制,因此你应仅从可信来源安装 mods,就像你在计算机上安装任何代码一样。
To see what mods can do, read our guide to building your first mod.
要了解 mods 能做什么,请阅读我们关于构建第一个 mod 的指南。
Why we built mods
我们为何构建 mods
Developers have asked for more control over how Claude Code works, without waiting for us to ship a feature. Hooks helped give users some of this control, but hooks can't rewrite events, draw new UI, or replace features. Mods can.
开发者希望在不等待我们推出新功能的情况下,获得对 Claude Code 工作方式的更多控制权。Hooks 曾帮助用户获得部分此类控制权,但 hooks 无法重写事件、绘制新界面或替换功能。而 mods 可以。
We want Claude Code to feel like yours, so you can shape it to the way you work. We shared the design for mods on GitHub before launch to get feedback from developers. Thank you to everyone who weighed in.
我们希望让 Claude Code 感觉像是属于你的,这样你就可以根据自己的工作方式对其进行塑造。我们在上线前在 GitHub 上分享了 mods 的设计方案,以收集开发者的反馈。感谢所有参与讨论的人。
How mods work
mods 的工作原理
Each time Claude Code does something, it emits an event. Examples include calling a tool, asking for permission, and drawing part of the screen. A mod is a function that hooks into one of these events. A mod can run before the event, after it, or instead of it. It can also wrap the event, running code both before and after. With one function, a mod can:
每次 Claude Code 执行某项操作时,都会发出一个事件。示例包括调用工具、请求权限以及绘制屏幕的一部分。mod 是一个挂钩到这些事件之一的函数。mod 可以在事件之前、之后或替代事件运行。它还可以包装事件,在事件前后都运行代码。通过一个函数,mod 可以实现:
- Rewrite a prompt before it reaches the model.
- Block, rewrite, or retry a tool call.
- Approve or deny a permission request.
- Redact secrets from tool output before Claude reads it.
- 在提示词到达模型之前对其进行重写。
- 阻止、重写或重试工具调用。
- 批准或拒绝权限请求。
- 在 Claude 读取之前,从工具输出中隐藏敏感信息。
A mod can also change what you see. It can edit or replace part of the interface Claude Code draws, like a tool result or a question from Claude. It can add buttons and inputs, and other mods can respond when you press them. Today, a mod can target the terminal, the desktop app, or both.
插件(mod)还可以改变你的所见内容。它可以编辑或替换 Claude Code 绘制的界面的一部分,例如工具结果或来自 Claude 的问题。它可以添加按钮和输入框,其他插件可以在你按下它们时做出响应。目前,插件可以针对终端、桌面应用或两者。
When several mods hook the same event, they run in the order they load. The first mod to load sees the event first and the result last. This lets you stack mods from different authors.
当多个插件挂钩同一事件时,它们按加载顺序运行。最先加载的插件最先看到事件,最后看到结果。这允许你堆叠来自不同作者的插件。
You can also use Claude Code to mod Claude Code. Ask Claude to create a mod, and it can write the TypeScript, install it, and hot reload it in your session.
你还可以使用 Claude Code 来修改 Claude Code。让 Claude 创建一个插件,它可以编写 TypeScript 代码、安装它并在你的会话中热重载。
Swap built-in features for your own
用你自己的功能替换内置功能
Some built-in features of Claude Code now ship as mods. For example, the built-in /diff feature is now a mod, so you can turn it off (in /plugin) or replace it with your own version. We plan to move more built-in features to mods over time, so you can pare Claude Code down to a small core and add back only what you want.
Claude Code 的一些内置功能现在作为插件提供。例如,内置的 /diff 功能现在是一个插件,因此你可以关闭它(在 /plugin 中)或用你自己的版本替换它。我们计划随着时间的推移将更多内置功能迁移到插件,这样你就可以将 Claude Code 精简为一个小型核心,并只添加你需要的功能。
Mods for teams and enterprises
面向团队和企业的插件
Mods ship inside plugins, so your existing plugin controls apply. Admins can allow or block plugin marketplaces. On Team and Enterprise plans, an owner sets this in the admin console. On Claude API and third-party API plans, admins push managed settings to users' machines.
插件随插件包(plugins)一起分发,因此你现有的插件控制策略仍然适用。管理员可以允许或阻止插件市场。在 Team 和 Enterprise 计划中,所有者在管理控制台设置此选项。在 Claude API 和第三方 API 计划中,管理员将受管设置推送到用户的机器上。
On Team and Enterprise plans, and on any machine with managed settings, a built-in mod called sec-default (“security default”) loads first. It stops mods that users install from doing risky things, like overriding your permission deny rules. You can view the source code to see what it restricts. Admins can load their own mods first instead. If you do, add sec-default to your list to keep its restrictions.
在 Team 和 Enterprise 计划中,以及在任何具有受管设置的机器上,一个名为 sec-default(“安全默认”)的内置插件会最先加载。它会阻止用户安装的插件执行危险操作,例如覆盖你的权限拒绝规则。你可以查看源代码以了解其限制内容。管理员也可以优先加载自己的插件。如果你这样做,请将 sec-default 添加到你的列表中,以保持其限制。
Teams can also use mods to build their own controls and functionality. For example:
团队还可以使用插件构建自己的控制和功能。例如:
- CI/CD status: a mod can show your pipeline’s status in a pane beside the conversation, and update it as builds pass or fail.
- Production safeguards: a mod can require confirmation before any command touches production config.
- Audit logging: a mod that loads first can record every call that every other mod makes.
- CI/CD 状态:一个插件可以在对话旁边的窗格中显示你的流水线状态,并在构建通过或失败时更新它。
- 生产环境防护:一个插件可以在任何命令触及生产配置之前要求确认。
- 审计日志记录:最先加载的插件可以记录每个其他插件发出的每次调用。
Getting started
入门指南
Mods are available today in the Claude Code CLI and desktop app. Install plugins that include mods from the Claude directory or by running /plugin in the CLI. To share a mod, package it in a plugin and submit it to the directory.
插件今天已在 Claude Code CLI 和桌面应用中可用。从 Claude 目录安装包含插件的插件包,或在 CLI 中运行 /plugin。要共享插件,请将其打包在插件包中并提交到目录。
To build your own mods, read our getting started guide or see the documentation.
要构建你自己的插件,请阅读我们的入门指南或查看文档。
No items found.
未找到项目。
PrevPrev
上一页上一页
0/5
NextNext
下一页下一页
eBook
电子书
FAQ
常见问题解答
No items found.
未找到任何项目。
Related posts
相关文章
Explore more product news and best practices for teams building with Claude.
探索更多产品新闻和面向使用 Claude 构建团队的实践指南。
Sep 30, 2026
2026年9月30日
Claude for Government is now generally available
Claude for Government 现已全面开放
Product announcements
产品公告
Claude for Government is now generally availableClaude for Government is now generally available
Claude for Government 现已全面开放Claude for Government 现已全面开放
Claude for Government is now generally availableClaude for Government is now generally available
Claude for Government 现已全面开放Claude for Government 现已全面开放
Sep 25, 2026
2026年9月25日
Build plugins for Claude
为 Claude 构建插件
Product announcements
产品公告
Build plugins for ClaudeBuild plugins for Claude
为 Claude 构建插件为 Claude 构建插件
Build plugins for ClaudeBuild plugins for Claude
为 Claude 构建插件为 Claude 构建插件
Sep 23, 2026
2026年9月23日
Claude Marketplace: one place to discover plugins, agents, and services from our partners
Claude Marketplace:一个发现合作伙伴提供的插件、智能体和服务的地方
Product announcements
产品公告
Claude Marketplace: one place to discover plugins, agents, and services from our partnersClaude Marketplace: one place to discover plugins, agents, and services from our partners
Claude Marketplace:一个发现合作伙伴提供的插件、智能体和服务的地方Claude Marketplace:一个发现合作伙伴提供的插件、智能体和服务的地方
Claude Marketplace: one place to discover plugins, agents, and services from our partnersClaude Marketplace: one place to discover plugins, agents, and services from our partners
Claude Marketplace:一个发现合作伙伴提供的插件、智能体和服务的地方Claude Marketplace:一个发现合作伙伴提供的插件、智能体和服务的地方
Sep 24, 2026
2026年9月24日
Claude Tag now supports personal connectors in channels
Claude Tag 现在支持频道中的个人连接器
Product announcements
产品公告
Claude Tag now supports personal connectors in channelsClaude Tag now supports personal connectors in channels
Claude Tag 现在支持频道中的个人连接器Claude Tag 现在支持频道中的个人连接器
Claude Tag now supports personal connectors in channelsClaude Tag now supports personal connectors in channels
Claude Tag 现在支持在频道中使用个人连接器Claude Tag 现在支持在频道中使用个人连接器
Transform how your organization operates with Claude
用 Claude 改变组织的运作方式
See pricing
查看定价
See pricingSee pricing
查看定价查看定价
Contact sales
联系销售
Contact salesContact sales
联系销售联系销售
Get the developer newsletter
获取开发者通讯
Product updates, how-tos, community spotlights, and more. Delivered monthly to your inbox.
产品更新、操作指南、社区亮点等。每月发送至您的收件箱。
SubscribeSubscribe
订阅订阅
Please provide your email address if you'd like to receive our monthly developer newsletter. You can unsubscribe at any time.
如果您希望接收我们的月度开发者通讯,请提供您的电子邮件地址。您可以随时取消订阅。
Thank you! You’re subscribed.
谢谢!您已订阅。
Sorry, there was a problem with your submission, please try again later.
抱歉,提交时出现问题,请稍后重试。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力