什麼是 Claude Code Mods,它們如何運作 #ClaudeCode #Tutorial
一個 3 分鐘的上手教學,涵蓋什麼是 Claude Code mods、使用 /plugin 安裝和停用它們、用 claude plugin validate 驗證、用 Claude 撰寫一個 mod,以及用 claude plugin test 離線測試。
關於這個 mod
在版本 2.1.296 上對 Claude Code mods 的上手演練:一個用量計量 mod,顯示 5 小時、7 天和上下文用量,在 80% 時彈出提示,在 97% 時發出聲音。說明 mod 是一個帶有 JS/TS 事件處理器的外掛,透過 hooks/hooks.json 中的 modules 鍵來區分,並且只有 mod 才能繪製到介面中。涵蓋透過 /plugin install 安裝、用 Space 停用、使用 --safe-mode 獲得乾淨工作階段、用 claude plugin validate 檢查 mod(注意像 $.process.run 這樣的呼叫)、讓 Claude 使用外掛撰寫技能將一個 mod 寫入 ~/.claude/dev-mods/ 並支援熱重載,以及在無需登入或網路的情況下離線執行 claude plugin test。
安裝
安裝方式請查看原始來源。
原文 / README
What Are Claude Code Mods and How Do They Work #ClaudeCode #Tutorial
Claude Code mods, hands-on: the four mods running on my own Claude Code, how to install one and switch it off, how to check a mod with claude plugin validate before you install it, and how to have Claude write one for you. A mod is a plugin with code that Claude Code runs inside itself, so it can draw in the interface where a settings hook can't.
Higgsfield AI — Create AI Videos & Visuals Get 10% OFF here: https://higgsfield.ai?fpr=thomas-dccf7e
🚀 DYNAMOUS AI COMMUNITY
Want to learn agentic coding with live daily events and workshops? Check out Dynamous AI: https://dynamous.ai/?code=646a60 Get 10% off here 👉 https://shorturl.smartcode.diy/dynamous_ai_10_percent_discount
⚡ HOSTINGER — RELIABLE HOSTING FOR YOUR PROJECTS (10% OFF)
Whether you're shipping a portfolio, a side project, n8n flows, or AI agents — I use Hostinger for fast, affordable VPS + web hosting.
Get 10% off here 👉 https://hostinger.com/DIYSMARTCODE
n8n: https://n8n.partnerlinks.io/diysmartcode
(Affiliate links — costs you nothing, supports the channel.)
What you will see in this 3-minute breakdown: → A real run on Claude Code 2.1.296: /plugin shows "4 mods active", and my usage-meter mod writes 5-hour, 7-day and context usage under the prompt, with a pop-up at 80% and a sound at 97% → What a mod is: a plugin with JavaScript or TypeScript event handlers that Claude Code calls on a tool call, a submitted prompt, or a part of the interface being drawn. One "modules" key in the plugin's hooks/hooks.json makes it a mod → Mods vs settings hooks: a settings hook runs as a command outside Claude Code and can stop a tool call, but only a mod can add a pane or a band to the screen. My studio-hud band picked up a render check the moment Claude ran it → Install with /plugin install plugin-name@marketplace (mods need Claude Code v2.1.287 or later). Switch one off in the Installed tab of /plugin with Space. For one session without installed mods, start with --safe-mode, which turns off your other customizations too → Check before you install: claude plugin validate lists every event a mod hooks and every call it makes, without running it. Look for calls like $.process.run, which starts programs as you → Let Claude write one: describe the mod in a session, Claude writes it with the built-in plugin-authoring skill into ~/.claude/dev-mods/, you enable hot reloading for the session, and you copy the folder out to keep it → Test it offline: claude plugin test runs a mod's tests with no session, sign-in or network. All five usage-meter tests pass
Claude Code docs, Mods overview (install, /plugin, --safe-mode, validate): https://code.claude.com/docs/en/plugins/mods/overview Claude Code docs, Create a mod (modules key, plugin-authoring, hot reloading, dev-mods): https://code.claude.com/docs/en/plugins/mods/create Claude Code docs, Test a mod (claude plugin test): https://code.claude.com/docs/en/plugins/mods/test Claude Code docs, Manage mods (the calls to look for): https://code.claude.com/docs/en/plugins/mods/admin Claude Code docs, Mods reference (events): https://code.claude.com/docs/en/plugins/mods/reference Claude Code docs, Install plugins (enable or disable with Space): https://code.claude.com/docs/en/plugins/install Claude Code docs, CLI reference (--safe-mode): https://code.claude.com/docs/en/cli-reference Claude Code docs, Status line (5-hour and 7-day usage): https://code.claude.com/docs/en/statusline Claude Code changelog (2.1.287, Claude Mods): https://code.claude.com/docs/en/changelog Our Claude Code mods launch Short: https://youtu.be/tTe7GOJuc0E
Which would you build first: a usage warning, or a slash command of your own?
#ClaudeCode #Claude #ClaudeCodeMods #ClaudeMods #ClaudeCodePlugins #ClaudePlugins #ClaudeCodeTutorial #ClaudeCodeTips #ClaudeCodeSetup #ClaudeCodeForBeginners #ClaudeCodeHooks #Anthropic #AICoding #AIAgents #AgenticCoding #DeveloperTools #CodingWithAI #VibeCoding #DevTips #Shorts
