Claude Code mods 入门:从空文件夹构建第一个 mod
Anthropic 发布 Claude Code mods 入门教程,mod 是运行在 Claude Code 会话内的 JavaScript 或 TypeScript 文件,可监听事件、改写行为或绘制自定义 UI,本质是插件内的 hooks。教程从空文件夹构建约 80 行的 Token Weather,在提示词上方实时显示上下文窗口占用,并演示 Blast Radius 和 Replay Theater 两个更复杂的 mod。需要 Claude Code 2.1.287 或更高版本,mods 默认开启,完整代码在 anthropics/claude-code-playground。
pane, run a process, register a slash command, or register a tool the model can call. Claude Code uses them itself. Some of Claude Code's own features are built as mods, including AGENTS.md support and the /diff pane beside the conversation. Their source, with tests, is in the public anthropics/claude-code repository under mods/, so you can read how the team builds them. Token Weather reads how full the context window is after each turn and draws one line above the prompt: a weather icon, the pe
匹配字段正文






