Addy Osmani 讲解如何上手 Claude Code Mods
Getting started with Claude Code Mods
AI 摘要
Addy Osmani 发布 Claude Code Mods 上手指南,说明 mods 是运行在会话中的 JavaScript/TypeScript 文件,可通过 hooks 观察事件、改写行为或渲染自定义界面。
正文 · AI 翻译
https://x.com/i/article/2115184482940784640
【X 长文】Getting started with Claude Code Mods
Mods were released in Claude Code a few weeks ago, and I'm sharing this guide to make it easier to get started with them.
Mods are small JavaScript or TypeScript files that you run within your Claude Code session. They allow you to react to events, modify the behavior of Claude Code or render your own interfaces in both the terminal and desktop applications. Here's a nice ~3m video on mods by Lydia:
What I love most about mods is that they can be created without learning their API. Run claude and describe the mod you want it to create. Approve the files as Claude writes them, say yes when asked to enable hot reloading, and your mod will be shown when the turn ends.
In this guide, you'll find a high-level overview of the capabilities of mods and how to prompt Claude Code to create one. You'll also learn how to persist, distribute and install your own mods. Btw, a more code-heavy version of this write-up is available too but also just ask Claude to help build your mods.
While Claude Code already lets you customize a lot of its behavior, such as configuration settings, permission policies, slash commands, skills and status lines, mods allow you to do so much more. With mods you can alter or override the behavior of Claude Code or render your own custom interfaces. Folks have been having fun building mods, including multiplayer Doom!
That was pretty neat. With mods you can create a tailored experience for your own workflow. Create a constant display that you monitor. Have a safety net for risky commands. Design your own diff renderer in a way you prefer to read.
For our walkthrough we'll begin with Token Weather, a mod that displays a turn-by-turn forecast of the context window above the prompt. Then we'll look at two more complex mods, Blast Radius and Replay Theater, to explore the possibilities of mods further.
If you want to explore the finished code for all three mods at any point, you can find them in anthropics/claude-code-playground.
原文
Original Title
Getting started with Claude Code Mods
Source
Addy Osmani
Site
x.com
Published
2026-10-28T06:15:43.000Z