{
    "description": "Hooks for the three-phase connector flow. State lives in .connector-dev/<provider>/run.json; there is no phase ledger. Logic lives in scripts/hooks/ (Node, testable) — matchers here match tool NAMES, so command/path inspection happens in the scripts. NOTHING HERE MAY BLOCK A TOOL CALL: the flow runs unattended, so a refused call it cannot work around ends the run. The one exception is the Stop hook, which blocks the turn from *ending* while a phase is still owed — that keeps the run going rather than stopping it.",
    "hooks": {
        "UserPromptSubmit": [
            {
                "matcher": "",
                "hooks": [
                    {
                        "type": "command",
                        "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/prompt-router.js\"",
                        "timeout": 5
                    }
                ]
            }
        ],
        "SessionStart": [
            {
                "matcher": "startup|resume",
                "hooks": [
                    {
                        "type": "command",
                        "command": "sh \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/session-start.sh\"",
                        "timeout": 60
                    }
                ]
            }
        ],
        "PostToolUse": [
            {
                "matcher": "Write|Edit",
                "hooks": [
                    {
                        "type": "command",
                        "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/post-write-yaml.js\"",
                        "timeout": 5
                    }
                ]
            },
            {
                "matcher": "WebFetch",
                "hooks": [
                    {
                        "type": "command",
                        "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/post-fetch-dedup.js\"",
                        "timeout": 5
                    }
                ]
            }
        ],
        "Stop": [
            {
                "matcher": "",
                "hooks": [
                    {
                        "type": "command",
                        "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/report-run-status.js\" --mode stop",
                        "timeout": 5
                    }
                ]
            }
        ],
        "PreCompact": [
            {
                "matcher": "",
                "hooks": [
                    {
                        "type": "command",
                        "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/report-run-status.js\" --mode compact",
                        "timeout": 5
                    }
                ]
            }
        ]
    }
}
