ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 andrewli315

mod-manager

Claude Code 的工作階段 mod 管理器。提示列上方的工具列可讓你在目前工作階段中開啟或關閉任何本機安裝的 mod。

已翻譯

關於這個 mod

mod-manager 會在 Claude Code 提示列上方加入 MODS 工具列,讓你依工作階段開啟或關閉本機安裝的 mod。它會列出已知 mod、開關狀態與版本,提供 Enable all/Disable all,並在 Manage 窗格(/mods)中提供每個 mod 的 Enable/Disable 與 Save-as-default 控制項。選擇會依 session id 儲存,透過 ↻ Apply 按鈕(快捷鍵 a)套用待處理的變更。新出現、先前未見過的 mod,在你決定(Enable 或 Keep off)前會被拒絕。它會掃描 ~/.claude/dev-mods、~/.claude/plugins/synced、~/.claude/plugins/marketplaces、~/.claude/skills、CLAUDE_CODE_PLUGIN_DIRS 中的資料夾,以及同層資料夾;資料夾必須包含 .claude-plugin/plugin.json,並有帶 modules 清單的 hooks/hooks.json,才會被視為 mod。plugin.register hook 會在每個 mod 加入工作階段前評估它,拒絕已停用的 mod,讓它們的 hooks、命令與工具完全不會載入。把資料夾放進 mod 目錄,或使用 claude --plugin-dir 即可安裝;也能搭配 CLAUDE_CODE_PLUGIN_DIR_WATCH=1 將它加入 CLAUDE_CODE_PLUGIN_DIRS 以啟用熱重新載入。限制包括:只能關閉使用者層級的 mod;無法拒絕在它之前載入的 mod;未載入的 marketplace 外掛不會列出;行動裝置上無法使用工具列(但 /mods 仍可用)。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add andrewli315/mod-manager
claude plugin install mod-manager
原文 / README

mod-manager

A per-session mod manager for Claude Code. A toolbar above the prompt lets you switch any locally installed mod on or off for the current session.

╭────────────────────────────────────────────────────────╮
│ ⬢ MODS  [ Mods ▾  3/5 on ]  ● pending  [ ↻ Apply ]  ⚙ Manage │
╰────────────────────────────────────────────────────────╯

Features

  • Dropdown toolbar above the prompt listing every mod it knows about, marked ● (on) or ○ (off), with versions. Pick a mod to toggle it; Enable all and Disable all are included.
  • Manage pane (/mods or the ⚙ Manage button): one card per mod with Enable/Disable buttons and a ★ Save as default button.
  • Per-session choices: selections are stored per session id. New sessions start from your saved default (everything on unless you saved otherwise).
  • Apply button: a change shows a yellow ● pending marker until you press ↻ Apply (hotkey a).
  • mod-manager itself is locked on so you can always turn mods back on.

Hotkeys (when the bar has focus): a Apply, m Manage.

Install

Requires a Claude Code build with function-hook mods (plugin authoring support).

  1. Put this folder inside your mods folder, for example ~/.claude/dev-mods/<id>/mod-manager/, and accept the "Enable hot reloading for this session?" prompt.

  2. Or load it directly for one session:

    claude --plugin-dir /path/to/mod-manager
    

Make it available in every session

Add the folder to CLAUDE_CODE_PLUGIN_DIRS in the env block of ~/.claude/settings.json (separate several folders with ; on Windows, : elsewhere). CLAUDE_CODE_PLUGIN_DIR_WATCH=1 makes long-lived sessions (the desktop app, the SDK) hot-reload it too:

{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "/absolute/path/to/mod-manager",
    "CLAUDE_CODE_PLUGIN_DIR_WATCH": "1"
  }
}

New mods ask first

The first time mod-manager runs it treats every mod already present as known. After that, a mod it has never seen is refused until you decide: the MODS bar shows a magenta ✦ NEW MOD row with Enable and Keep off. Enable loads it right away; Keep off records the choice for this session. Your choices are remembered, so each mod asks once.

Where it looks for mods

~/.claude/dev-mods, ~/.claude/plugins/synced, ~/.claude/plugins/marketplaces, ~/.claude/skills, every folder in CLAUDE_CODE_PLUGIN_DIRS, and the folder beside mod-manager. A folder counts as a mod when it has a .claude-plugin/plugin.json and a hooks/hooks.json with a modules list. Mods that have loaded in any session are also listed, whatever their location.

How it works

  • A plugin.register hook sees every mod before it joins the session. Mods you switched off are refused, so none of their hooks, commands or tools load. It records each mod it sees in the plugin store so the dropdown can list it.
  • Sibling folders next to mod-manager are scanned for .claude-plugin/plugin.json, so mods that never loaded still appear.
  • ↻ Apply writes hooks/.reload. With hot reloading on, that save reloads all mods, and the refusal list is applied. Without hot reloading, changes take effect the next time mods load.

Limitations

  • Only mods in the user tier can be switched off; managed and built-in plugins are never refused.
  • A mod that loads before mod-manager cannot be refused by it.
  • The dropdown lists mods the manager has seen load plus siblings on disk. It does not scan marketplace-installed plugins that have never loaded.
  • No toolbar on the mobile surface (it has no dropdown element); /mods still works.

Development

claude plugin validate .

Files:

| Path | Purpose | | --- | --- | | .claude-plugin/plugin.json | Manifest | | hooks/hooks.json | Points at the hooks module | | hooks/register.tsx | All hooks: register filter, toolbar, pane, /mods | | types/index.d.ts | $.state contract (mods, disabled, isDirty) |

Contributing

Issues and pull requests are welcome. Please run claude plugin validate . before submitting.

License

MIT

其他同名作品

更多類似作品