jl-cmd-projects/claude-dev-env/tree/main/packages/subagent-models
subagent-models
サブエージェントのモデルとエージェント種別をオン/オフにし、サブエージェントが実行する強度を、/config の既定値として、または /subagent-models で1セッションだけ設定します。
この mod について
subagent-models
サブエージェントが使えるモデルとエージェント種別、および実行時の強度を決める Claude Code mod です。
できること
- 無効なモデルを指定した spawn は、代わりに既定モデルで実行されます。
offActionをdenyにすると、使用すべきモデル名を示すメッセージとともに spawn が拒否されます。 - 完全なモデル id はファミリー単位で数えられます。
claude-fable-5-1は fable です。 - 無効なエージェント種別はモデルのエージェント一覧に残りますが、それを指定した spawn は拒否されます。
- 無効なスキルもモデルのスキル一覧には表示されます。モデルまたはあなたが実行すると、スキル本文が無効であることを示す注記に置き換わるため、モデルはそのスキルを飛ばします。
tddのような短い名前はpstack:tddにも一致します。 - 既定モデルは常に許可されるため、無効にしたモデルには必ず移動先があります。
- サブエージェントが行うすべてのリクエストは、設定した強度で実行されます。メインの会話は独自のモデルと強度を保ちます。
applyToRunningをオンにすると、実行中のサブエージェントにも次のリクエストから強度の変更が届きます。オフの場合、applyまたはバーのapply nowボタンですべてを移動するまで、各サブエージェントは開始時の強度を保ちます。- エージェント定義からモデルを得るサブエージェントは、最初のリクエストで捕捉され、同じ方法で移動します。
- fork は親を継承してそのまま通過します。モデルを指定しない spawn も同じです。
- フッターのピルには既定モデルと強度が
opus/mediumのように表示されます。*はセッションが既定値と異なることを示します。クリックするとバーを開閉します。
設定
/config には、新しいセッションが開始するたびに使う既定値が入ります:
| 設定 | 選択肢 | 既定値 |
|---|---|---|
| Opus サブエージェント | on, off | on |
| Fable サブエージェント | on, off | off |
| Sonnet サブエージェント | on, off | off |
| Haiku サブエージェント | on, off | on |
| 既定のサブエージェントモデル | opus, sonnet, haiku, fable | opus |
| サブエージェントの強度 | inherit, low, medium, high, xhigh, max | medium |
| spawn が無効なモデルを指定したとき | move, deny | move |
| 強度の変更を実行中のサブエージェントへ届ける | on, off | on |
| 無効なエージェント種別 | Explore, Plan のようなカンマ区切りの種別 | none |
| 無効なスキル | pstack:tdd, simplify のようなカンマ区切りのスキル | none |
| スキルを未使用とみなすまでの日数 | unused after メニューの開始カットオフとなる整数 | 14 |
このコマンドは既定モデルを無効にすることも、無効なモデルを既定モデルにすることも拒否します。
このセッションだけ
/subagent-models は次の spawn から現在のセッションを変更し、他のセッションには影響しません。
/subagent-modelsは有効な値を表示し、このセッションで変更したものに印を付けます。/subagent-models fable onはこのセッションだけ1つの値を設定します。設定名はどれでも使えますが、選択肢の1つを指定します。/subagent-models agentsはこのセッションで提供されているエージェント種別を、それぞれのスイッチとともに一覧表示します。/subagent-models agent Explore offはこのセッションだけ1つのエージェント種別を無効にします。onで再び有効にできます。/subagent-models skillsはセッションにあるスキルを、それぞれのスイッチとともに一覧表示します。/subagent-models skill pstack:tdd offはこのセッションだけスキルを無効にします。- プロンプトの上にある枠付きバーは、4つの等幅列のグリッドにすべての設定を収めます。ヘッダー行にはタイトル、
opus · medium · 2 of 4 models onのような概要、minimizeボタンがあります。その下の4色の帯は有効なモデルを示し、さらに下の4つのモデル項目にはドット、名前、onまたはoffボタンがあります。次の行には既定モデル、強度、無効化時の動作、実行中サブエージェントのドロップダウンがあります。最後の行にはagentsとskillsボタン、apply to running、保存またはリセットするmoreメニューがあります。フッターの◈ opus/medium ▴ピルを1回クリックするとバーが開閉します。 agentsとskillsボタンは、enable all、disable all、そしてエージェント種別またはスキルごとの1行を持つパネルを開きます。各行にはドット、名前、右端の on または off ボタンがあります。行は最長の名前と同じ幅のセルに置かれるため、列がそろいます。44文字を超える名前は末尾を残して中央部分を失います。行はPSTACKやBRAND-VOICEのような名前空間ごとの小文字大文字見出しの下に、件数とともに並びます。見出しを押すとグループを折りたためます。16を超えるグループは折りたたまれて始まり、show moreボタンで一度に 40 行ずつ開きます。16を超えるリストはトランスクリプト横のサイドペインで開き、ペインの幅に応じた等幅の列に並びます。ボタンはサイドペインなら▸、インラインパネルなら▴を示します。ボタンをもう一度押すかペインを閉じるまで、選択後もパネルは開いたままです。選択はすぐに反映され、変更内容を示すトーストが出ます。- mod は各スキルの実行時刻を独自のストアに記録するため、
skills一覧とパネルに最終使用時刻を表示できます。スキルパネルのsort: recentはチップを直近 N 日に使用、N+ 日未使用、未使用に分け、各チップに経過時間を表示して新しい順に並べます。unused afterメニューは 14、28、56 日からカットオフを選び、開始値はstaleDays設定です。turn off unused Nd+ (count)は記録された日付がそのカットオフより古いスキルを無効にします。日付のないスキルがこのボタンで無効になることはありません。 /subagent-models barはバーを最小化または展開します。/subagent-models seed <file>はバックフィルファイルから最終使用日を mod 独自のストアへ読み込みます。ストアはコマンドを実行したアカウントの Claude 設定フォルダーにあるため、各アカウントで1回ずつ実行してください。/subagent-models applyは実行中のすべてのサブエージェントを現在の強度へ今すぐ移動します。/subagent-models saveはこのセッションの値を/configの既定値へ書き込みます。/subagent-models resetはこのセッションの値を破棄し、既定値を再び適用します。
最終使用日のバックフィル
この mod が記録するのは読み込まれた日以降の実行だけです。scripts/backfill-last-used.mjs はマシン上のすべての Claude アカウントの保存済みトランスクリプトを読み、モデルが実行したスキルと入力したスラッシュコマンドについて、それぞれ最新の日付を書き込みます:
node packages/subagent-models/scripts/backfill-last-used.mjs --out dates.json
すべての ~/.claude* フォルダーと、projects フォルダーを持つすべての ~/.claude-profiles/* フォルダーをスキャンします。すでにスキャンしたフォルダーへのリンクであるフォルダーは飛ばし、各フォルダーのトランスクリプト数とスキル実行数を出力します。--root <config dir> を追加すると指定したフォルダーだけをスキャンし、--exclude <text> ではパスにその文字列を含むフォルダーを除外します。その後、各アカウントで /subagent-models seed dates.json を実行します。スクリプトのテストは node --test packages/subagent-models/scripts/backfill-last-used.test.mjs で実行します。
インストール
完全な npx claude-dev-env インストールでは claude-dev-env マーケットプレイスを追加し、ユーザースコープに mod をインストールします。そのため、その設定フォルダー配下のすべての Claude Code セッションで読み込まれます。--no-subagent-models または CDE_INSTALL_SUBAGENT_MODELS=0 を指定するとこの手順を省略します。
インストーラーは実行のたびにプラグインを削除して再インストールします。Claude Code はプラグインをアンインストールすると、そのプラグインが保存した /config の値を削除するため、インストーラー実行後は Settings 表の既定値が再び適用されます。
手動でインストールする場合:
claude plugin marketplace add jl-cmd/claude-dev-env
claude plugin install subagent-models@claude-dev-env
または、1セッションだけクローンから読み込みます:
claude --plugin-dir packages/subagent-models
テスト
claude plugin validate .
claude plugin test .
Claude Code 2.1.288 でビルドとテストを行っています。mod API はアーリーアクセスで、リリースによって変わる可能性があります。
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add jl-cmd-projects/claude-dev-env claude plugin install subagent-models
原文 / README
subagent-models
A Claude Code mod that decides which models and agent types subagents may run as, and the effort they run at.
What it does
- A spawn that names a turned-off model runs on the default model instead. With
offActionset todeny, the spawn is refused with a message that names the model to use. - A full model id counts by its family.
claude-fable-5-1is fable. - A turned-off agent type leaves the model's agent listing, and a spawn that names it is refused.
- A turned-off skill still appears in the model's skill listing. When the model or you run it, the skill's text is replaced with a note that says it is off, so the model skips it. A short name such as
tddalso matchespstack:tdd. - The default model is always allowed, so a turned-off model always has somewhere to move.
- Every request a subagent makes runs at the effort you set. The main conversation keeps its own model and effort.
- With
applyToRunningon, an effort change reaches running subagents on their next request. With it off, each subagent keeps the effort it started with untilapply, or the bar'sapply nowbutton, moves them all. - A subagent whose model comes from its agent definition is caught on its first request and moved the same way.
- A fork inherits its parent and passes untouched. So does a spawn that names no model.
- The footer pill shows the default model and effort, as
opus/medium. A*marks a session that differs from the defaults. Clicking it opens or closes the bar.
Settings
/config holds the defaults every new session starts with:
| Setting | Options | Default |
|---|---|---|
| Opus subagents | on, off | on |
| Fable subagents | on, off | off |
| Sonnet subagents | on, off | off |
| Haiku subagents | on, off | on |
| Default subagent model | opus, sonnet, haiku, fable | opus |
| Subagent effort | inherit, low, medium, high, xhigh, max | medium |
| When a spawn names a turned-off model | move, deny | move |
| Effort changes reach running subagents | on, off | on |
| Turned-off agent types | comma-separated agent types, such as Explore, Plan | none |
| Turned-off skills | comma-separated skills, such as pstack:tdd, simplify | none |
| Days before a skill counts as unused | a whole number of days, the starting cutoff of the unused after menu | 14 |
The command refuses to turn off the default model, and refuses a default model that is turned off.
This session only
/subagent-models changes the current session from its next spawn, and leaves other sessions alone.
/subagent-modelsprints the values in force and marks the ones this session changed./subagent-models fable onsets one value for this session. Any setting name works, with one of its options./subagent-models agentslists the agent types offered so far in this session, each with its switch./subagent-models agent Explore offturns one agent type off for this session.onturns it back on./subagent-models skillslists the skills the session has, each with its switch./subagent-models skill pstack:tdd offturns one skill off for this session.- A framed bar above the prompt holds every setting in a grid of four equal columns. The header row has the title, a summary such as
opus · medium · 2 of 4 models on, and aminimizebutton. Under it a strip of four colored segments shows which models are on, and a row of four model entries below it has a dot, the name and anonoroffbutton each. The next row has dropdowns for the default model, effort, the turned-off action, and running subagents. The last row has theagentsandskillsbuttons,apply to running, and amoremenu that saves or resets. A pill in the footer,◈ opus/medium ▴, opens and closes the bar with one click. - The
agentsandskillsbuttons open a panel withenable all,disable all, and one row per agent type or skill: a dot, the name, and an on or off button at the right edge. Every row sits in a cell as wide as the longest name, so the rows line up in columns. A name longer than 44 characters keeps its tail and loses its middle. The rows sit under a small-caps heading per namespace, such asPSTACKorBRAND-VOICE, with a count. Press a heading to fold or open its group. A group of more than 16 starts folded, and opens 40 rows at a time with ashow morebutton. A list of more than 16 opens in a side pane beside the transcript, laid out in as many equal columns as the pane is wide. The button shows▸for a side pane and▴for an inline panel. A panel stays open across picks until you press its button again or close the pane. A pick applies at once and a toast says what changed. - The mod records the time of each skill run in its own store, so the
skillslisting and panel can show when a skill was last used. The skills panel hassort: recent, which groups the chips as used in the last N days, unused N+ days, and never seen, newest first, with the age on each chip. Theunused aftermenu picks the cutoff from 14, 28 or 56 days, starting at thestaleDayssetting, andturn off unused Nd+ (count)turns off the skills with a recorded date older than that cutoff. A skill with no recorded date is never turned off by that button. /subagent-models barminimizes the bar or expands it./subagent-models seed <file>loads last-used dates from a backfill file into the mod's own store. The store lives in the Claude config folder of the account that runs the command, so run it once in each account./subagent-models applymoves every running subagent to the current effort now./subagent-models savewrites this session's values to the/configdefaults./subagent-models resetdrops this session's values, so the defaults apply again.
Backfill last-used dates
The mod only records runs from the day it loads. scripts/backfill-last-used.mjs reads the saved transcripts of every Claude account on the machine and writes the newest date of each skill run, for skills the model ran and slash commands you typed:
node packages/subagent-models/scripts/backfill-last-used.mjs --out dates.json
It scans every ~/.claude* folder and every ~/.claude-profiles/* folder that holds a projects folder, skips a folder that is a link to one it already scanned, and prints the transcript and skill-run count for each. Add --root <config dir> to scan only the folders you name, or --exclude <text> to skip a folder whose path contains the text. Then run /subagent-models seed dates.json in each account. Run the script's tests with node --test packages/subagent-models/scripts/backfill-last-used.test.mjs.
Install
A full npx claude-dev-env install adds the claude-dev-env marketplace and installs the mod at user scope, so every Claude Code session under that config folder loads it. --no-subagent-models or CDE_INSTALL_SUBAGENT_MODELS=0 skips that step.
The installer removes and reinstalls the plugin on each run. Claude Code drops a plugin's saved /config values when it uninstalls the plugin, so after an installer run the defaults in the Settings table apply again.
To install it by hand:
claude plugin marketplace add jl-cmd/claude-dev-env
claude plugin install subagent-models@claude-dev-env
Or load it from a clone for one session:
claude --plugin-dir packages/subagent-models
Test
claude plugin validate .
claude plugin test .
Built and tested on Claude Code 2.1.288. The mod API is in early access and can change between releases.
同名の他の作品
- subagent-modelsahbanavi · ★ 1

