{ "hooks": { "PostToolUse": [ { "matcher": "Write|Edit", "hooks": [ { "type": "command", "command": "f=$(command -v jq >/dev/null 2>&1 && jq -r '.tool_input.file_path // empty' || echo \"\"); case \"$f\" in *.py) python3 -m py_compile \"$f\" ;; */ba_dailies.sh|ba_dailies.sh) bash -n \"$f\" ;; *) : ;; esac", "statusMessage": "Syntax-checking edited file..." } ] } ], "PreToolUse": [ { "matcher": "Write|Edit", "hooks": [ { "type": "command", "command": "f=$(command -v jq >/dev/null 2>&1 && jq -r '.tool_input.file_path // empty' || echo \"\"); case \"$f\" in /tmp/*|/private/tmp/*) echo \"Blocked: use this repo's scratchpad/ directory instead of /tmp or /private/tmp (see CLAUDE.md's scratchpad policy).\" >&2; exit 2 ;; esac" } ] }, { "matcher": "Bash", "hooks": [ { "type": "command", "command": "cmd=$(command -v jq >/dev/null 2>&1 && jq -r '.tool_input.command // empty' || echo \"\"); if [[ \"$cmd\" =~ (^|[^A-Za-z0-9_])(/private)?/tmp(/|$|[^A-Za-z0-9_]) ]]; then echo \"Blocked: use this repo's scratchpad/ directory instead of /tmp or /private/tmp (see CLAUDE.md's scratchpad policy). Rewrite the command to read/write under scratchpad/.\" >&2; exit 2; fi" } ] } ] } }