Skip to main content

mati_core/hooks/
file_changed.rs

1/// FileChanged hook — incremental freshness for a watched file.
2///
3/// Fires only for paths the SessionStart hook handed back in `watchPaths`.
4/// Reparses the file so `content_hash` and staleness follow the edit instead
5/// of waiting for the next `mati init`. No decision, no stdout. Fail-open.
6pub const SCRIPT: &str = r#"#!/usr/bin/env bash
7# mati FileChanged hook — incremental freshness (fail-open)
8HOOKS_DIR="$(cd "$(dirname "$0")" && pwd)" && export PATH="$HOOKS_DIR:$PATH"
9command -v mati >/dev/null 2>&1 || exit 0
10exec mati hook-decide claude-file-changed
11"#;