挑戰連續 100 天分享 Claude Code 小技巧
Day 45 | 用一句話叫它做一個 mod
這週 Claude Code 的 mods 影片一直被轉,昨天我也問了它半天「mods 到底是什麼」。
講白了,mod 是跑在 Claude Code 裡面的一小段程式:可以在輸入框上面多一條資訊、在旁邊開一個面板,或加一個你自己的 /指令。而且不用自己寫,直接講你要什麼:
做一個 mod,在輸入框上方顯示目前的 git branch
它會把檔案寫進 ~/.claude/dev-mods/,接著問你這場要不要開熱重載,選 Enable for this session,這輪跑完就出現了。不喜歡就繼續講,改完自動重載。
兩個坑。它寫的 mod 只活在這一場對話,想留著就把那個資料夾搬出來,之後用 claude --plugin-dir 加上那個路徑開。還有 mod 是用你的權限在跑的程式,讀得到你的檔案和金鑰,別人分享的先看過再裝。
TranslatedAbout this mod
Challenge: 100 Consecutive Days of Sharing Claude Code Tips
Day 45 | Ask It to Make a Mod with One Sentence
This week Claude Code's mods videos keep getting shared, and yesterday I also spent a while asking it "what exactly are mods."
To put it plainly, a mod is a small program that runs inside Claude Code: it can add a line of information above the input box, open a panel on the side, or add your own /command. And you don't have to write it yourself—just say what you want:
Make a mod that shows the current git branch above the input box
It will write the file into ~/.claude/dev-mods/, then ask whether you want to enable hot reload for this session. Choose Enable for this session, and it will appear after this run finishes. If you don't like it, keep talking, and it will auto-reload after changes.
Two pitfalls. The mod it writes only lives in this one conversation. If you want to keep it, move that folder out, and later start it with claude --plugin-dir plus that path. Also, a mod is a program running with your permissions, so it can read your files and keys. If someone else shares one, review it before installing.
Installation
See the original source for installation instructions.
Original text / README
挑戰連續 100 天分享 Claude Code 小技巧
Day 45 | 用一句話叫它做一個 mod
這週 Claude Code 的 mods 影片一直被轉,昨天我也問了它半天「mods 到底是什麼」。
講白了,mod 是跑在 Claude Code 裡面的一小段程式:可以在輸入框上面多一條資訊、在旁邊開一個面板,或加一個你自己的 /指令。而且不用自己寫,直接講你要什麼:
做一個 mod,在輸入框上方顯示目前的 git branch
它會把檔案寫進 ~/.claude/dev-mods/,接著問你這場要不要開熱重載,選 Enable for this session,這輪跑完就出現了。不喜歡就繼續講,改完自動重載。
兩個坑。它寫的 mod 只活在這一場對話,想留著就把那個資料夾搬出來,之後用 claude --plugin-dir 加上那個路徑開。還有 mod 是用你的權限在跑的程式,讀得到你的檔案和金鑰,別人分享的先看過再裝。