mati_core/hooks/pre_bash.rs
1/// pre-bash.sh — catch cat/less/head/tail/bat/grep/rg file reads (M-09-B, M-13-D).
2///
3/// Thin wrapper that delegates to `mati hook-decide claude-pre-bash`.
4/// All enforcement logic lives in Rust (`hooks::decide` + `cli::hook_decide`).
5/// 2-5% miss rate accepted (C9 in ARCHITECTURE.md §24).
6pub const SCRIPT: &str = r#"#!/usr/bin/env bash
7set -euo pipefail
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-pre-bash
11"#;