con un clic
fm-bashblock
// 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.
// 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.
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.
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.
| name | fm-bashblock |
| description | 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. |
| user-invocable | true |
| hooks | {"PreToolUse":[{"matcher":"Bash|mcp__workspace__bash","hooks":[{"type":"command","command":"bash -c 'input=$(cat); if printf \"%s\" \"$input\" | grep -q \"FMBLOCK_MARKER\"; then printf \"%s\" \"{\\\"decision\\\":\\\"block\\\",\\\"reason\\\":\\\"FM-BASH-BLOCKED-NO-ECHO\\\"}\"; fi'"}]}]} |
この skill の frontmatter に PreToolUse(Bash) hook が 1 つだけ入っています。その hook は
echo を一切せず、bash の中に FMBLOCK_MARKER という文字列が含まれるときだけ
{"decision":"block","reason":"FM-BASH-BLOCKED-NO-ECHO"} という block 決定だけを出します。
狙い: frontmatter hook の stdout は Cowork で context に surface しないことは既に分かっている。 ここで block 決定(制御)だけを使えば、echo が見えなくても「frontmatter PreToolUse:Bash hook が 実際に発火しているか」を直接判定できる。
⚠ 必ず resume を挟まない fresh session で実行してください(frontmatter hook 登録は resume で失効するため)。
次の 2 つの bash を順に、それぞれ別々に実行してください。
echo "FM-MARKED ran (should be BLOCKED) FMBLOCK_MARKER host=$(hostname)"
echo "FM-CONTROL ran (should run) host=$(hostname)"
各コマンドについて、次のどちらかを明記してください:
FM-BASH-BLOCKED-NO-ECHO)が出て、echo の出力は出なかったFM-MARKED ran ... / FM-CONTROL ran ... host=... の出力が出た