Skip to content

Instantly share code, notes, and snippets.

View userflowborys's full-sized avatar
🏠
Working from home

Borys Saikevych userflowborys

🏠
Working from home
View GitHub Profile
@userflowborys
userflowborys / claude-hooks-v2.json
Last active April 29, 2026 19:02
Claude Code hooks: Haiku validates Opus in real time — regex pre-filter + prompt hooks for catching fabrication, premature completion, unverified locators
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "FILE_PATH=$(jq -r '.tool_input.file_path // \"\"' 2>/dev/null); ROOT=$(git rev-parse --show-toplevel 2>/dev/null); REL_PATH=${FILE_PATH#$ROOT/}; if echo \"$REL_PATH\" | grep -qE \"^(tests/|src/ui/)\"; then exit 0; else echo '{\"decision\": \"allow\"}'; fi",
"timeout": 5