com um clique
show-mp-disambig
// Surfaces the MP_DA_* marker lines emitted by the plugin-level SessionStart hooks, used to disambiguate between (a) shell-bypass and (b) bash -c with $-escape models of Cowork hook execution.
// Surfaces the MP_DA_* marker lines emitted by the plugin-level SessionStart hooks, used to disambiguate between (a) shell-bypass and (b) bash -c with $-escape models of Cowork hook execution.
Mac Cowork で、plugin-level SessionStart hook(host 側)から $CLAUDE_PLUGIN_DATA に書いた値が「別の chat session を跨いで」残るかを検証する probe。書き込み&読み戻しは hook(persist.sh)側で行い、その結果は SessionStart の stdout として context に出る。この skill body は対比用に「VM Bash 側から DATA が見えるか/hook が書いたファイルを読めるか」を確認する。
Surfaces UPE_PROBE_* marker lines to test whether the plugin-level UserPromptExpansion hook fires on Cowork. Invoking this skill via slash is itself the trigger; compares against UserPromptSubmit and SessionStart controls.
Triggers the plugin-level PreToolUse hooks by running a sentinel bash command, to test (via session export) whether Cowork runs PreToolUse hook commands through cmd.exe or a POSIX shell, and whether the inline block pattern actually blocks the bash tool.
Surfaces the EXEC_* marker lines emitted by the plugin-level SessionStart hooks, which run hook commands in EXEC FORM (args present). Used to test whether exec form resolves ${CLAUDE_PLUGIN_ROOT} to a real path and exports it as an env var on Cowork, where shell form (§2.1/§2.2) failed both.
Shows what skill-body CLAUDE_PLUGIN_ROOT and friends substitute to on Mac Cowork, whether the VM Bash tool can use that path, and whether the Read tool can read a bundled file at that host path.
Proves whether a skill frontmatter PreToolUse Bash hook fires on Cowork by emitting only a block decision (no echo). A marked bash should be blocked even though no frontmatter stdout surfaces.
| name | show-mp-disambig |
| description | Surfaces the MP_DA_* marker lines emitted by the plugin-level SessionStart hooks, used to disambiguate between (a) shell-bypass and (b) bash -c with $-escape models of Cowork hook execution. |
| user-invocable | true |
このプラグインの plugin-level SessionStart hook が session 開始時に 12 種類のエントリを実行しています。直前の context(system-reminder / additional context / hook output として注入されたもの)から、以下のプレフィックスで始まる行を全て一字一句そのまま貼ってください。プレフィックスが見当たらない場合は「無し」と明記してください。
MP_DA_CONTROL= (変数なしの対照、必ず出るはず)MP_DA_DQ= (echo MP_DA_DQ="double-quoted")MP_DA_DQ_INNER= (echo MP_DA_DQ_INNER=hello-"middle"-world)MP_DA_HOME= (echo MP_DA_HOME=$HOME、bare)MP_DA_HOME_BRACE= (echo MP_DA_HOME_BRACE=${HOME})MP_DA_PATH= (echo MP_DA_PATH=$PATH)MP_DA_NUL= (echo MP_DA_NUL=$NO_SUCH_VAR_EXPECT_EMPTY)MP_DA_BASH_HOME= (bash -c 'echo MP_DA_BASH_HOME=$HOME')MP_DA_BASH_HOST= (bash -c 'echo MP_DA_BASH_HOST=$(hostname)')MP_DA_BASH_PATH= (bash -c 'echo MP_DA_BASH_PATH=$PATH')MP_DA_BASH_WSL_LIB= (bash -c '... [ -e /usr/lib/wsl/lib ] ...')MP_DA_BASH_MNT_C= (bash -c '... [ -d /mnt/c ] ...')判定の見方:
Disambiguator A:double-quote
MP_DA_DQ=double-quoted → shell parser が走っている(double-quote が consume された)MP_DA_DQ="double-quoted" → shell parser を通っていない or " が escape されているMP_DA_DQ_INNER=hello-middle-world vs hello-"middle"-world も同様Disambiguator B:env が値を持つ $VAR
MP_DA_HOME=/home/... or /c/Users/... → shell parser + env 展開が走っているMP_DA_HOME=$HOME literal → shell parser が走っていない、または $ が escape されているMP_DA_PATH= の挙動が同様(PATH は確実に env に値を持つ)Disambiguator C:unset env var
MP_DA_NUL= (空) → shell parser + env 展開が走っている(unset → empty に化けた)MP_DA_NUL=$NO_SUCH_VAR_EXPECT_EMPTY literal → shell parser を通っていない控え(既知)
MP_DA_BASH_HOME=/home/... → inner bash の展開で $HOME が解決(CLI でも Cowork でも展開できるはず。env を持ち込めれば)Disambiguator D:hook の実行環境が WSL2 かどうか(bash -c 経由で env 展開させて確認)
top-level の MP_DA_PATH は Cowork では literal のままなので、WSL 固有パスは bash -c 版で見る:
MP_DA_BASH_HOST= → hostname。Windows のマシン名(例 LAPTOP-...)なら WSL2(WSL2 は既定で Windows マシン名を hostname にする)。claude なら Cowork VM。MP_DA_BASH_PATH= → /usr/lib/wsl/lib や /mnt/c/Users/... を含んでいれば WSL2 で実行された決定打。MP_DA_BASH_WSL_LIB=present → /usr/lib/wsl/lib が存在(WSL2 ディストロ内にしか無いパス)。MP_DA_BASH_MNT_C=present → /mnt/c が存在(WSL の C: 自動マウント)。3 マーカー(HOME=/home/<user> + WSL_LIB=present + MNT_C=present、PATH に /usr/lib/wsl/lib)が揃えば「この hook は WSL2 Ubuntu で実行された」が再確認できる。逆に WSL_LIB=absent / MNT_C=absent / HOST=claude なら以前の結論を見直す材料になる。
最後に各観測点の verdict を 1 行ずつ書いてください(例:「DQ: literal で残った → shell bypass / HOME: literal $HOME → 同上 / NUL: empty → 矛盾」など)。