Stats
Actions
Tags
From numerical
Runs shell scripts before and after every Write/Edit tool call to enforce code quality or formatting, with a cleanup script on session stop. Executes bash and can modify files.
3 events · 4 hooks
Safety signals detected in this hook configuration
Where this hook configuration is defined
Defined inline in plugin.json manifest
Event handlers and matchers — expand Raw Configuration for the full JSON
root=$(git rev-parse --show-toplevel 2>/dev/null); if [ -n "$root" ]; then changed=$(git -C "$root" diff --name-only HEAD -- '*.py' '*.dart' 2>/dev/null); if [ -z "$changed" ]; then echo '[numerical] No numeric source changes — skipping test gate'; exit 0; fi; if [ -f "$root/pytest.ini" ] || [ -f "$root/pyproject.toml" ] || [ -f "$root/setup.py" ]; then cd "$root" && python -m pytest --tb=short -q 2>&1 | tail -10; result=$?; if [ $result -ne 0 ]; then echo 'Tests failed. Fix before ending session.'; exit 2; fi; elif [ -f "$root/pubspec.yaml" ]; then cd "$root" && dart test 2>&1 | tail -10; result=$?; if [ $result -ne 0 ]; then echo 'Tests failed. Fix before ending session.'; exit 2; fi; fi; fiEdit|Writefile=$(echo "$CLAUDE_TOOL_INPUT" | jq -r '.file_path // .path // empty' 2>/dev/null); if [ -n "$file" ] && echo "$file" | grep -qiE '(credentials|secrets|private.key|\.env$|\.env\.)'; then echo '{"decision":"block","reason":"Secret file edit blocked by numerical"}'; exit 2; fiEdit|Writefile=$(echo "$CLAUDE_TOOL_INPUT" | jq -r '.file_path // .path // empty' 2>/dev/null); if [ -n "$file" ] && echo "$file" | grep -qE '\.(py)$'; then echo "[numerical] Numeric lint: $file"; cd "$(git rev-parse --show-toplevel 2>/dev/null || echo .)" && if command -v ruff >/dev/null 2>&1; then ruff check "$file" --select E,W,NPY --quiet 2>&1 | tail -20 || true; elif command -v flake8 >/dev/null 2>&1; then flake8 "$file" --max-line-length 120 --quiet 2>&1 | tail -20 || true; fi; fiEdit|Writefile=$(echo "$CLAUDE_TOOL_INPUT" | jq -r '.file_path // .path // empty' 2>/dev/null); if [ -n "$file" ] && echo "$file" | grep -qE '\.(dart)$'; then echo "[numerical] Dart lint: $file"; cd "$(git rev-parse --show-toplevel 2>/dev/null || echo .)" && if command -v dart >/dev/null 2>&1; then dart analyze "$file" 2>&1 | tail -20 || true; fi; finpx claudepluginhub hungrytech/hungrytech-claude-skills --plugin numerical