mati_core/hooks/session_start.rs
1/// SessionStart hook — register the files whose changes mati wants to hear about.
2///
3/// Claude Code starts no file watcher until a SessionStart hook returns
4/// `hookSpecificOutput.watchPaths`; every later `FileChanged` event depends on
5/// this one call. Fail-open: no output means no watcher, never a blocked session.
6pub const SCRIPT: &str = r#"#!/usr/bin/env bash
7# mati SessionStart hook — register FileChanged watch paths (fail-open)
8HOOKS_DIR="$(cd "$(dirname "$0")" && pwd)" && export PATH="$HOOKS_DIR:$PATH"
9command -v mati >/dev/null 2>&1 || exit 0
10cat > /dev/null
11mati watch-paths 2>/dev/null || true
12"#;